@intlayer/docs 7.5.11 → 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 +218 -99
- 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 +218 -99
- 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 +1 -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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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 +119 -0
- package/src/generated/frequentQuestions.entry.ts +15 -0
- package/src/generated/legal.entry.ts +2 -0
|
@@ -129,48 +129,6 @@ If changes are made using the CLI to translate the JSON, or using the CMS, Intla
|
|
|
129
129
|
|
|
130
130
|
For more details about the `syncJSON` plugin, please refer to the [syncJSON plugin documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/plugins/sync-json.md).
|
|
131
131
|
|
|
132
|
-
### (Optional) Step 3: Implement per-component JSON translations
|
|
133
|
-
|
|
134
|
-
By default, Intlayer will load, merge and synchronise both JSON and content declaration files. See [the content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/dictionary/content_file.md) for more details. However, if you prefer, using an Intlayer plugin, you can also implement per-component management of JSON localised anywhere in your codebase.
|
|
135
|
-
|
|
136
|
-
For that, you can use the `loadJSON` plugin.
|
|
137
|
-
|
|
138
|
-
```ts fileName="intlayer.config.ts"
|
|
139
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
140
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
141
|
-
|
|
142
|
-
const config: IntlayerConfig = {
|
|
143
|
-
internationalization: {
|
|
144
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
145
|
-
defaultLocale: Locales.ENGLISH,
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
// Keep your current JSON files in sync with Intlayer dictionaries
|
|
149
|
-
plugins: [
|
|
150
|
-
/**
|
|
151
|
-
* Will load all the JSON files in the src that match the pattern {key}.i18n.json
|
|
152
|
-
*/
|
|
153
|
-
loadJSON({
|
|
154
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
155
|
-
locale: Locales.ENGLISH,
|
|
156
|
-
priority: 1, // Ensures these JSON files take precedence over files at `./locales/en/${key}.json`
|
|
157
|
-
}),
|
|
158
|
-
/**
|
|
159
|
-
* Will load, and write the output and translations back to the JSON files in the locales directory
|
|
160
|
-
*/
|
|
161
|
-
syncJSON({
|
|
162
|
-
format: "icu",
|
|
163
|
-
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
164
|
-
priority: 0,
|
|
165
|
-
}),
|
|
166
|
-
],
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
export default config;
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
This will load all the JSON files in the `src` directory that match the pattern `{key}.i18n.json` and load them as Intlayer dictionaries.
|
|
173
|
-
|
|
174
132
|
## Git Configuration
|
|
175
133
|
|
|
176
134
|
It is recommended to ignore auto-generated Intlayer files:
|
|
@@ -111,7 +111,6 @@ const config: IntlayerConfig = {
|
|
|
111
111
|
},
|
|
112
112
|
plugins: [
|
|
113
113
|
syncJSON({
|
|
114
|
-
format: "i18next",
|
|
115
114
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
116
115
|
}),
|
|
117
116
|
],
|
|
@@ -131,48 +130,6 @@ If changes are made using the CLI to translate the JSON, or using the CMS, Intla
|
|
|
131
130
|
|
|
132
131
|
To see more details about the `syncJSON` plugin, please refer to the [syncJSON plugin documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/plugins/sync-json.md).
|
|
133
132
|
|
|
134
|
-
### (Optional) Step 3: Implement per-component JSON translations
|
|
135
|
-
|
|
136
|
-
By default, Intlayer will load, merge and synchronise both JSON and content declaration files. See [the content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/dictionary/content_file.md) for more details. But if you prefer, using an Intlayer plugin, you can also implement per-component management of JSON localised anywhere in your codebase.
|
|
137
|
-
|
|
138
|
-
For that, you can use the `loadJSON` plugin.
|
|
139
|
-
|
|
140
|
-
```ts fileName="intlayer.config.ts"
|
|
141
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
142
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
143
|
-
|
|
144
|
-
const config: IntlayerConfig = {
|
|
145
|
-
internationalisation: {
|
|
146
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
147
|
-
defaultLocale: Locales.ENGLISH,
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
// Keep your current JSON files in sync with Intlayer dictionaries
|
|
151
|
-
plugins: [
|
|
152
|
-
/**
|
|
153
|
-
* Will load all the JSON files in the src that match the pattern {key}.i18n.json
|
|
154
|
-
*/
|
|
155
|
-
loadJSON({
|
|
156
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
157
|
-
locale: Locales.ENGLISH,
|
|
158
|
-
priority: 1, // Ensures these JSON files take precedence over files at `./locales/en/${key}.json`
|
|
159
|
-
}),
|
|
160
|
-
/**
|
|
161
|
-
* Will load, and write the output and translations back to the JSON files in the locales directory
|
|
162
|
-
*/
|
|
163
|
-
syncJSON({
|
|
164
|
-
format: "i18next",
|
|
165
|
-
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
166
|
-
priority: 0,
|
|
167
|
-
}),
|
|
168
|
-
],
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
export default config;
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
This will load all the JSON files in the `src` directory that match the pattern `{key}.i18n.json` and load them as Intlayer dictionaries.
|
|
175
|
-
|
|
176
133
|
## Git Configuration
|
|
177
134
|
|
|
178
135
|
It is recommended to ignore auto-generated Intlayer files:
|
|
@@ -129,48 +129,6 @@ If changes are made using the CLI to translate the JSON, or using the CMS, Intla
|
|
|
129
129
|
|
|
130
130
|
To see more details about the `syncJSON` plugin, please refer to the [syncJSON plugin documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/plugins/sync-json.md).
|
|
131
131
|
|
|
132
|
-
### (Optional) Step 3: Implement per-component JSON translations
|
|
133
|
-
|
|
134
|
-
By default, Intlayer will load, merge and synchronise both JSON and content declaration files. See [the content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md) for more details. But if you prefer, using an Intlayer plugin, you can also implement per-component management of JSON localised anywhere in your codebase.
|
|
135
|
-
|
|
136
|
-
For that, you can use the `loadJSON` plugin.
|
|
137
|
-
|
|
138
|
-
```ts fileName="intlayer.config.ts"
|
|
139
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
140
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
141
|
-
|
|
142
|
-
const config: IntlayerConfig = {
|
|
143
|
-
internationalisation: {
|
|
144
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
145
|
-
defaultLocale: Locales.ENGLISH,
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
// Keep your current JSON files in sync with Intlayer dictionaries
|
|
149
|
-
plugins: [
|
|
150
|
-
/**
|
|
151
|
-
* Will load all the JSON files in the src that match the pattern {key}.i18n.json
|
|
152
|
-
*/
|
|
153
|
-
loadJSON({
|
|
154
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
155
|
-
locale: Locales.ENGLISH,
|
|
156
|
-
priority: 1, // Ensures these JSON files take precedence over files at `./locales/en/${key}.json`
|
|
157
|
-
}),
|
|
158
|
-
/**
|
|
159
|
-
* Will load, and write the output and translations back to the JSON files in the locales directory
|
|
160
|
-
*/
|
|
161
|
-
syncJSON({
|
|
162
|
-
format: "icu",
|
|
163
|
-
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
164
|
-
priority: 0,
|
|
165
|
-
}),
|
|
166
|
-
],
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
export default config;
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
This will load all the JSON files in the `src` directory that match the pattern `{key}.i18n.json` and load them as Intlayer dictionaries.
|
|
173
|
-
|
|
174
132
|
## Git Configuration
|
|
175
133
|
|
|
176
134
|
It is recommended to ignore auto-generated Intlayer files:
|
|
@@ -131,52 +131,6 @@ If changes are made using the CLI to translate the JSON, or using the CMS, Intla
|
|
|
131
131
|
|
|
132
132
|
To see more details about the `syncJSON` plugin, please refer to the [syncJSON plugin documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/plugins/sync-json.md).
|
|
133
133
|
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
### (Optional) Step 3: Implement per-component JSON translations
|
|
137
|
-
|
|
138
|
-
By default, Intlayer will load, merge and synchronise both JSON and content declaration files. See [the content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/dictionary/content_file.md) for more details. But if you prefer, using an Intlayer plugin, you can also implement per-component management of JSON localised anywhere in your codebase.
|
|
139
|
-
|
|
140
|
-
For that, you can use the `loadJSON` plugin.
|
|
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
|
-
internationalisation: {
|
|
148
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
149
|
-
defaultLocale: Locales.ENGLISH,
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
// Keep your current JSON files in sync with Intlayer dictionaries
|
|
153
|
-
plugins: [
|
|
154
|
-
/**
|
|
155
|
-
* Will load all the JSON files in the src that match the pattern {key}.i18n json
|
|
156
|
-
*/
|
|
157
|
-
loadJSON({
|
|
158
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
159
|
-
locale: Locales.ENGLISH,
|
|
160
|
-
priority: 1, // Ensures these JSON files take precedence over files at `./locales/en/${key}.json`
|
|
161
|
-
}),
|
|
162
|
-
/**
|
|
163
|
-
* Will load, and write the output and translations back to the JSON files in the locales directory
|
|
164
|
-
*/
|
|
165
|
-
syncJSON({
|
|
166
|
-
format: "vue-i18n",
|
|
167
|
-
source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
|
|
168
|
-
priority: 0,
|
|
169
|
-
}),
|
|
170
|
-
],
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
export default config;
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
This will load all the JSON files in the `src` directory that match the pattern `{key}.i18n.json` and load them as Intlayer dictionaries.
|
|
177
|
-
|
|
178
|
-
---
|
|
179
|
-
|
|
180
134
|
## Git Configuration
|
|
181
135
|
|
|
182
136
|
Exclude generated files from version control:
|
|
@@ -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 @@ Si se realizan cambios usando la CLI para traducir el JSON, o usando el CMS, Int
|
|
|
124
123
|
|
|
125
124
|
Para ver más detalles sobre el plugin `syncJSON`, por favor consulta la [documentación del plugin syncJSON](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/plugins/sync-json.md).
|
|
126
125
|
|
|
127
|
-
### (Opcional) Paso 3: Implementar traducciones JSON por componente
|
|
128
|
-
|
|
129
|
-
Por defecto, Intlayer cargará, combinará y sincronizará tanto los archivos JSON como los archivos de declaración de contenido. Consulta [la documentación de declaración de contenido](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/dictionary/content_file.md) para más detalles. Pero si prefieres, usando un plugin de Intlayer, también puedes implementar la gestión por componente de JSON localizado en cualquier parte de tu base de código.
|
|
130
|
-
|
|
131
|
-
Para ello, puedes usar el 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
|
-
// Mantén tus archivos JSON actuales sincronizados con los diccionarios de Intlayer
|
|
144
|
-
plugins: [
|
|
145
|
-
/**
|
|
146
|
-
* Cargará todos los archivos JSON en src que coincidan con el patrón {key}.i18n.json
|
|
147
|
-
*/
|
|
148
|
-
loadJSON({
|
|
149
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
150
|
-
locale: Locales.ENGLISH,
|
|
151
|
-
priority: 1, // Asegura que estos archivos JSON tengan prioridad sobre los archivos en `./locales/en/${key}.json`
|
|
152
|
-
}),
|
|
153
|
-
/**
|
|
154
|
-
* Cargará y escribirá la salida y las traducciones de vuelta en los archivos JSON en el directorio locales
|
|
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
|
-
Esto cargará todos los archivos JSON en el directorio `src` que coincidan con el patrón `{key}.i18n.json` y los cargará como diccionarios de Intlayer.
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
126
|
## Configuración de Git
|
|
172
127
|
|
|
173
128
|
Se recomienda ignorar los archivos generados automáticamente por Intlayer:
|
|
@@ -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
|
],
|
|
@@ -132,52 +131,6 @@ Si se realizan cambios utilizando la CLI para traducir el JSON, o usando el CMS,
|
|
|
132
131
|
|
|
133
132
|
Para ver más detalles sobre el plugin `syncJSON`, por favor consulta la [documentación del plugin syncJSON](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/plugins/sync-json.md).
|
|
134
133
|
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
### (Opcional) Paso 3: Implementar traducciones JSON por componente
|
|
138
|
-
|
|
139
|
-
Por defecto, Intlayer cargará, combinará y sincronizará tanto los archivos JSON como los archivos de declaración de contenido. Consulta [la documentación de declaración de contenido](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/dictionary/content_file.md) para más detalles. Pero si prefieres, usando un plugin de Intlayer, también puedes implementar la gestión por componente de JSON localizado en cualquier parte de tu base de código.
|
|
140
|
-
|
|
141
|
-
Para eso, puedes usar el plugin `loadJSON`.
|
|
142
|
-
|
|
143
|
-
```ts fileName="intlayer.config.ts"
|
|
144
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
145
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
146
|
-
|
|
147
|
-
const config: IntlayerConfig = {
|
|
148
|
-
internationalization: {
|
|
149
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
150
|
-
defaultLocale: Locales.ENGLISH,
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
// Mantén tus archivos JSON actuales sincronizados con los diccionarios de Intlayer
|
|
154
|
-
plugins: [
|
|
155
|
-
/**
|
|
156
|
-
* Cargará todos los archivos JSON en src que coincidan con el patrón {key}.i18n.json
|
|
157
|
-
*/
|
|
158
|
-
loadJSON({
|
|
159
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
160
|
-
locale: Locales.ENGLISH,
|
|
161
|
-
priority: 1, // Asegura que estos archivos JSON tengan prioridad sobre los archivos en `./public/locales/en/${key}.json`
|
|
162
|
-
}),
|
|
163
|
-
/**
|
|
164
|
-
* Cargará y escribirá la salida y las traducciones de vuelta en los archivos JSON en el directorio de locales
|
|
165
|
-
*/
|
|
166
|
-
syncJSON({
|
|
167
|
-
format: "i18next",
|
|
168
|
-
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
169
|
-
priority: 0,
|
|
170
|
-
}),
|
|
171
|
-
],
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
export default config;
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
Esto cargará todos los archivos JSON en el directorio `src` que coincidan con el patrón `{key}.i18n.json` y los cargará como diccionarios de Intlayer.
|
|
178
|
-
|
|
179
|
-
---
|
|
180
|
-
|
|
181
134
|
## Configuración de Git
|
|
182
135
|
|
|
183
136
|
Excluye los archivos generados del control de versiones:
|
|
@@ -119,48 +119,6 @@ Si se realizan cambios usando la CLI para traducir el JSON, o usando el CMS, Int
|
|
|
119
119
|
|
|
120
120
|
Para ver más detalles sobre el plugin `syncJSON`, por favor consulte la [documentación del plugin syncJSON](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/plugins/sync-json.md).
|
|
121
121
|
|
|
122
|
-
### (Opcional) Paso 3: Implementar traducciones JSON por componente
|
|
123
|
-
|
|
124
|
-
Por defecto, Intlayer cargará, fusionará y sincronizará tanto los archivos JSON como los archivos de declaración de contenido. Consulte [la documentación de declaración de contenido](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/dictionary/content_file.md) para más detalles. Pero si lo prefiere, utilizando un plugin de Intlayer, también puede implementar la gestión por componente de JSON localizado en cualquier parte de su base de código.
|
|
125
|
-
|
|
126
|
-
Para ello, puede usar el plugin `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
|
-
// Mantenga sus archivos JSON actuales sincronizados con los diccionarios de Intlayer
|
|
139
|
-
plugins: [
|
|
140
|
-
/**
|
|
141
|
-
* Cargará todos los archivos JSON en src que coincidan con el patrón {key}.i18n.json
|
|
142
|
-
*/
|
|
143
|
-
loadJSON({
|
|
144
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
145
|
-
locale: Locales.ENGLISH,
|
|
146
|
-
priority: 1, // Asegura que estos archivos JSON tengan prioridad sobre los archivos en `./locales/en/${key}.json`
|
|
147
|
-
}),
|
|
148
|
-
/**
|
|
149
|
-
* Cargará y escribirá la salida y las traducciones de vuelta en los archivos JSON en el directorio locales
|
|
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
|
-
Esto cargará todos los archivos JSON en el directorio `src` que coincidan con el patrón `{key}.i18n.json` y los cargará como diccionarios de Intlayer.
|
|
163
|
-
|
|
164
122
|
## Configuración de Git
|
|
165
123
|
|
|
166
124
|
Se recomienda ignorar los archivos generados automáticamente por Intlayer:
|
|
@@ -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
|
],
|
|
@@ -122,48 +121,6 @@ Si se realizan cambios usando la CLI para traducir el JSON, o usando el CMS, Int
|
|
|
122
121
|
|
|
123
122
|
Para ver más detalles sobre el plugin `syncJSON`, por favor consulta la [documentación del plugin syncJSON](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/plugins/sync-json.md).
|
|
124
123
|
|
|
125
|
-
### (Opcional) Paso 3: Implementar traducciones JSON por componente
|
|
126
|
-
|
|
127
|
-
Por defecto, Intlayer cargará, fusionará y sincronizará tanto los archivos JSON como los archivos de declaración de contenido. Consulta [la documentación de declaración de contenido](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/dictionary/content_file.md) para más detalles. Pero si prefieres, usando un plugin de Intlayer, también puedes implementar la gestión por componente de JSON localizado en cualquier parte de tu base de código.
|
|
128
|
-
|
|
129
|
-
Para ello, puedes usar el plugin `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
|
-
// Mantén tus archivos JSON actuales sincronizados con los diccionarios de Intlayer
|
|
142
|
-
plugins: [
|
|
143
|
-
/**
|
|
144
|
-
* Cargará todos los archivos JSON en src que coincidan con el patrón {key}.i18n.json
|
|
145
|
-
*/
|
|
146
|
-
loadJSON({
|
|
147
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
148
|
-
locale: Locales.ENGLISH,
|
|
149
|
-
priority: 1, // Asegura que estos archivos JSON tengan prioridad sobre los archivos en `./locales/en/${key}.json`
|
|
150
|
-
}),
|
|
151
|
-
/**
|
|
152
|
-
* Cargará y escribirá la salida y las traducciones de vuelta a los archivos JSON en el directorio locales
|
|
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
|
-
Esto cargará todos los archivos JSON en el directorio `src` que coincidan con el patrón `{key}.i18n.json` y los cargará como diccionarios de Intlayer.
|
|
166
|
-
|
|
167
124
|
## Configuración de Git
|
|
168
125
|
|
|
169
126
|
Se recomienda ignorar los archivos generados automáticamente por Intlayer:
|
|
@@ -120,48 +120,6 @@ Si se realizan cambios usando la CLI para traducir el JSON, o usando el CMS, Int
|
|
|
120
120
|
|
|
121
121
|
Para ver más detalles sobre el plugin `syncJSON`, por favor consulta la [documentación del plugin syncJSON](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/plugins/sync-json.md).
|
|
122
122
|
|
|
123
|
-
### (Opcional) Paso 3: Implementar traducciones JSON por componente
|
|
124
|
-
|
|
125
|
-
Por defecto, Intlayer cargará, combinará y sincronizará tanto los archivos JSON como los archivos de declaración de contenido. Consulta [la documentación de declaración de contenido](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/dictionary/content_file.md) para más detalles. Pero si prefieres, usando un plugin de Intlayer, también puedes implementar la gestión por componente de JSON localizado en cualquier parte de tu base de código.
|
|
126
|
-
|
|
127
|
-
Para ello, puedes usar el 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
|
-
// Mantén tus archivos JSON actuales sincronizados con los diccionarios de Intlayer
|
|
140
|
-
plugins: [
|
|
141
|
-
/**
|
|
142
|
-
* Cargará todos los archivos JSON en src que coincidan con el patrón {key}.i18n.json
|
|
143
|
-
*/
|
|
144
|
-
loadJSON({
|
|
145
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
146
|
-
locale: Locales.ENGLISH,
|
|
147
|
-
priority: 1, // Asegura que estos archivos JSON tengan prioridad sobre los archivos en `./locales/en/${key}.json`
|
|
148
|
-
}),
|
|
149
|
-
/**
|
|
150
|
-
* Cargará y escribirá la salida y las traducciones de vuelta a los archivos JSON en el directorio 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
|
-
Esto cargará todos los archivos JSON en el directorio `src` que coincidan con el patrón `{key}.i18n.json` y los cargará como diccionarios de Intlayer.
|
|
164
|
-
|
|
165
123
|
## Configuración de Git
|
|
166
124
|
|
|
167
125
|
Se recomienda ignorar los archivos generados automáticamente por Intlayer:
|
|
@@ -122,52 +122,6 @@ Si se realizan cambios usando la CLI para traducir el JSON, o usando el CMS, Int
|
|
|
122
122
|
|
|
123
123
|
Para ver más detalles sobre el plugin `syncJSON`, por favor consulta la [documentación del plugin syncJSON](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/plugins/sync-json.md).
|
|
124
124
|
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
### (Opcional) Paso 3: Implementar traducciones JSON por componente
|
|
128
|
-
|
|
129
|
-
Por defecto, Intlayer cargará, combinará y sincronizará tanto los archivos JSON como los archivos de declaración de contenido. Consulta [la documentación de declaración de contenido](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/dictionary/content_file.md) para más detalles. Pero si prefieres, usando un plugin de Intlayer, también puedes implementar la gestión por componente de JSON localizado en cualquier parte de tu base de código.
|
|
130
|
-
|
|
131
|
-
Para ello, puedes usar el 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
|
-
// Mantén tus archivos JSON actuales sincronizados con los diccionarios de Intlayer
|
|
144
|
-
plugins: [
|
|
145
|
-
/**
|
|
146
|
-
* Cargará todos los archivos JSON en src que coincidan con el patrón {key}.i18n.json
|
|
147
|
-
*/
|
|
148
|
-
loadJSON({
|
|
149
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
150
|
-
locale: Locales.ENGLISH,
|
|
151
|
-
priority: 1, // Asegura que estos archivos JSON tengan prioridad sobre los archivos en `./locales/en/${key}.json`
|
|
152
|
-
}),
|
|
153
|
-
/**
|
|
154
|
-
* Cargará y escribirá la salida y las traducciones de vuelta en los archivos JSON en el directorio 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
|
-
Esto cargará todos los archivos JSON en el directorio `src` que coincidan con el patrón `{key}.i18n.json` y los cargará como diccionarios de Intlayer.
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
125
|
## Configuración de Git
|
|
172
126
|
|
|
173
127
|
Excluye los archivos generados del control de versiones:
|
|
@@ -112,7 +112,6 @@ const config: IntlayerConfig = {
|
|
|
112
112
|
},
|
|
113
113
|
plugins: [
|
|
114
114
|
syncJSON({
|
|
115
|
-
format: "i18next",
|
|
116
115
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
117
116
|
}),
|
|
118
117
|
],
|
|
@@ -132,50 +131,6 @@ Si des modifications sont effectuées via la CLI pour traduire le JSON, ou en ut
|
|
|
132
131
|
|
|
133
132
|
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).
|
|
134
133
|
|
|
135
|
-
### (Optionnel) Étape 3 : Implémenter les traductions JSON par composant
|
|
136
|
-
|
|
137
|
-
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.
|
|
138
|
-
|
|
139
|
-
Pour cela, vous pouvez utiliser le plugin `loadJSON`.
|
|
140
|
-
|
|
141
|
-
```ts fileName="intlayer.config.ts"
|
|
142
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
143
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
144
|
-
|
|
145
|
-
const config: IntlayerConfig = {
|
|
146
|
-
internationalization: {
|
|
147
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
148
|
-
defaultLocale: Locales.ENGLISH,
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
// Gardez vos fichiers JSON actuels synchronisés avec les dictionnaires Intlayer
|
|
152
|
-
plugins: [
|
|
153
|
-
/**
|
|
154
|
-
* Chargera tous les fichiers JSON dans src qui correspondent au modèle {key}.i18n.json
|
|
155
|
-
*/
|
|
156
|
-
loadJSON({
|
|
157
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
158
|
-
locale: Locales.ENGLISH,
|
|
159
|
-
priority: 1, // Assure que ces fichiers JSON ont la priorité sur les fichiers dans `./locales/en/${key}.json`
|
|
160
|
-
}),
|
|
161
|
-
/**
|
|
162
|
-
* Chargera, puis écrira la sortie et les traductions dans les fichiers JSON du répertoire locales
|
|
163
|
-
*/
|
|
164
|
-
syncJSON({
|
|
165
|
-
format: "i18next",
|
|
166
|
-
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
167
|
-
priority: 0,
|
|
168
|
-
}),
|
|
169
|
-
],
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export default config;
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
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.
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
134
|
## Configuration Git
|
|
180
135
|
|
|
181
136
|
Il est recommandé d'ignorer les fichiers Intlayer générés automatiquement :
|
|
@@ -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
|
],
|
|
@@ -132,52 +131,6 @@ Si des modifications sont effectuées via la CLI pour traduire le JSON, ou en ut
|
|
|
132
131
|
|
|
133
132
|
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).
|
|
134
133
|
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
### (Optionnel) Étape 3 : Implémenter des traductions JSON par composant
|
|
138
|
-
|
|
139
|
-
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.
|
|
140
|
-
|
|
141
|
-
Pour cela, vous pouvez utiliser le plugin `loadJSON`.
|
|
142
|
-
|
|
143
|
-
```ts fileName="intlayer.config.ts"
|
|
144
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
145
|
-
import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
|
|
146
|
-
|
|
147
|
-
const config: IntlayerConfig = {
|
|
148
|
-
internationalization: {
|
|
149
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
150
|
-
defaultLocale: Locales.ENGLISH,
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
// Gardez vos fichiers JSON actuels synchronisés avec les dictionnaires Intlayer
|
|
154
|
-
plugins: [
|
|
155
|
-
/**
|
|
156
|
-
* Chargera tous les fichiers JSON dans src qui correspondent au motif {key}.i18n.json
|
|
157
|
-
*/
|
|
158
|
-
loadJSON({
|
|
159
|
-
source: ({ key }) => `./src/**/${key}.i18n.json`,
|
|
160
|
-
locale: Locales.ENGLISH,
|
|
161
|
-
priority: 1, // Assure que ces fichiers JSON ont la priorité sur les fichiers dans `./public/locales/en/${key}.json`
|
|
162
|
-
}),
|
|
163
|
-
/**
|
|
164
|
-
* Chargera et écrira la sortie ainsi que les traductions dans les fichiers JSON du répertoire des locales
|
|
165
|
-
*/
|
|
166
|
-
syncJSON({
|
|
167
|
-
format: "i18next",
|
|
168
|
-
source: ({ key, locale }) => `./public/locales/${locale}/${key}.json`,
|
|
169
|
-
priority: 0,
|
|
170
|
-
}),
|
|
171
|
-
],
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
export default config;
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
Cela chargera tous les fichiers JSON dans le répertoire `src` qui correspondent au modèle `{key}.i18n.json` et les chargera comme dictionnaires Intlayer.
|
|
178
|
-
|
|
179
|
-
---
|
|
180
|
-
|
|
181
134
|
## Configuration Git
|
|
182
135
|
|
|
183
136
|
Exclure les fichiers générés du contrôle de version :
|