From 49b273987392f8f639739e3fa3fe7210de9af88a Mon Sep 17 00:00:00 2001 From: MT Date: Thu, 21 Nov 2024 14:06:36 +0100 Subject: [PATCH 1/6] Create es.json --- src/i18n/es.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/i18n/es.json diff --git a/src/i18n/es.json b/src/i18n/es.json new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/src/i18n/es.json @@ -0,0 +1 @@ + From 3771ebf890f5c3ea88b446a8422aca8660d2f69d Mon Sep 17 00:00:00 2001 From: MT Date: Thu, 21 Nov 2024 14:17:50 +0100 Subject: [PATCH 2/6] Add es folder. --- src/i18n/{ => es}/es.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/i18n/{ => es}/es.json (100%) diff --git a/src/i18n/es.json b/src/i18n/es/es.json similarity index 100% rename from src/i18n/es.json rename to src/i18n/es/es.json From a922943bf57eebc9f9f206020725bc13f4b8a0a0 Mon Sep 17 00:00:00 2001 From: MT Date: Thu, 21 Nov 2024 14:20:01 +0100 Subject: [PATCH 3/6] Add en folder. --- package.json | 2 +- src/context/LanguageContext.tsx | 2 +- src/i18n/{ => en}/en.json | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/i18n/{ => en}/en.json (100%) diff --git a/package.json b/package.json index 1d0ad898..78f14625 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "test": "vitest", "preview": "vite preview", "extract": "formatjs extract 'src/**/*.{ts,tsx}' --ignore='**/*.d.ts' --out-file './extracted/en.json' --id-interpolation-pattern '[sha512:contenthash:base64:6]'", - "extract-simple": "formatjs extract 'src/**/*.{ts,tsx}' --ignore='**/*.d.ts' --out-file './src/i18n/en.json' --id-interpolation-pattern '[sha512:contenthash:base64:6]' --format simple", + "extract-simple": "formatjs extract 'src/**/*.{ts,tsx}' --ignore='**/*.d.ts' --out-file 'src/i18n/en/en.json' --id-interpolation-pattern '[sha512:contenthash:base64:6]' --format simple", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", "prepare": "husky" diff --git a/src/context/LanguageContext.tsx b/src/context/LanguageContext.tsx index da44ca8e..22e82cbd 100644 --- a/src/context/LanguageContext.tsx +++ b/src/context/LanguageContext.tsx @@ -2,7 +2,7 @@ import { IntlProvider } from "react-intl"; import { createContext, useContext, useState } from "react"; import { detectBrowserLanguage } from "@/utils"; -import en from "@/i18n/en.json"; +import en from "@/i18n/en/en.json"; const DEFAULT_LOCALE = "en"; diff --git a/src/i18n/en.json b/src/i18n/en/en.json similarity index 100% rename from src/i18n/en.json rename to src/i18n/en/en.json From 190ba69126b62b14046da9b0b230bcf717bdb613 Mon Sep 17 00:00:00 2001 From: MT Date: Thu, 21 Nov 2024 14:40:24 +0100 Subject: [PATCH 4/6] Update Crowdin configuration file --- crowdin.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 crowdin.yml diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 00000000..35d61b48 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,3 @@ +files: + - source: /**/i18n/en/*.json + translation: /**/i18n/%two_letters_code%/%original_file_name% From e62da38478e01d322339e39a4e0496013c887f40 Mon Sep 17 00:00:00 2001 From: MT Date: Thu, 21 Nov 2024 14:44:34 +0100 Subject: [PATCH 5/6] Add en folder. --- package.json | 2 +- src/context/LanguageContext.tsx | 2 +- src/i18n/en/{en.json => test.json} | 0 src/i18n/es/es.json | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) rename src/i18n/en/{en.json => test.json} (100%) delete mode 100644 src/i18n/es/es.json diff --git a/package.json b/package.json index 78f14625..a9292008 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "test": "vitest", "preview": "vite preview", "extract": "formatjs extract 'src/**/*.{ts,tsx}' --ignore='**/*.d.ts' --out-file './extracted/en.json' --id-interpolation-pattern '[sha512:contenthash:base64:6]'", - "extract-simple": "formatjs extract 'src/**/*.{ts,tsx}' --ignore='**/*.d.ts' --out-file 'src/i18n/en/en.json' --id-interpolation-pattern '[sha512:contenthash:base64:6]' --format simple", + "extract-simple": "formatjs extract 'src/**/*.{ts,tsx}' --ignore='**/*.d.ts' --out-file 'src/i18n/en/test.json' --id-interpolation-pattern '[sha512:contenthash:base64:6]' --format simple", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", "prepare": "husky" diff --git a/src/context/LanguageContext.tsx b/src/context/LanguageContext.tsx index 22e82cbd..1c6e7a09 100644 --- a/src/context/LanguageContext.tsx +++ b/src/context/LanguageContext.tsx @@ -2,7 +2,7 @@ import { IntlProvider } from "react-intl"; import { createContext, useContext, useState } from "react"; import { detectBrowserLanguage } from "@/utils"; -import en from "@/i18n/en/en.json"; +import en from "@/i18n/en/test.json"; const DEFAULT_LOCALE = "en"; diff --git a/src/i18n/en/en.json b/src/i18n/en/test.json similarity index 100% rename from src/i18n/en/en.json rename to src/i18n/en/test.json diff --git a/src/i18n/es/es.json b/src/i18n/es/es.json deleted file mode 100644 index 8b137891..00000000 --- a/src/i18n/es/es.json +++ /dev/null @@ -1 +0,0 @@ - From b334bb59f8a8a22076096695553739a8e94ad17c Mon Sep 17 00:00:00 2001 From: MT Date: Thu, 21 Nov 2024 14:50:45 +0100 Subject: [PATCH 6/6] Update Crowdin configuration file --- crowdin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crowdin.yml b/crowdin.yml index 35d61b48..cc13f9c7 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,3 +1,3 @@ files: - - source: /**/i18n/en/*.json + - source: /**/i18n/en/*.* translation: /**/i18n/%two_letters_code%/%original_file_name%