@intlayer/docs 7.5.10 → 7.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blog/ar/intlayer_with_i18next.md +0 -2
- package/blog/ar/intlayer_with_next-i18next.md +0 -2
- package/blog/ar/intlayer_with_react-i18next.md +0 -2
- package/blog/de/intlayer_with_i18next.md +0 -45
- package/blog/de/intlayer_with_next-i18next.md +0 -46
- package/blog/de/intlayer_with_react-i18next.md +0 -2
- package/blog/en/intlayer_with_i18next.md +0 -46
- package/blog/en/intlayer_with_next-i18next.md +0 -48
- package/blog/en/intlayer_with_next-intl.md +0 -44
- package/blog/en/intlayer_with_react-i18next.md +0 -44
- package/blog/en/intlayer_with_react-intl.md +0 -42
- package/blog/en/intlayer_with_vue-i18n.md +0 -44
- package/blog/en-GB/intlayer_with_i18next.md +0 -45
- package/blog/en-GB/intlayer_with_next-i18next.md +0 -47
- package/blog/en-GB/intlayer_with_next-intl.md +0 -42
- package/blog/en-GB/intlayer_with_react-i18next.md +0 -43
- package/blog/en-GB/intlayer_with_react-intl.md +0 -42
- package/blog/en-GB/intlayer_with_vue-i18n.md +0 -46
- package/blog/es/intlayer_with_i18next.md +0 -45
- package/blog/es/intlayer_with_next-i18next.md +0 -47
- package/blog/es/intlayer_with_next-intl.md +0 -42
- package/blog/es/intlayer_with_react-i18next.md +0 -43
- package/blog/es/intlayer_with_react-intl.md +0 -42
- package/blog/es/intlayer_with_vue-i18n.md +0 -46
- package/blog/fr/intlayer_with_i18next.md +0 -45
- package/blog/fr/intlayer_with_next-i18next.md +0 -47
- package/blog/fr/intlayer_with_next-intl.md +0 -42
- package/blog/fr/intlayer_with_react-i18next.md +0 -43
- package/blog/fr/intlayer_with_react-intl.md +0 -42
- package/blog/fr/intlayer_with_vue-i18n.md +0 -46
- package/blog/hi/intlayer_with_i18next.md +0 -2
- package/blog/hi/intlayer_with_next-i18next.md +0 -2
- package/blog/hi/intlayer_with_react-i18next.md +0 -2
- package/blog/id/intlayer_with_i18next.md +0 -2
- package/blog/id/intlayer_with_next-i18next.md +0 -2
- package/blog/id/intlayer_with_react-i18next.md +0 -2
- package/blog/it/intlayer_with_i18next.md +0 -2
- package/blog/it/intlayer_with_next-i18next.md +0 -2
- package/blog/it/intlayer_with_react-i18next.md +0 -2
- package/blog/ja/intlayer_with_i18next.md +0 -45
- package/blog/ja/intlayer_with_next-i18next.md +0 -46
- package/blog/ja/intlayer_with_next-intl.md +0 -42
- package/blog/ja/intlayer_with_react-i18next.md +0 -42
- package/blog/ja/intlayer_with_react-intl.md +0 -42
- package/blog/ja/intlayer_with_vue-i18n.md +0 -46
- package/blog/ko/intlayer_with_i18next.md +0 -2
- package/blog/ko/intlayer_with_next-i18next.md +0 -2
- package/blog/ko/intlayer_with_react-i18next.md +0 -1
- package/blog/pl/intlayer_with_i18next.md +0 -45
- package/blog/pl/intlayer_with_next-i18next.md +0 -46
- package/blog/pl/intlayer_with_next-intl.md +0 -42
- package/blog/pl/intlayer_with_react-i18next.md +0 -43
- package/blog/pl/intlayer_with_react-intl.md +0 -42
- package/blog/pl/intlayer_with_vue-i18n.md +0 -46
- package/blog/pt/intlayer_with_i18next.md +0 -2
- package/blog/pt/intlayer_with_next-i18next.md +0 -2
- package/blog/pt/intlayer_with_react-i18next.md +0 -2
- package/blog/ru/intlayer_with_i18next.md +0 -45
- package/blog/ru/intlayer_with_next-i18next.md +0 -47
- package/blog/ru/intlayer_with_next-intl.md +0 -42
- package/blog/ru/intlayer_with_react-i18next.md +0 -43
- package/blog/ru/intlayer_with_react-intl.md +0 -42
- package/blog/ru/intlayer_with_vue-i18n.md +0 -46
- package/blog/tr/intlayer_with_i18next.md +0 -2
- package/blog/tr/intlayer_with_next-i18next.md +0 -1
- package/blog/tr/intlayer_with_react-i18next.md +0 -2
- package/blog/vi/intlayer_with_i18next.md +0 -2
- package/blog/vi/intlayer_with_next-i18next.md +0 -2
- package/blog/vi/intlayer_with_react-i18next.md +0 -2
- package/blog/zh/intlayer_with_i18next.md +0 -2
- package/blog/zh/intlayer_with_next-i18next.md +0 -2
- package/blog/zh/intlayer_with_react-i18next.md +0 -2
- package/blog/zh/intlayer_with_vue-i18n.md +0 -46
- package/dist/cjs/generated/blog.entry.cjs +58 -29
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +254 -97
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +30 -15
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +4 -2
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +58 -29
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +254 -97
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/esm/generated/frequentQuestions.entry.mjs +30 -15
- package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
- package/dist/esm/generated/legal.entry.mjs +4 -2
- package/dist/esm/generated/legal.entry.mjs.map +1 -1
- package/dist/types/generated/blog.entry.d.ts.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +3 -0
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/dist/types/generated/frequentQuestions.entry.d.ts.map +1 -1
- package/dist/types/generated/legal.entry.d.ts.map +1 -1
- package/docs/ar/cli/ci.md +137 -0
- package/docs/ar/cli/index.md +7 -1
- package/docs/ar/cli/list.md +39 -2
- package/docs/ar/cli/list_projects.md +131 -0
- package/docs/ar/intlayer_CMS.md +20 -0
- package/docs/ar/intlayer_with_next-i18next.md +0 -1
- package/docs/ar/intlayer_with_nextjs_14.md +28 -0
- package/docs/ar/intlayer_with_nextjs_15.md +28 -0
- package/docs/ar/intlayer_with_nextjs_16.md +28 -0
- package/docs/ar/intlayer_with_nextjs_no_locale_path.md +1159 -0
- package/docs/ar/plugins/sync-json.md +6 -2
- package/docs/de/cli/ci.md +137 -0
- package/docs/de/cli/index.md +7 -1
- package/docs/de/cli/list.md +39 -2
- package/docs/de/cli/list_projects.md +130 -0
- package/docs/de/intlayer_CMS.md +20 -0
- package/docs/de/intlayer_with_next-i18next.md +0 -1
- package/docs/de/intlayer_with_nextjs_14.md +28 -0
- package/docs/de/intlayer_with_nextjs_15.md +28 -0
- package/docs/de/intlayer_with_nextjs_16.md +28 -0
- package/docs/de/intlayer_with_nextjs_no_locale_path.md +1152 -0
- package/docs/de/plugins/sync-json.md +6 -2
- package/docs/en/cli/ci.md +137 -0
- package/docs/en/cli/index.md +14 -1
- package/docs/en/cli/list.md +39 -2
- package/docs/en/cli/list_projects.md +128 -0
- package/docs/en/interest_of_intlayer.md +1 -1
- package/docs/en/intlayer_CMS.md +20 -0
- package/docs/en/intlayer_with_next-i18next.md +0 -1
- package/docs/en/intlayer_with_nextjs_14.md +28 -0
- package/docs/en/intlayer_with_nextjs_15.md +28 -0
- package/docs/en/intlayer_with_nextjs_16.md +31 -1
- package/docs/en/intlayer_with_nextjs_no_locale_path.md +1132 -0
- package/docs/en/plugins/sync-json.md +6 -2
- package/docs/en-GB/cli/ci.md +137 -0
- package/docs/en-GB/cli/index.md +7 -1
- package/docs/en-GB/cli/list.md +39 -2
- package/docs/en-GB/cli/list_projects.md +130 -0
- package/docs/en-GB/intlayer_CMS.md +20 -0
- package/docs/en-GB/intlayer_with_next-i18next.md +0 -1
- package/docs/en-GB/intlayer_with_nextjs_14.md +28 -0
- package/docs/en-GB/intlayer_with_nextjs_15.md +28 -0
- package/docs/en-GB/intlayer_with_nextjs_16.md +28 -0
- package/docs/en-GB/intlayer_with_nextjs_no_locale_path.md +1154 -0
- package/docs/en-GB/plugins/sync-json.md +6 -2
- package/docs/es/cli/ci.md +137 -0
- package/docs/es/cli/index.md +7 -1
- package/docs/es/cli/list.md +39 -2
- package/docs/es/cli/list_projects.md +130 -0
- package/docs/es/intlayer_CMS.md +20 -0
- package/docs/es/intlayer_with_next-i18next.md +0 -1
- package/docs/es/intlayer_with_nextjs_14.md +28 -0
- package/docs/es/intlayer_with_nextjs_15.md +28 -0
- package/docs/es/intlayer_with_nextjs_16.md +28 -0
- package/docs/es/intlayer_with_nextjs_no_locale_path.md +1143 -0
- package/docs/es/plugins/sync-json.md +6 -2
- package/docs/fr/cli/ci.md +137 -0
- package/docs/fr/cli/index.md +7 -1
- package/docs/fr/cli/list.md +39 -2
- package/docs/fr/cli/list_projects.md +131 -0
- package/docs/fr/intlayer_CMS.md +20 -0
- package/docs/fr/intlayer_with_next-i18next.md +0 -1
- package/docs/fr/intlayer_with_nextjs_14.md +28 -0
- package/docs/fr/intlayer_with_nextjs_15.md +28 -0
- package/docs/fr/intlayer_with_nextjs_16.md +28 -0
- package/docs/fr/intlayer_with_nextjs_no_locale_path.md +1174 -0
- package/docs/fr/plugins/sync-json.md +9 -5
- package/docs/hi/cli/ci.md +137 -0
- package/docs/hi/cli/index.md +7 -1
- package/docs/hi/cli/list.md +38 -1
- package/docs/hi/cli/list_projects.md +130 -0
- package/docs/hi/intlayer_CMS.md +20 -0
- package/docs/hi/intlayer_with_next-i18next.md +0 -1
- package/docs/hi/intlayer_with_nextjs_14.md +28 -0
- package/docs/hi/intlayer_with_nextjs_15.md +28 -0
- package/docs/hi/intlayer_with_nextjs_16.md +28 -0
- package/docs/hi/intlayer_with_nextjs_no_locale_path.md +1151 -0
- package/docs/hi/plugins/sync-json.md +6 -2
- package/docs/id/cli/ci.md +137 -0
- package/docs/id/cli/index.md +7 -1
- package/docs/id/cli/list.md +38 -1
- package/docs/id/cli/list_projects.md +128 -0
- package/docs/id/intlayer_CMS.md +20 -0
- package/docs/id/intlayer_with_next-i18next.md +0 -1
- package/docs/id/intlayer_with_nextjs_14.md +28 -0
- package/docs/id/intlayer_with_nextjs_15.md +28 -0
- package/docs/id/intlayer_with_nextjs_16.md +28 -0
- package/docs/id/intlayer_with_nextjs_no_locale_path.md +1154 -0
- package/docs/id/plugins/sync-json.md +6 -2
- package/docs/it/cli/ci.md +137 -0
- package/docs/it/cli/index.md +7 -1
- package/docs/it/cli/list.md +39 -2
- package/docs/it/cli/list_projects.md +130 -0
- package/docs/it/intlayer_CMS.md +20 -0
- package/docs/it/intlayer_with_next-i18next.md +0 -1
- package/docs/it/intlayer_with_nextjs_14.md +28 -0
- package/docs/it/intlayer_with_nextjs_15.md +28 -0
- package/docs/it/intlayer_with_nextjs_16.md +28 -0
- package/docs/it/intlayer_with_nextjs_no_locale_path.md +1148 -0
- package/docs/it/plugins/sync-json.md +6 -2
- package/docs/ja/cli/ci.md +137 -0
- package/docs/ja/cli/index.md +7 -1
- package/docs/ja/cli/list.md +38 -1
- package/docs/ja/cli/list_projects.md +136 -0
- package/docs/ja/intlayer_CMS.md +20 -0
- package/docs/ja/intlayer_with_next-i18next.md +0 -1
- package/docs/ja/intlayer_with_nextjs_14.md +28 -0
- package/docs/ja/intlayer_with_nextjs_15.md +28 -0
- package/docs/ja/intlayer_with_nextjs_16.md +28 -0
- package/docs/ja/intlayer_with_nextjs_no_locale_path.md +1222 -0
- package/docs/ja/plugins/sync-json.md +6 -2
- package/docs/ko/cli/ci.md +137 -0
- package/docs/ko/cli/index.md +7 -1
- package/docs/ko/cli/list.md +38 -1
- package/docs/ko/cli/list_projects.md +128 -0
- package/docs/ko/intlayer_CMS.md +20 -0
- package/docs/ko/intlayer_with_next-i18next.md +0 -1
- package/docs/ko/intlayer_with_nextjs_14.md +28 -0
- package/docs/ko/intlayer_with_nextjs_15.md +28 -0
- package/docs/ko/intlayer_with_nextjs_16.md +28 -0
- package/docs/ko/intlayer_with_nextjs_no_locale_path.md +1205 -0
- package/docs/ko/plugins/sync-json.md +6 -2
- package/docs/pl/cli/ci.md +137 -0
- package/docs/pl/cli/index.md +7 -1
- package/docs/pl/cli/list.md +39 -2
- package/docs/pl/cli/list_projects.md +130 -0
- package/docs/pl/intlayer_CMS.md +20 -0
- package/docs/pl/intlayer_with_next-i18next.md +0 -1
- package/docs/pl/intlayer_with_nextjs_14.md +28 -0
- package/docs/pl/intlayer_with_nextjs_15.md +28 -0
- package/docs/pl/intlayer_with_nextjs_16.md +28 -0
- package/docs/pl/intlayer_with_nextjs_no_locale_path.md +1149 -0
- package/docs/pl/plugins/sync-json.md +6 -2
- package/docs/pt/cli/ci.md +137 -0
- package/docs/pt/cli/index.md +7 -1
- package/docs/pt/cli/list.md +39 -2
- package/docs/pt/cli/list_projects.md +134 -0
- package/docs/pt/intlayer_CMS.md +20 -0
- package/docs/pt/intlayer_with_next-i18next.md +0 -1
- package/docs/pt/intlayer_with_nextjs_14.md +28 -0
- package/docs/pt/intlayer_with_nextjs_15.md +28 -0
- package/docs/pt/intlayer_with_nextjs_16.md +28 -0
- package/docs/pt/intlayer_with_nextjs_no_locale_path.md +1152 -0
- package/docs/pt/plugins/sync-json.md +6 -2
- package/docs/ru/cli/ci.md +137 -0
- package/docs/ru/cli/index.md +7 -1
- package/docs/ru/cli/list.md +39 -2
- package/docs/ru/cli/list_projects.md +130 -0
- package/docs/ru/intlayer_CMS.md +20 -0
- package/docs/ru/intlayer_with_next-i18next.md +0 -1
- package/docs/ru/intlayer_with_nextjs_14.md +28 -0
- package/docs/ru/intlayer_with_nextjs_15.md +28 -0
- package/docs/ru/intlayer_with_nextjs_16.md +28 -0
- package/docs/ru/intlayer_with_nextjs_no_locale_path.md +1204 -0
- package/docs/ru/plugins/sync-json.md +6 -2
- package/docs/tr/cli/ci.md +137 -0
- package/docs/tr/cli/index.md +7 -1
- package/docs/tr/cli/list.md +39 -2
- package/docs/tr/cli/list_projects.md +134 -0
- package/docs/tr/intlayer_CMS.md +20 -0
- package/docs/tr/intlayer_with_next-i18next.md +0 -1
- package/docs/tr/intlayer_with_nextjs_14.md +28 -0
- package/docs/tr/intlayer_with_nextjs_15.md +28 -0
- package/docs/tr/intlayer_with_nextjs_16.md +28 -0
- package/docs/tr/intlayer_with_nextjs_no_locale_path.md +1159 -0
- package/docs/tr/plugins/sync-json.md +6 -2
- package/docs/uk/compiler.md +133 -0
- package/docs/uk/component_i18n.md +194 -0
- package/docs/uk/intlayer_with_nextjs_14.md +1646 -0
- package/docs/uk/intlayer_with_nextjs_15.md +1910 -0
- package/docs/uk/intlayer_with_nextjs_16.md +1763 -0
- package/docs/uk/intlayer_with_nextjs_no_locale_path.md +1159 -0
- package/docs/uk/intlayer_with_react_native+expo.md +715 -0
- package/docs/uk/packages/intlayer/getConfiguration.md +145 -0
- package/docs/uk/vs_code_extension.md +133 -0
- package/docs/vi/cli/ci.md +137 -0
- package/docs/vi/cli/index.md +7 -1
- package/docs/vi/cli/list.md +38 -1
- package/docs/vi/cli/list_projects.md +130 -0
- package/docs/vi/intlayer_CMS.md +20 -0
- package/docs/vi/intlayer_with_next-i18next.md +0 -1
- package/docs/vi/intlayer_with_nextjs_14.md +28 -0
- package/docs/vi/intlayer_with_nextjs_15.md +28 -0
- package/docs/vi/intlayer_with_nextjs_16.md +28 -0
- package/docs/vi/intlayer_with_nextjs_no_locale_path.md +1151 -0
- package/docs/vi/plugins/sync-json.md +6 -2
- package/docs/zh/cli/ci.md +137 -0
- package/docs/zh/cli/index.md +7 -1
- package/docs/zh/cli/list.md +38 -1
- package/docs/zh/cli/list_projects.md +130 -0
- package/docs/zh/intlayer_CMS.md +20 -0
- package/docs/zh/intlayer_with_next-i18next.md +0 -1
- package/docs/zh/intlayer_with_nextjs_14.md +28 -0
- package/docs/zh/intlayer_with_nextjs_15.md +28 -0
- package/docs/zh/intlayer_with_nextjs_16.md +28 -0
- package/docs/zh/intlayer_with_nextjs_no_locale_path.md +1206 -0
- package/docs/zh/plugins/sync-json.md +9 -5
- package/frequent_questions/ar/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/de/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/en/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/en-GB/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/es/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/fr/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/hi/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/id/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/it/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/ja/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/ko/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/pl/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/pt/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/ru/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/tr/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/vi/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/zh/SSR_Next_no_[locale].md +1 -1
- package/package.json +6 -6
- package/src/generated/blog.entry.ts +29 -0
- package/src/generated/docs.entry.ts +157 -0
- package/src/generated/frequentQuestions.entry.ts +15 -0
- package/src/generated/legal.entry.ts +2 -0
|
@@ -118,48 +118,6 @@ Si des modifications sont effectuées via la CLI pour traduire le JSON, ou en ut
|
|
|
118
118
|
|
|
119
119
|
Pour plus de détails sur le plugin `syncJSON`, veuillez consulter la [documentation du plugin syncJSON](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/plugins/sync-json.md).
|
|
120
120
|
|
|
121
|
-
### (Optionnel) Étape 3 : Implémenter des traductions JSON par composant
|
|
122
|
-
|
|
123
|
-
Par défaut, Intlayer chargera, fusionnera et synchronisera à la fois les fichiers JSON et les fichiers de déclaration de contenu. Consultez [la documentation sur la déclaration de contenu](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/dictionary/content_file.md) pour plus de détails. Mais si vous préférez, en utilisant un plugin Intlayer, vous pouvez également implémenter une gestion par composant des JSON localisés n'importe où dans votre base de code.
|
|
124
|
-
|
|
125
|
-
Pour cela, vous pouvez utiliser le plugin `loadJSON`.
|
|
126
|
-
|
|
127
|
-
```ts fileName="intlayer.config.ts"
|
|
128
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
129
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
130
|
-
|
|
131
|
-
const config: IntlayerConfig = {
|
|
132
|
-
internationalization: {
|
|
133
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
134
|
-
defaultLocale: Locales.ENGLISH,
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
// Gardez vos fichiers JSON actuels synchronisés avec les dictionnaires Intlayer
|
|
138
|
-
plugins: [
|
|
139
|
-
/**
|
|
140
|
-
* Chargera tous les fichiers JSON dans le répertoire src correspondant au modèle {key}.i18n.json
|
|
141
|
-
*/
|
|
142
|
-
loadJSON({
|
|
143
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
144
|
-
locale: Locales.ENGLISH,
|
|
145
|
-
priority: 1, // Assure que ces fichiers JSON ont la priorité sur les fichiers dans `./locales/en/${key}.json`
|
|
146
|
-
}),
|
|
147
|
-
/**
|
|
148
|
-
* Chargera, puis écrira la sortie et les traductions dans les fichiers JSON du répertoire locales
|
|
149
|
-
*/
|
|
150
|
-
syncJSON({
|
|
151
|
-
format: "icu",
|
|
152
|
-
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
153
|
-
priority: 0,
|
|
154
|
-
}),
|
|
155
|
-
],
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
export default config;
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Cela chargera tous les fichiers JSON dans le répertoire `src` qui correspondent au modèle `{key}.i18n.json` et les chargera en tant que dictionnaires Intlayer.
|
|
162
|
-
|
|
163
121
|
## Configuration Git
|
|
164
122
|
|
|
165
123
|
Il est recommandé d'ignorer les fichiers Intlayer générés automatiquement :
|
|
@@ -110,7 +110,6 @@ const config: IntlayerConfig = {
|
|
|
110
110
|
},
|
|
111
111
|
plugins: [
|
|
112
112
|
syncJSON({
|
|
113
|
-
format: "i18next",
|
|
114
113
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
115
114
|
}),
|
|
116
115
|
],
|
|
@@ -130,48 +129,6 @@ Si des modifications sont effectuées via la CLI pour traduire le JSON, ou via l
|
|
|
130
129
|
|
|
131
130
|
Pour plus de détails sur le plugin `syncJSON`, veuillez consulter la [documentation du plugin syncJSON](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/plugins/sync-json.md).
|
|
132
131
|
|
|
133
|
-
### (Optionnel) Étape 3 : Implémenter des traductions JSON par composant
|
|
134
|
-
|
|
135
|
-
Par défaut, Intlayer chargera, fusionnera et synchronisera à la fois les fichiers JSON et les fichiers de déclaration de contenu. Voir [la documentation sur la déclaration de contenu](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/dictionary/content_file.md) pour plus de détails. Mais si vous préférez, en utilisant un plugin Intlayer, vous pouvez également implémenter une gestion par composant des JSON localisés n'importe où dans votre base de code.
|
|
136
|
-
|
|
137
|
-
Pour cela, vous pouvez utiliser le plugin `loadJSON`.
|
|
138
|
-
|
|
139
|
-
```ts fileName="intlayer.config.ts"
|
|
140
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
141
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
142
|
-
|
|
143
|
-
const config: IntlayerConfig = {
|
|
144
|
-
internationalization: {
|
|
145
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
146
|
-
defaultLocale: Locales.ENGLISH,
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
// Gardez vos fichiers JSON actuels synchronisés avec les dictionnaires Intlayer
|
|
150
|
-
plugins: [
|
|
151
|
-
/**
|
|
152
|
-
* Chargera tous les fichiers JSON dans src qui correspondent au modèle {key}.i18n.json
|
|
153
|
-
*/
|
|
154
|
-
loadJSON({
|
|
155
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
156
|
-
locale: Locales.ENGLISH,
|
|
157
|
-
priority: 1, // Assure que ces fichiers JSON ont la priorité sur les fichiers dans `./locales/en/${key}.json`
|
|
158
|
-
}),
|
|
159
|
-
/**
|
|
160
|
-
* Chargera, puis écrira la sortie et les traductions dans les fichiers JSON du répertoire locales
|
|
161
|
-
*/
|
|
162
|
-
syncJSON({
|
|
163
|
-
format: "i18next",
|
|
164
|
-
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
165
|
-
priority: 0,
|
|
166
|
-
}),
|
|
167
|
-
],
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
export default config;
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
Cela chargera tous les fichiers JSON dans le répertoire `src` correspondant au modèle `{key}.i18n.json` et les chargera en tant que dictionnaires Intlayer.
|
|
174
|
-
|
|
175
132
|
## Configuration Git
|
|
176
133
|
|
|
177
134
|
Il est recommandé d'ignorer les fichiers Intlayer générés automatiquement :
|
|
@@ -120,48 +120,6 @@ Si des modifications sont effectuées via la CLI pour traduire le JSON, ou via l
|
|
|
120
120
|
|
|
121
121
|
Pour plus de détails sur le plugin `syncJSON`, veuillez consulter la [documentation du plugin syncJSON](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/plugins/sync-json.md).
|
|
122
122
|
|
|
123
|
-
### (Optionnel) Étape 3 : Implémenter des traductions JSON par composant
|
|
124
|
-
|
|
125
|
-
Par défaut, Intlayer chargera, fusionnera et synchronisera à la fois les fichiers JSON et les fichiers de déclaration de contenu. Voir [la documentation sur la déclaration de contenu](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/dictionary/content_file.md) pour plus de détails. Mais si vous préférez, en utilisant un plugin Intlayer, vous pouvez également implémenter une gestion par composant des JSON localisés n'importe où dans votre base de code.
|
|
126
|
-
|
|
127
|
-
Pour cela, vous pouvez utiliser le plugin `loadJSON`.
|
|
128
|
-
|
|
129
|
-
```ts fileName="intlayer.config.ts"
|
|
130
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
131
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
132
|
-
|
|
133
|
-
const config: IntlayerConfig = {
|
|
134
|
-
internationalization: {
|
|
135
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
136
|
-
defaultLocale: Locales.ENGLISH,
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
// Gardez vos fichiers JSON actuels synchronisés avec les dictionnaires Intlayer
|
|
140
|
-
plugins: [
|
|
141
|
-
/**
|
|
142
|
-
* Chargera tous les fichiers JSON dans src correspondant au modèle {key}.i18n.json
|
|
143
|
-
*/
|
|
144
|
-
loadJSON({
|
|
145
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
146
|
-
locale: Locales.ENGLISH,
|
|
147
|
-
priority: 1, // Assure que ces fichiers JSON ont la priorité sur les fichiers dans `./locales/en/${key}.json`
|
|
148
|
-
}),
|
|
149
|
-
/**
|
|
150
|
-
* Chargera, et écrira la sortie ainsi que les traductions dans les fichiers JSON du répertoire locales
|
|
151
|
-
*/
|
|
152
|
-
syncJSON({
|
|
153
|
-
format: "icu",
|
|
154
|
-
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
155
|
-
priority: 0,
|
|
156
|
-
}),
|
|
157
|
-
],
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export default config;
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
Cela chargera tous les fichiers JSON dans le répertoire `src` qui correspondent au modèle `{key}.i18n.json` et les chargera en tant que dictionnaires Intlayer.
|
|
164
|
-
|
|
165
123
|
## Configuration Git
|
|
166
124
|
|
|
167
125
|
Il est recommandé d'ignorer les fichiers Intlayer générés automatiquement :
|
|
@@ -122,52 +122,6 @@ Si des modifications sont effectuées via la CLI pour traduire le JSON, ou via l
|
|
|
122
122
|
|
|
123
123
|
Pour plus de détails sur le plugin `syncJSON`, veuillez consulter la [documentation du plugin syncJSON](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/plugins/sync-json.md).
|
|
124
124
|
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
### (Optionnel) Étape 3 : Implémenter les traductions JSON par composant
|
|
128
|
-
|
|
129
|
-
Par défaut, Intlayer chargera, fusionnera et synchronisera à la fois les fichiers JSON et les fichiers de déclaration de contenu. Voir [la documentation sur la déclaration de contenu](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/dictionary/content_file.md) pour plus de détails. Mais si vous préférez, en utilisant un plugin Intlayer, vous pouvez également implémenter une gestion par composant des JSON localisés n'importe où dans votre base de code.
|
|
130
|
-
|
|
131
|
-
Pour cela, vous pouvez utiliser le plugin `loadJSON`.
|
|
132
|
-
|
|
133
|
-
```ts fileName="intlayer.config.ts"
|
|
134
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
135
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
136
|
-
|
|
137
|
-
const config: IntlayerConfig = {
|
|
138
|
-
internationalization: {
|
|
139
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
140
|
-
defaultLocale: Locales.ENGLISH,
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
// Gardez vos fichiers JSON actuels synchronisés avec les dictionnaires Intlayer
|
|
144
|
-
plugins: [
|
|
145
|
-
/**
|
|
146
|
-
* Chargera tous les fichiers JSON dans src correspondant au modèle {key}.i18n.json
|
|
147
|
-
*/
|
|
148
|
-
loadJSON({
|
|
149
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
150
|
-
locale: Locales.ENGLISH,
|
|
151
|
-
priority: 1, // Assure que ces fichiers JSON ont la priorité sur les fichiers dans `./locales/en/${key}.json`
|
|
152
|
-
}),
|
|
153
|
-
/**
|
|
154
|
-
* Chargera, puis écrira la sortie et les traductions dans les fichiers JSON du répertoire locales
|
|
155
|
-
*/
|
|
156
|
-
syncJSON({
|
|
157
|
-
format: "vue-i18n",
|
|
158
|
-
source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
|
|
159
|
-
priority: 0,
|
|
160
|
-
}),
|
|
161
|
-
],
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export default config;
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
Cela chargera tous les fichiers JSON dans le répertoire `src` qui correspondent au modèle `{key}.i18n.json` et les chargera en tant que dictionnaires Intlayer.
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
125
|
## Configuration Git
|
|
172
126
|
|
|
173
127
|
Exclure les fichiers générés du contrôle de version :
|
|
@@ -104,7 +104,6 @@ const config: IntlayerConfig = {
|
|
|
104
104
|
},
|
|
105
105
|
plugins: [
|
|
106
106
|
syncJSON({
|
|
107
|
-
format: "i18next",
|
|
108
107
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
109
108
|
}),
|
|
110
109
|
],
|
|
@@ -154,7 +153,6 @@ const config: IntlayerConfig = {
|
|
|
154
153
|
* स्थानीय निर्देशिका में JSON फ़ाइलों में आउटपुट और अनुवाद वापस लिखेगा और लोड करेगा
|
|
155
154
|
*/
|
|
156
155
|
syncJSON({
|
|
157
|
-
format: "i18next",
|
|
158
156
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
159
157
|
priority: 0,
|
|
160
158
|
}),
|
|
@@ -112,7 +112,6 @@ const config: IntlayerConfig = {
|
|
|
112
112
|
},
|
|
113
113
|
plugins: [
|
|
114
114
|
syncJSON({
|
|
115
|
-
format: "i18next",
|
|
116
115
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
117
116
|
}),
|
|
118
117
|
],
|
|
@@ -164,7 +163,6 @@ const config: IntlayerConfig = {
|
|
|
164
163
|
* स्थानीय निर्देशिका में JSON फ़ाइलों में आउटपुट और अनुवाद वापस लिखेगा और लोड करेगा
|
|
165
164
|
*/
|
|
166
165
|
syncJSON({
|
|
167
|
-
format: "i18next",
|
|
168
166
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
169
167
|
priority: 0,
|
|
170
168
|
}),
|
|
@@ -102,7 +102,6 @@ const config: IntlayerConfig = {
|
|
|
102
102
|
},
|
|
103
103
|
plugins: [
|
|
104
104
|
syncJSON({
|
|
105
|
-
format: "i18next",
|
|
106
105
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
107
106
|
}),
|
|
108
107
|
],
|
|
@@ -152,7 +151,6 @@ const config: IntlayerConfig = {
|
|
|
152
151
|
* लोड करेगा, और आउटपुट और अनुवादों को locales डायरेक्टरी में JSON फ़ाइलों में वापस लिखेगा
|
|
153
152
|
*/
|
|
154
153
|
syncJSON({
|
|
155
|
-
format: "i18next",
|
|
156
154
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
157
155
|
priority: 0,
|
|
158
156
|
}),
|
|
@@ -104,7 +104,6 @@ const config: IntlayerConfig = {
|
|
|
104
104
|
},
|
|
105
105
|
plugins: [
|
|
106
106
|
syncJSON({
|
|
107
|
-
format: "i18next",
|
|
108
107
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
109
108
|
}),
|
|
110
109
|
],
|
|
@@ -154,7 +153,6 @@ const config: IntlayerConfig = {
|
|
|
154
153
|
* Akan memuat, dan menulis output serta terjemahan kembali ke file JSON di direktori locales
|
|
155
154
|
*/
|
|
156
155
|
syncJSON({
|
|
157
|
-
format: "i18next",
|
|
158
156
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
159
157
|
priority: 0,
|
|
160
158
|
}),
|
|
@@ -112,7 +112,6 @@ const config: IntlayerConfig = {
|
|
|
112
112
|
},
|
|
113
113
|
plugins: [
|
|
114
114
|
syncJSON({
|
|
115
|
-
format: "i18next",
|
|
116
115
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
117
116
|
}),
|
|
118
117
|
],
|
|
@@ -164,7 +163,6 @@ const config: IntlayerConfig = {
|
|
|
164
163
|
* Akan memuat, dan menulis output serta terjemahan kembali ke file JSON di direktori locales
|
|
165
164
|
*/
|
|
166
165
|
syncJSON({
|
|
167
|
-
format: "i18next",
|
|
168
166
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
169
167
|
priority: 0,
|
|
170
168
|
}),
|
|
@@ -102,7 +102,6 @@ const config: IntlayerConfig = {
|
|
|
102
102
|
},
|
|
103
103
|
plugins: [
|
|
104
104
|
syncJSON({
|
|
105
|
-
format: "i18next",
|
|
106
105
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
107
106
|
}),
|
|
108
107
|
],
|
|
@@ -152,7 +151,6 @@ const config: IntlayerConfig = {
|
|
|
152
151
|
* Akan memuat, dan menulis output serta terjemahan kembali ke file JSON di direktori locales
|
|
153
152
|
*/
|
|
154
153
|
syncJSON({
|
|
155
|
-
format: "i18next",
|
|
156
154
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
157
155
|
priority: 0,
|
|
158
156
|
}),
|
|
@@ -104,7 +104,6 @@ const config: IntlayerConfig = {
|
|
|
104
104
|
},
|
|
105
105
|
plugins: [
|
|
106
106
|
syncJSON({
|
|
107
|
-
format: "i18next",
|
|
108
107
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
109
108
|
}),
|
|
110
109
|
],
|
|
@@ -154,7 +153,6 @@ const config: IntlayerConfig = {
|
|
|
154
153
|
* Caricherà e scriverà l'output e le traduzioni nei file JSON nella directory delle localizzazioni
|
|
155
154
|
*/
|
|
156
155
|
syncJSON({
|
|
157
|
-
format: "i18next",
|
|
158
156
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
159
157
|
priority: 0,
|
|
160
158
|
}),
|
|
@@ -112,7 +112,6 @@ const config: IntlayerConfig = {
|
|
|
112
112
|
},
|
|
113
113
|
plugins: [
|
|
114
114
|
syncJSON({
|
|
115
|
-
format: "i18next",
|
|
116
115
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
117
116
|
}),
|
|
118
117
|
],
|
|
@@ -164,7 +163,6 @@ const config: IntlayerConfig = {
|
|
|
164
163
|
* Caricherà e scriverà l'output e le traduzioni nei file JSON nella directory delle localizzazioni
|
|
165
164
|
*/
|
|
166
165
|
syncJSON({
|
|
167
|
-
format: "i18next",
|
|
168
166
|
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
169
167
|
priority: 0,
|
|
170
168
|
}),
|
|
@@ -102,7 +102,6 @@ const config: IntlayerConfig = {
|
|
|
102
102
|
},
|
|
103
103
|
plugins: [
|
|
104
104
|
syncJSON({
|
|
105
|
-
format: "i18next",
|
|
106
105
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
107
106
|
}),
|
|
108
107
|
],
|
|
@@ -152,7 +151,6 @@ const config: IntlayerConfig = {
|
|
|
152
151
|
* Caricherà e scriverà l'output e le traduzioni nei file JSON nella directory delle localizzazioni
|
|
153
152
|
*/
|
|
154
153
|
syncJSON({
|
|
155
|
-
format: "i18next",
|
|
156
154
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
157
155
|
priority: 0,
|
|
158
156
|
}),
|
|
@@ -104,7 +104,6 @@ const config: IntlayerConfig = {
|
|
|
104
104
|
},
|
|
105
105
|
plugins: [
|
|
106
106
|
syncJSON({
|
|
107
|
-
format: "i18next",
|
|
108
107
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
109
108
|
}),
|
|
110
109
|
],
|
|
@@ -124,50 +123,6 @@ CLI を使って JSON の翻訳を変更した場合や CMS を使った場合
|
|
|
124
123
|
|
|
125
124
|
`syncJSON`プラグインの詳細については、[syncJSONプラグインのドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/plugins/sync-json.md)を参照してください。
|
|
126
125
|
|
|
127
|
-
### (オプション)ステップ3:コンポーネントごとのJSON翻訳の実装
|
|
128
|
-
|
|
129
|
-
デフォルトでは、IntlayerはJSONファイルとコンテンツ宣言ファイルの両方を読み込み、マージし、同期します。詳細については、[コンテンツ宣言のドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dictionary/content_file.md)を参照してください。しかし、必要に応じてIntlayerプラグインを使用して、コードベースのどこにでもあるJSONのローカライズをコンポーネントごとに管理することも可能です。
|
|
130
|
-
|
|
131
|
-
そのためには、`loadJSON`プラグインを使用できます。
|
|
132
|
-
|
|
133
|
-
```ts fileName="intlayer.config.ts"
|
|
134
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
135
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
136
|
-
|
|
137
|
-
const config: IntlayerConfig = {
|
|
138
|
-
internationalization: {
|
|
139
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
140
|
-
defaultLocale: Locales.ENGLISH,
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
// 現在のJSONファイルをIntlayerの辞書と同期させる
|
|
144
|
-
plugins: [
|
|
145
|
-
/**
|
|
146
|
-
* src内の{key}.i18n.jsonパターンに一致するすべてのJSONファイルを読み込みます
|
|
147
|
-
*/
|
|
148
|
-
loadJSON({
|
|
149
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
150
|
-
locale: Locales.ENGLISH,
|
|
151
|
-
priority: 1, // これらのJSONファイルが`./locales/en/${key}.json`のファイルより優先されることを保証します
|
|
152
|
-
}),
|
|
153
|
-
/**
|
|
154
|
-
* ローカルディレクトリ内のJSONファイルに出力と翻訳を書き戻しながら読み込みます
|
|
155
|
-
*/
|
|
156
|
-
syncJSON({
|
|
157
|
-
format: "i18next",
|
|
158
|
-
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
159
|
-
priority: 0,
|
|
160
|
-
}),
|
|
161
|
-
],
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export default config;
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
これは、`src` ディレクトリ内の `{key}.i18n.json` というパターンに一致するすべての JSON ファイルを読み込み、Intlayer の辞書としてロードします。
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
126
|
## Git 設定
|
|
172
127
|
|
|
173
128
|
自動生成された Intlayer ファイルは無視することを推奨します:
|
|
@@ -131,52 +131,6 @@ CLIを使用してJSONの翻訳を変更した場合やCMSを使用した場合
|
|
|
131
131
|
|
|
132
132
|
`syncJSON`プラグインの詳細については、[syncJSONプラグインのドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/plugins/sync-json.md)をご参照ください。
|
|
133
133
|
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
### (オプション)ステップ3:コンポーネントごとのJSON翻訳の実装
|
|
137
|
-
|
|
138
|
-
デフォルトでは、IntlayerはJSONファイルとコンテンツ宣言ファイルの両方を読み込み、マージし、同期します。詳細は[コンテンツ宣言のドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dictionary/content_file.md)をご覧ください。しかし、必要に応じてIntlayerプラグインを使用し、コードベースの任意の場所でローカライズされたJSONをコンポーネント単位で管理することも可能です。
|
|
139
|
-
|
|
140
|
-
そのためには、`loadJSON` プラグインを使用できます。
|
|
141
|
-
|
|
142
|
-
```ts fileName="intlayer.config.ts"
|
|
143
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
144
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
145
|
-
|
|
146
|
-
const config: IntlayerConfig = {
|
|
147
|
-
internationalization: {
|
|
148
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
149
|
-
defaultLocale: Locales.ENGLISH,
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
// 現在のJSONファイルをIntlayerの辞書と同期させる
|
|
153
|
-
plugins: [
|
|
154
|
-
/**
|
|
155
|
-
* src内のパターン {key}.i18n.json に一致するすべてのJSONファイルを読み込みます
|
|
156
|
-
*/
|
|
157
|
-
loadJSON({
|
|
158
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
159
|
-
locale: Locales.ENGLISH,
|
|
160
|
-
priority: 1, // これらのJSONファイルが `./public/locales/en/${key}.json` のファイルより優先されることを保証します
|
|
161
|
-
}),
|
|
162
|
-
/**
|
|
163
|
-
* ローカルディレクトリ内のJSONファイルに出力と翻訳を書き戻します
|
|
164
|
-
*/
|
|
165
|
-
syncJSON({
|
|
166
|
-
format: "i18next",
|
|
167
|
-
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
168
|
-
priority: 0,
|
|
169
|
-
}),
|
|
170
|
-
],
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
export default config;
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
これは、`src`ディレクトリ内のパターン`{key}.i18n.json`に一致するすべてのJSONファイルを読み込み、Intlayerの辞書としてロードします。
|
|
177
|
-
|
|
178
|
-
---
|
|
179
|
-
|
|
180
134
|
## Git設定
|
|
181
135
|
|
|
182
136
|
生成されたファイルをバージョン管理から除外します:
|
|
@@ -119,48 +119,6 @@ CLIを使用してJSONの翻訳を行った場合やCMSを使用した場合、I
|
|
|
119
119
|
|
|
120
120
|
`syncJSON`プラグインの詳細については、[syncJSONプラグインのドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/plugins/sync-json.md)をご参照ください。
|
|
121
121
|
|
|
122
|
-
### (オプション)ステップ3:コンポーネントごとのJSON翻訳の実装
|
|
123
|
-
|
|
124
|
-
デフォルトでは、IntlayerはJSONファイルとコンテンツ宣言ファイルの両方を読み込み、マージし、同期します。詳細については、[コンテンツ宣言のドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dictionary/content_file.md)を参照してください。しかし、必要に応じてIntlayerのプラグインを使用して、コードベースの任意の場所でローカライズされたJSONのコンポーネント単位の管理を実装することも可能です。
|
|
125
|
-
|
|
126
|
-
そのためには、`loadJSON`プラグインを使用できます。
|
|
127
|
-
|
|
128
|
-
```ts fileName="intlayer.config.ts"
|
|
129
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
130
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
131
|
-
|
|
132
|
-
const config: IntlayerConfig = {
|
|
133
|
-
internationalization: {
|
|
134
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
135
|
-
defaultLocale: Locales.ENGLISH,
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
// 現在のJSONファイルをIntlayerの辞書と同期させる
|
|
139
|
-
plugins: [
|
|
140
|
-
/**
|
|
141
|
-
* src内の{key}.i18n.jsonというパターンに一致するすべてのJSONファイルを読み込みます
|
|
142
|
-
*/
|
|
143
|
-
loadJSON({
|
|
144
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
145
|
-
locale: Locales.ENGLISH,
|
|
146
|
-
priority: 1, // これらのJSONファイルが`./locales/en/${key}.json`のファイルより優先されることを保証します
|
|
147
|
-
}),
|
|
148
|
-
/**
|
|
149
|
-
* ローカルディレクトリ内のJSONファイルに出力と翻訳を書き戻しながら読み込みます
|
|
150
|
-
*/
|
|
151
|
-
syncJSON({
|
|
152
|
-
format: "icu",
|
|
153
|
-
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
154
|
-
priority: 0,
|
|
155
|
-
}),
|
|
156
|
-
],
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
export default config;
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
これは、`src`ディレクトリ内のパターン `{key}.i18n.json` に一致するすべてのJSONファイルを読み込み、Intlayerの辞書としてロードします。
|
|
163
|
-
|
|
164
122
|
## Git設定
|
|
165
123
|
|
|
166
124
|
自動生成されたIntlayerファイルは無視することを推奨します:
|
|
@@ -122,48 +122,6 @@ CLIを使ってJSONの翻訳を変更した場合やCMSを使用した場合、I
|
|
|
122
122
|
|
|
123
123
|
`syncJSON`プラグインの詳細については、[syncJSONプラグインのドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/plugins/sync-json.md)を参照してください。
|
|
124
124
|
|
|
125
|
-
### (オプション)ステップ3:コンポーネントごとのJSON翻訳の実装
|
|
126
|
-
|
|
127
|
-
デフォルトでは、IntlayerはJSONファイルとコンテンツ宣言ファイルの両方を読み込み、マージし、同期します。詳細については、[コンテンツ宣言のドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dictionary/content_file.md)を参照してください。しかし、必要に応じてIntlayerプラグインを使用して、コードベースのどこにでもあるJSONのローカライズをコンポーネント単位で管理することも可能です。
|
|
128
|
-
|
|
129
|
-
そのためには、`loadJSON`プラグインを使用できます。
|
|
130
|
-
|
|
131
|
-
```ts fileName="intlayer.config.ts"
|
|
132
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
133
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
134
|
-
|
|
135
|
-
const config: IntlayerConfig = {
|
|
136
|
-
internationalization: {
|
|
137
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
138
|
-
defaultLocale: Locales.ENGLISH,
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
// 現在のJSONファイルをIntlayerの辞書と同期させる
|
|
142
|
-
plugins: [
|
|
143
|
-
/**
|
|
144
|
-
* src内の{key}.i18n.jsonパターンに一致するすべてのJSONファイルを読み込みます
|
|
145
|
-
*/
|
|
146
|
-
loadJSON({
|
|
147
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
148
|
-
locale: Locales.ENGLISH,
|
|
149
|
-
priority: 1, // これらのJSONファイルが`./locales/en/${key}.json`のファイルより優先されることを保証します
|
|
150
|
-
}),
|
|
151
|
-
/**
|
|
152
|
-
* ローカルディレクトリ内のJSONファイルに出力と翻訳を書き戻しながら読み込みます
|
|
153
|
-
*/
|
|
154
|
-
syncJSON({
|
|
155
|
-
format: "i18next",
|
|
156
|
-
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
157
|
-
priority: 0,
|
|
158
|
-
}),
|
|
159
|
-
],
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
export default config;
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
これにより、`src` ディレクトリ内の `{key}.i18n.json` パターンに一致するすべての JSON ファイルが読み込まれ、Intlayer の辞書としてロードされます。
|
|
166
|
-
|
|
167
125
|
## Git 設定
|
|
168
126
|
|
|
169
127
|
自動生成された Intlayer ファイルは無視することを推奨します:
|
|
@@ -120,48 +120,6 @@ CLIを使ってJSONの翻訳を変更した場合やCMSを使用した場合、I
|
|
|
120
120
|
|
|
121
121
|
`syncJSON`プラグインの詳細については、[syncJSONプラグインのドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/plugins/sync-json.md)をご参照ください。
|
|
122
122
|
|
|
123
|
-
### (オプション)ステップ3:コンポーネントごとのJSON翻訳の実装
|
|
124
|
-
|
|
125
|
-
デフォルトでは、IntlayerはJSONファイルとコンテンツ宣言ファイルの両方を読み込み、マージし、同期します。詳細については、[コンテンツ宣言のドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dictionary/content_file.md)をご覧ください。しかし、必要に応じてIntlayerプラグインを使用して、コードベースのどこにでもあるJSONのローカライズをコンポーネント単位で管理することも可能です。
|
|
126
|
-
|
|
127
|
-
そのためには、`loadJSON`プラグインを使用できます。
|
|
128
|
-
|
|
129
|
-
```ts fileName="intlayer.config.ts"
|
|
130
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
131
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
132
|
-
|
|
133
|
-
const config: IntlayerConfig = {
|
|
134
|
-
internationalization: {
|
|
135
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
136
|
-
defaultLocale: Locales.ENGLISH,
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
// 現在のJSONファイルをIntlayerの辞書と同期させる
|
|
140
|
-
plugins: [
|
|
141
|
-
/**
|
|
142
|
-
* src内のパターン{key}.i18n.jsonに一致するすべてのJSONファイルを読み込みます
|
|
143
|
-
*/
|
|
144
|
-
loadJSON({
|
|
145
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
146
|
-
locale: Locales.ENGLISH,
|
|
147
|
-
priority: 1, // これらのJSONファイルが`./locales/en/${key}.json`のファイルより優先されることを保証します
|
|
148
|
-
}),
|
|
149
|
-
/**
|
|
150
|
-
* ローカルディレクトリ内のJSONファイルに出力と翻訳を書き戻しながら読み込みます
|
|
151
|
-
*/
|
|
152
|
-
syncJSON({
|
|
153
|
-
format: "icu",
|
|
154
|
-
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
155
|
-
priority: 0,
|
|
156
|
-
}),
|
|
157
|
-
],
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export default config;
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
これは、`src` ディレクトリ内の `{key}.i18n.json` というパターンに一致するすべての JSON ファイルを読み込み、Intlayer の辞書としてロードします。
|
|
164
|
-
|
|
165
123
|
## Git 設定
|
|
166
124
|
|
|
167
125
|
自動生成された Intlayer ファイルは無視することを推奨します:
|