@intlayer/docs 8.3.0-canary.4 → 8.3.1
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/docs/ar/compiler.md +84 -49
- package/docs/ar/configuration.md +80 -37
- package/docs/ar/intlayer_with_nextjs_16.md +174 -1
- package/docs/ar/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ar/intlayer_with_react_router_v7.md +224 -1
- package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/ar/intlayer_with_svelte_kit.md +175 -2
- package/docs/ar/intlayer_with_tanstack.md +176 -1
- package/docs/ar/intlayer_with_vite+preact.md +174 -1
- package/docs/ar/intlayer_with_vite+react.md +174 -1
- package/docs/ar/intlayer_with_vite+solid.md +174 -1
- package/docs/ar/intlayer_with_vite+svelte.md +174 -1
- package/docs/ar/intlayer_with_vite+vue.md +174 -1
- package/docs/de/compiler.md +83 -48
- package/docs/de/configuration.md +434 -212
- package/docs/de/intlayer_with_nextjs_16.md +176 -1
- package/docs/de/intlayer_with_nextjs_compiler.md +106 -349
- package/docs/de/intlayer_with_react_router_v7.md +225 -2
- package/docs/de/intlayer_with_react_router_v7_fs_routes.md +221 -79
- package/docs/de/intlayer_with_svelte_kit.md +158 -2
- package/docs/de/intlayer_with_tanstack.md +159 -1
- package/docs/de/intlayer_with_vite+preact.md +157 -1
- package/docs/de/intlayer_with_vite+react.md +157 -1
- package/docs/de/intlayer_with_vite+solid.md +159 -3
- package/docs/de/intlayer_with_vite+svelte.md +157 -1
- package/docs/de/intlayer_with_vite+vue.md +157 -1
- package/docs/en/compiler.md +60 -33
- package/docs/en/configuration.md +80 -57
- package/docs/en/intlayer_with_nextjs_16.md +176 -0
- package/docs/en/intlayer_with_nextjs_compiler.md +179 -1
- package/docs/en/intlayer_with_react_router_v7.md +159 -0
- package/docs/en/intlayer_with_react_router_v7_fs_routes.md +159 -0
- package/docs/en/intlayer_with_svelte_kit.md +159 -0
- package/docs/en/intlayer_with_tanstack.md +160 -1
- package/docs/en/intlayer_with_vite+preact.md +159 -0
- package/docs/en/intlayer_with_vite+react.md +159 -0
- package/docs/en/intlayer_with_vite+solid.md +148 -27
- package/docs/en/intlayer_with_vite+svelte.md +159 -0
- package/docs/en/intlayer_with_vite+vue.md +142 -41
- package/docs/en-GB/compiler.md +66 -34
- package/docs/en-GB/configuration.md +78 -36
- package/docs/es/compiler.md +83 -48
- package/docs/es/configuration.md +429 -206
- package/docs/es/intlayer_with_adonisjs.md +1 -1
- package/docs/es/intlayer_with_express.md +1 -1
- package/docs/es/intlayer_with_fastify.md +1 -1
- package/docs/es/intlayer_with_hono.md +1 -1
- package/docs/es/intlayer_with_nestjs.md +1 -1
- package/docs/es/intlayer_with_nextjs_16.md +176 -3
- package/docs/es/intlayer_with_nextjs_compiler.md +175 -2
- package/docs/es/intlayer_with_nuxt.md +1 -1
- package/docs/es/intlayer_with_react_router_v7.md +227 -4
- package/docs/es/intlayer_with_react_router_v7_fs_routes.md +162 -4
- package/docs/es/intlayer_with_svelte_kit.md +158 -2
- package/docs/es/intlayer_with_tanstack.md +160 -2
- package/docs/es/intlayer_with_vite+preact.md +162 -6
- package/docs/es/intlayer_with_vite+react.md +160 -4
- package/docs/es/intlayer_with_vite+solid.md +163 -7
- package/docs/es/intlayer_with_vite+svelte.md +157 -1
- package/docs/es/intlayer_with_vite+vue.md +165 -9
- package/docs/fr/compiler.md +81 -46
- package/docs/fr/configuration.md +355 -134
- package/docs/fr/intlayer_with_adonisjs.md +1 -1
- package/docs/fr/intlayer_with_express.md +1 -1
- package/docs/fr/intlayer_with_fastify.md +1 -1
- package/docs/fr/intlayer_with_hono.md +1 -1
- package/docs/fr/intlayer_with_nestjs.md +1 -1
- package/docs/fr/intlayer_with_nextjs_16.md +183 -7
- package/docs/fr/intlayer_with_nextjs_compiler.md +179 -3
- package/docs/fr/intlayer_with_react_router_v7.md +229 -3
- package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +237 -6
- package/docs/fr/intlayer_with_svelte_kit.md +158 -2
- package/docs/fr/intlayer_with_tanstack.md +159 -1
- package/docs/fr/intlayer_with_vite+preact.md +164 -8
- package/docs/fr/intlayer_with_vite+react.md +162 -6
- package/docs/fr/intlayer_with_vite+solid.md +163 -7
- package/docs/fr/intlayer_with_vite+svelte.md +157 -1
- package/docs/fr/intlayer_with_vite+vue.md +164 -8
- package/docs/hi/compiler.md +81 -46
- package/docs/hi/configuration.md +87 -44
- package/docs/hi/intlayer_with_nextjs_16.md +174 -1
- package/docs/hi/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/hi/intlayer_with_react_router_v7.md +224 -1
- package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/hi/intlayer_with_svelte_kit.md +158 -2
- package/docs/hi/intlayer_with_tanstack.md +159 -1
- package/docs/hi/intlayer_with_vite+preact.md +157 -1
- package/docs/hi/intlayer_with_vite+react.md +157 -1
- package/docs/hi/intlayer_with_vite+solid.md +157 -1
- package/docs/hi/intlayer_with_vite+svelte.md +157 -1
- package/docs/hi/intlayer_with_vite+vue.md +157 -1
- package/docs/id/compiler.md +84 -51
- package/docs/id/configuration.md +83 -45
- package/docs/id/intlayer_with_nextjs_16.md +174 -1
- package/docs/id/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/id/intlayer_with_react_router_v7.md +224 -1
- package/docs/id/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/id/intlayer_with_svelte_kit.md +158 -2
- package/docs/id/intlayer_with_tanstack.md +159 -1
- package/docs/id/intlayer_with_vite+preact.md +157 -1
- package/docs/id/intlayer_with_vite+react.md +157 -1
- package/docs/id/intlayer_with_vite+solid.md +157 -1
- package/docs/id/intlayer_with_vite+svelte.md +157 -1
- package/docs/id/intlayer_with_vite+vue.md +157 -1
- package/docs/it/compiler.md +81 -46
- package/docs/it/configuration.md +426 -204
- package/docs/it/intlayer_with_nextjs_16.md +174 -1
- package/docs/it/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/it/intlayer_with_react_router_v7.md +225 -2
- package/docs/it/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/it/intlayer_with_svelte_kit.md +158 -2
- package/docs/it/intlayer_with_tanstack.md +159 -1
- package/docs/it/intlayer_with_vite+preact.md +157 -1
- package/docs/it/intlayer_with_vite+react.md +157 -1
- package/docs/it/intlayer_with_vite+solid.md +159 -3
- package/docs/it/intlayer_with_vite+svelte.md +157 -1
- package/docs/it/intlayer_with_vite+vue.md +157 -1
- package/docs/ja/compiler.md +94 -58
- package/docs/ja/configuration.md +88 -45
- package/docs/ja/intlayer_with_nextjs_16.md +174 -1
- package/docs/ja/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ja/intlayer_with_react_router_v7.md +184 -394
- package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/ja/intlayer_with_svelte_kit.md +119 -595
- package/docs/ja/intlayer_with_tanstack.md +131 -642
- package/docs/ja/intlayer_with_vite+preact.md +111 -1231
- package/docs/ja/intlayer_with_vite+react.md +129 -1304
- package/docs/ja/intlayer_with_vite+solid.md +159 -3
- package/docs/ja/intlayer_with_vite+svelte.md +157 -1
- package/docs/ja/intlayer_with_vite+vue.md +157 -1
- package/docs/ko/compiler.md +88 -52
- package/docs/ko/configuration.md +87 -44
- package/docs/ko/intlayer_with_nextjs_16.md +174 -1
- package/docs/ko/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ko/intlayer_with_react_router_v7.md +225 -2
- package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/ko/intlayer_with_svelte_kit.md +158 -2
- package/docs/ko/intlayer_with_tanstack.md +159 -1
- package/docs/ko/intlayer_with_vite+preact.md +157 -1
- package/docs/ko/intlayer_with_vite+react.md +157 -1
- package/docs/ko/intlayer_with_vite+solid.md +159 -3
- package/docs/ko/intlayer_with_vite+svelte.md +157 -1
- package/docs/ko/intlayer_with_vite+vue.md +157 -1
- package/docs/pl/compiler.md +84 -51
- package/docs/pl/configuration.md +83 -37
- package/docs/pl/intlayer_with_nextjs_16.md +174 -1
- package/docs/pl/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/pl/intlayer_with_react_router_v7.md +224 -1
- package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/pl/intlayer_with_svelte_kit.md +158 -2
- package/docs/pl/intlayer_with_tanstack.md +159 -1
- package/docs/pl/intlayer_with_vite+preact.md +157 -1
- package/docs/pl/intlayer_with_vite+react.md +157 -1
- package/docs/pl/intlayer_with_vite+solid.md +157 -1
- package/docs/pl/intlayer_with_vite+svelte.md +157 -1
- package/docs/pl/intlayer_with_vite+vue.md +157 -1
- package/docs/pt/compiler.md +81 -46
- package/docs/pt/configuration.md +404 -194
- package/docs/pt/intlayer_with_nextjs_16.md +174 -1
- package/docs/pt/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/pt/intlayer_with_react_router_v7.md +224 -1
- package/docs/pt/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/pt/intlayer_with_svelte_kit.md +158 -2
- package/docs/pt/intlayer_with_tanstack.md +159 -1
- package/docs/pt/intlayer_with_vite+preact.md +157 -1
- package/docs/pt/intlayer_with_vite+react.md +157 -1
- package/docs/pt/intlayer_with_vite+solid.md +157 -1
- package/docs/pt/intlayer_with_vite+svelte.md +157 -1
- package/docs/pt/intlayer_with_vite+vue.md +157 -1
- package/docs/ru/compiler.md +90 -57
- package/docs/ru/configuration.md +76 -46
- package/docs/ru/intlayer_with_nextjs_16.md +174 -1
- package/docs/ru/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ru/intlayer_with_react_router_v7.md +224 -1
- package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/ru/intlayer_with_svelte_kit.md +158 -2
- package/docs/ru/intlayer_with_tanstack.md +159 -1
- package/docs/ru/intlayer_with_vite+preact.md +157 -1
- package/docs/ru/intlayer_with_vite+react.md +157 -1
- package/docs/ru/intlayer_with_vite+solid.md +157 -1
- package/docs/ru/intlayer_with_vite+svelte.md +157 -1
- package/docs/ru/intlayer_with_vite+vue.md +157 -1
- package/docs/tr/compiler.md +85 -52
- package/docs/tr/configuration.md +83 -40
- package/docs/tr/intlayer_with_nextjs_16.md +174 -1
- package/docs/tr/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/tr/intlayer_with_react_router_v7.md +224 -1
- package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/tr/intlayer_with_svelte_kit.md +158 -2
- package/docs/tr/intlayer_with_tanstack.md +159 -1
- package/docs/tr/intlayer_with_vite+preact.md +157 -1
- package/docs/tr/intlayer_with_vite+react.md +157 -1
- package/docs/tr/intlayer_with_vite+solid.md +157 -1
- package/docs/tr/intlayer_with_vite+svelte.md +157 -1
- package/docs/tr/intlayer_with_vite+vue.md +157 -1
- package/docs/uk/compiler.md +96 -61
- package/docs/uk/configuration.md +83 -37
- package/docs/uk/intlayer_with_nextjs_16.md +174 -1
- package/docs/uk/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/uk/intlayer_with_react_router_v7.md +224 -1
- package/docs/uk/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/uk/intlayer_with_svelte_kit.md +157 -1
- package/docs/uk/intlayer_with_tanstack.md +159 -1
- package/docs/uk/intlayer_with_vite+preact.md +157 -1
- package/docs/uk/intlayer_with_vite+react.md +157 -1
- package/docs/uk/intlayer_with_vite+solid.md +157 -1
- package/docs/uk/intlayer_with_vite+svelte.md +157 -1
- package/docs/uk/intlayer_with_vite+vue.md +157 -1
- package/docs/vi/compiler.md +85 -50
- package/docs/vi/configuration.md +85 -39
- package/docs/vi/intlayer_with_nextjs_16.md +174 -1
- package/docs/vi/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/vi/intlayer_with_react_router_v7.md +224 -1
- package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/vi/intlayer_with_svelte_kit.md +158 -2
- package/docs/vi/intlayer_with_tanstack.md +159 -1
- package/docs/vi/intlayer_with_vite+preact.md +157 -1
- package/docs/vi/intlayer_with_vite+react.md +157 -1
- package/docs/vi/intlayer_with_vite+solid.md +157 -1
- package/docs/vi/intlayer_with_vite+svelte.md +157 -1
- package/docs/vi/intlayer_with_vite+vue.md +157 -1
- package/docs/zh/compiler.md +84 -49
- package/docs/zh/configuration.md +80 -37
- package/docs/zh/intlayer_with_adonisjs.md +1 -1
- package/docs/zh/intlayer_with_express.md +1 -1
- package/docs/zh/intlayer_with_fastify.md +1 -1
- package/docs/zh/intlayer_with_hono.md +1 -1
- package/docs/zh/intlayer_with_nestjs.md +1 -1
- package/docs/zh/intlayer_with_nextjs_16.md +174 -1
- package/docs/zh/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/zh/intlayer_with_react_router_v7.md +227 -4
- package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +228 -4
- package/docs/zh/intlayer_with_svelte_kit.md +158 -2
- package/docs/zh/intlayer_with_tanstack.md +159 -1
- package/docs/zh/intlayer_with_vite+preact.md +159 -3
- package/docs/zh/intlayer_with_vite+react.md +157 -1
- package/docs/zh/intlayer_with_vite+solid.md +161 -5
- package/docs/zh/intlayer_with_vite+svelte.md +157 -1
- package/docs/zh/intlayer_with_vite+vue.md +158 -2
- package/package.json +6 -6
package/docs/es/compiler.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-09-09
|
|
3
|
-
updatedAt: 2026-03-
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: Intlayer Compiler | Extracción Automática de Contenido para i18n
|
|
5
5
|
description: Automatiza tu proceso de internacionalización con el Intlayer Compiler. Extrae contenido directamente de tus componentes para una i18n más rápida y eficiente en Vite, Next.js y más.
|
|
6
6
|
keywords:
|
|
@@ -149,73 +149,85 @@ Esta configuración asegura que el contenido declarado en tus componentes se ext
|
|
|
149
149
|
See complete tutorial: [Intlayer Compiler with Next.js](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_nextjs_compiler.md)
|
|
150
150
|
|
|
151
151
|
</Tab>
|
|
152
|
+
</Tabs>
|
|
152
153
|
|
|
153
154
|
### Configuración personalizada
|
|
154
155
|
|
|
155
156
|
Para personalizar el comportamiento del compilador, puedes actualizar el archivo `intlayer.config.ts` en la raíz de tu proyecto.
|
|
156
157
|
|
|
157
|
-
|
|
158
|
+
````ts fileName="intlayer.config.ts"
|
|
158
159
|
import { type IntlayerConfig, Locales } from "intlayer";
|
|
159
160
|
|
|
160
161
|
const config: IntlayerConfig = {
|
|
161
162
|
compiler: {
|
|
162
163
|
/**
|
|
164
|
+
* Indica si el compilador debe estar habilitado.
|
|
163
165
|
* Establécelo en 'build-only' para omitir el compilador durante el desarrollo y acelerar los tiempos de inicio.
|
|
164
166
|
*/
|
|
165
167
|
enabled: true,
|
|
166
168
|
|
|
167
169
|
/**
|
|
168
|
-
*
|
|
170
|
+
* Define la ruta de los archivos de salida. Reemplaza `outputDir`.
|
|
171
|
+
*
|
|
172
|
+
* - Las rutas `./` se resuelven de forma relativa al directorio del componente.
|
|
173
|
+
* - Las rutas `/` se resuelven de forma relativa a la raíz del proyecto (`baseDir`).
|
|
174
|
+
*
|
|
175
|
+
* - Incluir la variable `{{locale}}` en la ruta activará la generación de diccionarios separados por locale.
|
|
176
|
+
*
|
|
177
|
+
* Ejemplo:
|
|
178
|
+
* ```ts
|
|
179
|
+
* {
|
|
180
|
+
* // Crear archivos .content.ts multilingües cerca del componente
|
|
181
|
+
* output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
182
|
+
*
|
|
183
|
+
* // output: './{{fileName}}{{extension}}', // Equivalente usando una cadena de plantilla
|
|
184
|
+
* }
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* ```ts
|
|
188
|
+
* {
|
|
189
|
+
* // Crear JSON centralizados por locale en la raíz del proyecto
|
|
190
|
+
* output: ({ key, locale }) => `/locales/${locale}/${key}.content.json`,
|
|
191
|
+
*
|
|
192
|
+
* // output: '/locales/{{locale}}/{{key}}.content.json', // Equivalente usando una cadena de plantilla
|
|
193
|
+
* }
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* Lista de variables:
|
|
197
|
+
* - `fileName`: El nombre del archivo.
|
|
198
|
+
* - `key`: La clave del contenido.
|
|
199
|
+
* - `locale`: El locale del contenido.
|
|
200
|
+
* - `extension`: La extensión del archivo.
|
|
201
|
+
* - `componentFileName`: El nombre del archivo del componente.
|
|
202
|
+
* - `componentExtension`: La extensión del archivo del componente.
|
|
203
|
+
* - `format`: El formato del diccionario.
|
|
204
|
+
* - `componentFormat`: El formato del diccionario del componente.
|
|
205
|
+
* - `componentDirPath`: La ruta del directorio del componente.
|
|
169
206
|
*/
|
|
170
|
-
|
|
171
|
-
"**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
|
|
172
|
-
"!**/node_modules/**",
|
|
173
|
-
],
|
|
207
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
174
208
|
|
|
175
209
|
/**
|
|
176
|
-
*
|
|
177
|
-
|
|
178
|
-
excludePattern: ["**/node_modules/**"],
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Directorio de salida para los diccionarios optimizados.
|
|
210
|
+
* Indica si los componentes deben guardarse después de ser transformados.
|
|
211
|
+
* De esta manera, el compilador puede ejecutarse una sola vez para transformar la aplicación y luego puede eliminarse.
|
|
182
212
|
*/
|
|
183
|
-
|
|
213
|
+
saveComponents: false,
|
|
184
214
|
|
|
185
215
|
/**
|
|
186
|
-
*
|
|
216
|
+
* Insertar solo contenido en el archivo generado, útil para salidas JSON de i18next o ICU MessageFormat por locale.
|
|
217
|
+
*
|
|
218
|
+
* - `output: ({ locale, key }) => `./locale/${locale}/${key}.json`,`
|
|
187
219
|
*/
|
|
188
220
|
noMetadata: false,
|
|
189
221
|
|
|
190
222
|
/**
|
|
191
223
|
* Prefijo de clave de diccionario
|
|
192
224
|
*/
|
|
193
|
-
dictionaryKeyPrefix: "", //
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Indica si los componentes deben guardarse después de ser transformados.
|
|
197
|
-
* De esta manera, el compilador puede ejecutarse una sola vez para transformar la aplicación y luego puede eliminarse.
|
|
198
|
-
*/
|
|
199
|
-
saveComponents: false,
|
|
225
|
+
dictionaryKeyPrefix: "", // Añadir un prefijo opcional para las claves de diccionario extraídas
|
|
200
226
|
},
|
|
201
227
|
};
|
|
202
228
|
|
|
203
229
|
export default config;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
### Rellenar traducciones faltantes
|
|
207
|
-
|
|
208
|
-
Intlayer proporciona una herramienta CLI para ayudarte a rellenar las traducciones faltantes. Puedes usar el comando `intlayer` para probar y rellenar las traducciones faltantes de tu código.
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
npx intlayer test # Probar si faltan traducciones
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
```bash
|
|
215
|
-
npx intlayer fill # Rellenar traducciones faltantes
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
> Para más detalles, consulta la [documentación de la CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/cli/ci.md)
|
|
230
|
+
````
|
|
219
231
|
|
|
220
232
|
### Referencia de configuración del compilador
|
|
221
233
|
|
|
@@ -225,36 +237,37 @@ Las siguientes propiedades pueden configurarse en el bloque `compiler` de tu arc
|
|
|
225
237
|
- _Tipo_: `boolean | 'build-only'`
|
|
226
238
|
- _Por defecto_: `true`
|
|
227
239
|
- _Descripción_: Indica si el compilador debe estar habilitado.
|
|
240
|
+
|
|
228
241
|
- **dictionaryKeyPrefix**:
|
|
229
242
|
- _Tipo_: `string`
|
|
230
|
-
- _Por defecto_: `'
|
|
243
|
+
- _Por defecto_: `''`
|
|
231
244
|
- _Descripción_: Prefijo para las claves de diccionario extraídas.
|
|
245
|
+
|
|
232
246
|
- **transformPattern**:
|
|
233
247
|
- _Tipo_: `string | string[]`
|
|
234
248
|
- _Por defecto_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
|
|
235
|
-
- _Descripción_: Patrones para recorrer el código a optimizar.
|
|
249
|
+
- _Descripción_: (Obsoleto: usa `build.traversePattern` en su lugar) Patrones para recorrer el código a optimizar.
|
|
250
|
+
|
|
236
251
|
- **excludePattern**:
|
|
237
252
|
- _Tipo_: `string | string[]`
|
|
238
253
|
- _Por defecto_: `['**/node_modules/**']`
|
|
239
|
-
- _Descripción_: Patrones para excluir de la optimización.
|
|
240
|
-
- **outputDir** (Deprecated):
|
|
241
|
-
- _Tipo_: `string`
|
|
242
|
-
- _Por defecto_: `'compiler'`
|
|
243
|
-
- _Descripción_: El directorio donde se almacenarán los diccionarios extraídos.
|
|
254
|
+
- _Descripción_: (Obsoleto: usa `build.traversePattern` en su lugar) Patrones para excluir de la optimización.
|
|
244
255
|
|
|
245
256
|
- **output**:
|
|
246
|
-
-
|
|
257
|
+
- _Tipo_: `FilePathPattern`
|
|
247
258
|
- _Por defecto_: `({ key }) => 'compiler/${key}.content.json'`
|
|
248
259
|
- _Descripción_: Define la ruta de los archivos de salida. Reemplaza `outputDir`. Maneja variables dinámicas como `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Se puede configurar como una cadena usando el formato `'my/{{var}}/path'` o como una función.
|
|
249
|
-
- _Nota_: `./**/*`
|
|
260
|
+
- _Nota_: `./**/*` Las rutas se resuelven de forma relativa al componente. `/**/*` las rutas se resuelven de forma relativa al `baseDir` de Intlayer.
|
|
261
|
+
- _Note_: Si el locale se establece en la ruta, generará diccionarios por locale.
|
|
250
262
|
- _Ejemplo_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
|
|
251
263
|
|
|
252
264
|
- **noMetadata**:
|
|
253
265
|
- _Tipo_: `boolean`
|
|
254
266
|
- _Por defecto_: `false`
|
|
255
|
-
- _Descripción_: Indica si los metadatos deben guardarse en el archivo. Si es verdadero, el compilador no guardará los metadatos de los diccionarios (clave, contenedor de contenido).
|
|
267
|
+
- _Descripción_: Indica si los metadatos deben guardarse en el archivo. Si es verdadero, el compilador no guardará los metadatos de los diccionarios (clave, contenedor de contenido). Útil para las salidas JSON de i18next o ICU MessageFormat por locale.
|
|
256
268
|
- _Nota_: Útil si se usa con el plugin `loadJSON`.
|
|
257
|
-
- _Ejemplo_:
|
|
269
|
+
- _Ejemplo_:
|
|
270
|
+
Si es `true`:
|
|
258
271
|
```json
|
|
259
272
|
{
|
|
260
273
|
"key": "value"
|
|
@@ -274,3 +287,25 @@ Las siguientes propiedades pueden configurarse en el bloque `compiler` de tu arc
|
|
|
274
287
|
- _Tipo_: `boolean`
|
|
275
288
|
- _Por defecto_: `false`
|
|
276
289
|
- _Descripción_: Indica si los componentes deben guardarse después de ser transformados.
|
|
290
|
+
|
|
291
|
+
### Rellenar traducciones faltantes
|
|
292
|
+
|
|
293
|
+
Intlayer proporciona una herramienta CLI para ayudarte a rellenar las traducciones faltantes. Puedes usar el comando `intlayer` para probar y rellenar las traducciones faltantes de tu código.
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
npx intlayer test # Probar si faltan traducciones
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
npx intlayer fill # Rellenar traducciones faltantes
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Extracción
|
|
304
|
+
|
|
305
|
+
Intlayer proporciona una herramienta CLI para extraer contenido de tu código. Puedes usar el comando `intlayer extract` para extraer contenido de tu código.
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
npx intlayer extract
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
> Para más detalles, consulta la [documentación de la CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/cli/index.md)
|