@intlayer/docs 8.2.4 → 8.3.0-canary.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.
Files changed (135) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -0
  2. package/dist/cjs/blog.cjs.map +1 -1
  3. package/dist/cjs/common.cjs +1 -1
  4. package/dist/cjs/common.cjs.map +1 -1
  5. package/dist/cjs/doc.cjs.map +1 -1
  6. package/dist/cjs/frequentQuestions.cjs.map +1 -1
  7. package/dist/cjs/generated/blog.entry.cjs +1 -1
  8. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  9. package/dist/cjs/generated/docs.entry.cjs +1 -1
  10. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  11. package/dist/cjs/generated/frequentQuestions.entry.cjs +1 -1
  12. package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
  13. package/dist/cjs/generated/legal.entry.cjs +1 -1
  14. package/dist/cjs/generated/legal.entry.cjs.map +1 -1
  15. package/dist/cjs/legal.cjs.map +1 -1
  16. package/dist/esm/blog.mjs.map +1 -1
  17. package/dist/esm/common.mjs +1 -1
  18. package/dist/esm/common.mjs.map +1 -1
  19. package/dist/esm/doc.mjs.map +1 -1
  20. package/dist/esm/frequentQuestions.mjs.map +1 -1
  21. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  22. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  23. package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
  24. package/dist/esm/generated/legal.entry.mjs.map +1 -1
  25. package/dist/esm/legal.mjs.map +1 -1
  26. package/dist/types/blog.d.ts +1 -1
  27. package/dist/types/common.d.ts +1 -1
  28. package/dist/types/common.d.ts.map +1 -1
  29. package/dist/types/doc.d.ts +1 -1
  30. package/dist/types/frequentQuestions.d.ts +1 -1
  31. package/dist/types/generated/blog.entry.d.ts +1 -1
  32. package/dist/types/generated/docs.entry.d.ts +1 -1
  33. package/dist/types/generated/frequentQuestions.entry.d.ts +1 -1
  34. package/dist/types/generated/legal.entry.d.ts +1 -1
  35. package/dist/types/legal.d.ts +1 -1
  36. package/docs/ar/compiler.md +73 -8
  37. package/docs/ar/configuration.md +74 -27
  38. package/docs/ar/intlayer_with_nextjs_compiler.md +13 -5
  39. package/docs/ar/intlayer_with_tanstack.md +22 -1
  40. package/docs/ar/intlayer_with_vite+react_compiler.md +13 -5
  41. package/docs/de/compiler.md +74 -9
  42. package/docs/de/configuration.md +61 -22
  43. package/docs/de/intlayer_with_nextjs_compiler.md +12 -4
  44. package/docs/de/intlayer_with_tanstack.md +22 -1
  45. package/docs/de/intlayer_with_vite+react_compiler.md +12 -4
  46. package/docs/en/compiler.md +79 -1
  47. package/docs/en/configuration.md +50 -9
  48. package/docs/en/intlayer_with_nextjs_compiler.md +9 -1
  49. package/docs/en/intlayer_with_tanstack.md +23 -2
  50. package/docs/en/intlayer_with_vite+react_compiler.md +9 -1
  51. package/docs/en-GB/compiler.md +72 -6
  52. package/docs/en-GB/configuration.md +50 -10
  53. package/docs/en-GB/intlayer_with_nextjs_compiler.md +22 -3
  54. package/docs/en-GB/intlayer_with_tanstack.md +22 -1
  55. package/docs/en-GB/intlayer_with_vite+react_compiler.md +22 -3
  56. package/docs/es/compiler.md +71 -6
  57. package/docs/es/configuration.md +65 -26
  58. package/docs/es/intlayer_with_nextjs_compiler.md +9 -1
  59. package/docs/es/intlayer_with_tanstack.md +22 -1
  60. package/docs/es/intlayer_with_vite+react_compiler.md +9 -1
  61. package/docs/fr/compiler.md +69 -4
  62. package/docs/fr/configuration.md +62 -23
  63. package/docs/fr/intlayer_with_nextjs_compiler.md +9 -1
  64. package/docs/fr/intlayer_with_tanstack.md +22 -1
  65. package/docs/fr/intlayer_with_vite+react_compiler.md +9 -1
  66. package/docs/hi/compiler.md +74 -9
  67. package/docs/hi/configuration.md +70 -23
  68. package/docs/hi/intlayer_with_nextjs_compiler.md +15 -7
  69. package/docs/hi/intlayer_with_tanstack.md +22 -1
  70. package/docs/hi/intlayer_with_vite+react_compiler.md +15 -7
  71. package/docs/id/compiler.md +73 -8
  72. package/docs/id/configuration.md +67 -20
  73. package/docs/id/intlayer_with_nextjs_compiler.md +13 -5
  74. package/docs/id/intlayer_with_tanstack.md +22 -1
  75. package/docs/id/intlayer_with_vite+react_compiler.md +13 -5
  76. package/docs/it/compiler.md +73 -8
  77. package/docs/it/configuration.md +66 -27
  78. package/docs/it/intlayer_with_nextjs_compiler.md +12 -4
  79. package/docs/it/intlayer_with_tanstack.md +22 -1
  80. package/docs/it/intlayer_with_vite+react_compiler.md +12 -4
  81. package/docs/ja/compiler.md +75 -10
  82. package/docs/ja/configuration.md +70 -23
  83. package/docs/ja/intlayer_with_nextjs_compiler.md +13 -5
  84. package/docs/ja/intlayer_with_tanstack.md +22 -1
  85. package/docs/ja/intlayer_with_vite+react_compiler.md +13 -5
  86. package/docs/ko/compiler.md +75 -10
  87. package/docs/ko/configuration.md +70 -23
  88. package/docs/ko/intlayer_with_nextjs_compiler.md +22 -3
  89. package/docs/ko/intlayer_with_tanstack.md +22 -1
  90. package/docs/ko/intlayer_with_vite+react_compiler.md +22 -3
  91. package/docs/pl/compiler.md +73 -8
  92. package/docs/pl/configuration.md +71 -29
  93. package/docs/pl/intlayer_with_nextjs_compiler.md +13 -5
  94. package/docs/pl/intlayer_with_tanstack.md +22 -1
  95. package/docs/pl/intlayer_with_vite+react_compiler.md +13 -5
  96. package/docs/pt/compiler.md +74 -9
  97. package/docs/pt/configuration.md +62 -23
  98. package/docs/pt/intlayer_with_nextjs_compiler.md +12 -4
  99. package/docs/pt/intlayer_with_tanstack.md +22 -1
  100. package/docs/pt/intlayer_with_vite+react_compiler.md +12 -4
  101. package/docs/ru/compiler.md +74 -9
  102. package/docs/ru/configuration.md +61 -22
  103. package/docs/ru/intlayer_with_nextjs_compiler.md +11 -3
  104. package/docs/ru/intlayer_with_tanstack.md +22 -1
  105. package/docs/ru/intlayer_with_vite+react_compiler.md +11 -3
  106. package/docs/tr/compiler.md +73 -8
  107. package/docs/tr/configuration.md +77 -42
  108. package/docs/tr/intlayer_with_nextjs_compiler.md +11 -3
  109. package/docs/tr/intlayer_with_tanstack.md +22 -1
  110. package/docs/tr/intlayer_with_vite+react_compiler.md +11 -3
  111. package/docs/uk/compiler.md +74 -9
  112. package/docs/uk/configuration.md +207 -165
  113. package/docs/uk/intlayer_with_nextjs_compiler.md +13 -5
  114. package/docs/uk/intlayer_with_tanstack.md +22 -1
  115. package/docs/uk/intlayer_with_vite+react_compiler.md +13 -5
  116. package/docs/vi/compiler.md +75 -10
  117. package/docs/vi/configuration.md +97 -21
  118. package/docs/vi/intlayer_with_nextjs_compiler.md +14 -6
  119. package/docs/vi/intlayer_with_tanstack.md +22 -1
  120. package/docs/vi/intlayer_with_vite+react_compiler.md +14 -6
  121. package/docs/zh/compiler.md +75 -10
  122. package/docs/zh/configuration.md +77 -42
  123. package/docs/zh/intlayer_with_nextjs_compiler.md +13 -5
  124. package/docs/zh/intlayer_with_tanstack.md +22 -1
  125. package/docs/zh/intlayer_with_vite+react_compiler.md +13 -5
  126. package/package.json +17 -17
  127. package/src/blog.ts +1 -1
  128. package/src/common.ts +2 -1
  129. package/src/doc.ts +1 -1
  130. package/src/frequentQuestions.ts +1 -1
  131. package/src/generated/blog.entry.ts +1 -1
  132. package/src/generated/docs.entry.ts +1 -1
  133. package/src/generated/frequentQuestions.entry.ts +1 -1
  134. package/src/generated/legal.entry.ts +1 -1
  135. package/src/legal.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-08-13
3
- updatedAt: 2026-02-25
3
+ updatedAt: 2026-03-11
4
4
  title: Configuración
5
5
  description: Aprende cómo configurar Intlayer para tu aplicación. Entiende las diversas configuraciones y opciones disponibles para personalizar Intlayer según tus necesidades.
6
6
  keywords:
@@ -14,18 +14,24 @@ slugs:
14
14
  - concept
15
15
  - configuration
16
16
  history:
17
+ - version: 8.3.0
18
+ data: 2026-03-11
19
+ changes: Mover 'baseDir' de la configuración 'content' a la de 'system'
20
+ - version: 8.2.0
21
+ date: 2026-03-10
22
+ changes: Actualizar opciones del compilador, añadir soporte para 'output' y 'noMetadata'
17
23
  - version: 8.1.7
18
24
  date: 2026-02-25
19
25
  changes: Actualizar opciones del compilador
20
26
  - version: 8.0.6
21
27
  date: 2026-02-12
22
- changes: Add support for Open Router, Alibaba, Amazon, Google Vertex Bedrock, Fireworks, Groq, Hugging Face, and Together.ai providers
28
+ changes: Añadir soporte para los proveedores Open Router, Alibaba, Amazon, Google Vertex Bedrock, Fireworks, Groq, Hugging Face y Together.ai
23
29
  - version: 8.0.5
24
30
  date: 2026-02-06
25
31
  changes: Añadir `dataSerialization` a la configuración de IA
26
32
  - version: 8.0.0
27
33
  date: 2026-01-22
28
- changes: Move `importMode` build configuration to `dictionary` configuration.
34
+ changes: Mover la configuración de construcción para importMode a la configuración del diccionario.
29
35
  - version: 8.0.0
30
36
  date: 2026-01-18
31
37
  changes: Separar la configuración del sistema de la configuración del contenido. Mover las rutas internas a la propiedad `system`. Añadir `codeDir` para separar los archivos de contenido de la transformación del código.
@@ -419,12 +425,12 @@ const config: IntlayerConfig = {
419
425
  */
420
426
  compiler: {
421
427
  /**
422
- * Indicates if the compiler should be enabled.
428
+ * Establécelo en 'build-only' para omitir el compilador durante el desarrollo y acelerar los tiempos de inicio.
423
429
  */
424
430
  enabled: true,
425
431
 
426
432
  /**
427
- * Pattern to traverse the code to optimize.
433
+ * Patrón para recorrer el código a optimizar.
428
434
  */
429
435
  transformPattern: [
430
436
  "**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
@@ -432,23 +438,28 @@ const config: IntlayerConfig = {
432
438
  ],
433
439
 
434
440
  /**
435
- * Pattern to exclude from the optimization.
441
+ * Patrón a excluir de la optimización.
436
442
  */
437
443
  excludePattern: ["**/node_modules/**"],
438
444
 
439
445
  /**
440
- * Output directory for the optimized dictionaries.
446
+ * Directorio de salida para los diccionarios optimizados.
441
447
  */
442
- outputDir: "compiler",
448
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
443
449
 
444
450
  /**
445
- * Dictionary key prefix
451
+ * Inserta solo el contenido en el archivo generado, sin clave.
446
452
  */
447
- dictionaryKeyPrefix: "", // Remove base prefix
453
+ noMetadata: false,
448
454
 
449
455
  /**
450
- * Indicates if the components should be saved after being transformed.
451
- * That way, the compiler can be run only once to transform the app, and then it can be removed.
456
+ * Prefijo de clave de diccionario
457
+ */
458
+ dictionaryKeyPrefix: "", // Eliminar el prefijo base
459
+
460
+ /**
461
+ * Indica si los componentes deben guardarse después de ser transformados.
462
+ * De esta manera, el compilador puede ejecutarse una sola vez para transformar la aplicación y luego puede eliminarse.
452
463
  */
453
464
  saveComponents: false,
454
465
  },
@@ -704,7 +715,7 @@ Configuraciones relacionadas con el manejo de contenido dentro de la aplicación
704
715
  #### Propiedades
705
716
 
706
717
  - **autoFill**:
707
- - _Tipo_: `boolean | string | { [key in Locales]?: string }`
718
+ - _Tipo_: `boolean | string | FilePathPattern | { [key in Locales]?: string }`
708
719
  - _Por defecto_: `undefined`
709
720
  - _Descripción_: Indica cómo debe completarse automáticamente el contenido usando IA. Puede declararse globalmente en el archivo `intlayer.config.ts`.
710
721
  - _Ejemplo_: true
@@ -727,13 +738,6 @@ Configuraciones relacionadas con el manejo de contenido dentro de la aplicación
727
738
  - _Ejemplo_: `['.data.ts', '.data.js', '.data.json']`
728
739
  - _Nota_: Personalizar las extensiones de archivo puede ayudar a evitar conflictos.
729
740
 
730
- - **baseDir**:
731
- - _Tipo_: `string`
732
- - _Por defecto_: `process.cwd()`
733
- - _Descripción_: El directorio base para el proyecto.
734
- - _Ejemplo_: `'/ruta/al/proyecto'`
735
- - _Nota_: Esto se usa para resolver todos los directorios relacionados con Intlayer.
736
-
737
741
  - **contentDir**:
738
742
  - _Tipo_: `string[]`
739
743
  - _Por defecto_: `['.']`
@@ -768,10 +772,17 @@ Configuraciones relacionadas con el manejo de contenido dentro de la aplicación
768
772
 
769
773
  ### Configuración del Sistema
770
774
 
771
- Configuraciones relacionadas con las rutas internas y los resultados de salida de Intlayer. Estas configuraciones son típicamente internas y no deberían necesitar ser modificadas por el usuario.
775
+ Estructura de directorios y resultados de salida de Intlayer. Estas configuraciones son típicamente internas y no deberían necesitar ser modificadas por el usuario.
772
776
 
773
777
  #### Propiedades
774
778
 
779
+ - **baseDir**:
780
+ - _Tipo_: `string`
781
+ - _Por defecto_: `process.cwd()`
782
+ - _Descripción_: El directorio base para el proyecto.
783
+ - _Ejemplo_: `'/ruta/al/proyecto'`
784
+ - _Nota_: Esto se usa para resolver todos los directorios relacionados con Intlayer.
785
+
775
786
  - **dictionariesDir**:
776
787
  - _Tipo_: `string`
777
788
  - _Por defecto_: `'.intlayer/dictionary'`
@@ -962,10 +973,10 @@ Las opciones de compilación se aplican a los plugins `@intlayer/babel` y `@intl
962
973
  - _Nota_: Puede usarse para deshabilitar la compilación de diccionarios, por ejemplo cuando se debe evitar la ejecución en un entorno Node.js.
963
974
 
964
975
  - **checkTypes**:
965
- - _Type_: `boolean`
966
- - _Default_: `false`
967
- - _Description_: Indica si la compilación debe comprobar los tipos de TypeScript y registrar errores.
968
- - _Note_: Esto puede ralentizar la compilación.
976
+ - _Tipo_: `boolean`
977
+ - _Por defecto_: `false`
978
+ - _Descripción_: Indica si la compilación debe comprobar los tipos de TypeScript y registrar errores.
979
+ - _Nota_: Esto puede ralentizar la compilación.
969
980
 
970
981
  - **optimize**:
971
982
  - _Tipo_: `boolean`
@@ -978,7 +989,7 @@ Las opciones de compilación se aplican a los plugins `@intlayer/babel` y `@intl
978
989
  - _Nota_: Asegúrese de que todas las claves estén declaradas estáticamente en las llamadas a `useIntlayer`. Por ejemplo, `useIntlayer('navbar')`.
979
990
 
980
991
  - **importMode**:
981
- - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
992
+ - _Nota_: **Deprecated**: Use `dictionary.importMode` instead.
982
993
  - _Tipo_: `'static' | 'dynamic' | 'fetch'`
983
994
  - _Por defecto_: `'static'`
984
995
  - _Descripción_: Controla cómo se importan los diccionarios.
@@ -1057,3 +1068,31 @@ Ajustes que controlan el compilador Intlayer, que extrae diccionarios directamen
1057
1068
  - _Tipo_: `string`
1058
1069
  - _Por defecto_: `'compiler'`
1059
1070
  - _Descripción_: El directorio donde se almacenarán los diccionarios extraídos, relativo a la ruta base de su proyecto.
1071
+
1072
+ - **output**:
1073
+ - _Type_: `FilePathPattern`
1074
+ - _Por defecto_: `({ key }) => 'compiler/${key}.content.json'`
1075
+ - _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.
1076
+ - _Nota_: `./**/*` Los caminos se resuelven de forma relativa al componente. `/**/*` los caminos se resuelven de forma relativa al `baseDir` de Intlayer.
1077
+ - _Ejemplo_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1078
+
1079
+ - **noMetadata**:
1080
+ - _Tipo_: `boolean`
1081
+ - _Por defecto_: `false`
1082
+ - _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).
1083
+ - _Nota_: Útil si se usa con el plugin `loadJSON`.
1084
+ - _Ejemplo_: Si es `true`:
1085
+ ```json
1086
+ {
1087
+ "key": "value"
1088
+ }
1089
+ ```
1090
+ Si es `false`:
1091
+ ```json
1092
+ {
1093
+ "key": "value",
1094
+ "content": {
1095
+ "key": "value"
1096
+ }
1097
+ }
1098
+ ```
@@ -20,6 +20,9 @@ slugs:
20
20
  applicationTemplate: https://github.com/aymericzip/intlayer-next-no-lolale-path-template
21
21
  youtubeVideo: https://www.youtube.com/watch?v=e_PPG7PTqGU
22
22
  history:
23
+ - version: 8.2.0
24
+ date: 2026-03-09
25
+ changes: Update compiler options, add FilePathPattern support
23
26
  - version: 8.1.6
24
27
  date: 2026-02-23
25
28
  changes: Versión inicial
@@ -135,7 +138,12 @@ const config: IntlayerConfig = {
135
138
  /**
136
139
  * Directorio de salida para los diccionarios optimizados.
137
140
  */
138
- outputDir: "compiler",
141
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
142
+
143
+ /**
144
+ * Inserta solo el contenido en el archivo generado, sin clave.
145
+ */
146
+ noMetadata: false,
139
147
 
140
148
  /**
141
149
  * Prefijo de clave de diccionario
@@ -437,12 +437,33 @@ export const Route = createFileRoute("/{-$locale}/")({
437
437
  component: RouteComponent,
438
438
  head: ({ params }) => {
439
439
  const { locale } = params;
440
+ const path = "/"; // The path for this route
441
+
440
442
  const metaContent = getIntlayer("app", locale);
441
443
 
442
444
  return {
445
+ links: [
446
+ // Canonical link: Points to the current localized page
447
+ { rel: "canonical", href: getLocalizedUrl(path, locale) },
448
+
449
+ // Hreflang: Tell Google about all localized versions
450
+ ...localeMap(({ locale: mapLocale }) => ({
451
+ rel: "alternate",
452
+ hrefLang: mapLocale,
453
+ href: getLocalizedUrl(path, mapLocale),
454
+ })),
455
+
456
+ // x-default: For users in unmatched languages
457
+ // Define the default fallback locale (usually your primary language)
458
+ {
459
+ rel: "alternate",
460
+ hrefLang: "x-default",
461
+ href: getLocalizedUrl(path, defaultLocale),
462
+ },
463
+ ],
443
464
  meta: [
444
465
  { title: metaContent.title },
445
- { content: metaContent.meta.description, name: "description" },
466
+ { name: "description", content: metaContent.meta.description },
446
467
  ],
447
468
  };
448
469
  },
@@ -19,6 +19,9 @@ slugs:
19
19
  applicationTemplate: https://github.com/aymericzip/intlayer-vite-react-template
20
20
  youtubeVideo: https://www.youtube.com/watch?v=dS9L7uJeak4
21
21
  history:
22
+ - version: 8.2.0
23
+ date: 2026-03-09
24
+ changes: Update compiler options, add FilePathPattern support
22
25
  - version: 8.1.6
23
26
  date: 2026-02-23
24
27
  changes: Lanzamiento inicial
@@ -132,7 +135,12 @@ const config: IntlayerConfig = {
132
135
  /**
133
136
  * Directorio de salida para los diccionarios optimizados.
134
137
  */
135
- outputDir: "compiler",
138
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
139
+
140
+ /**
141
+ * Inserta solo el contenido en el archivo generado, sin clave.
142
+ */
143
+ noMetadata: false,
136
144
 
137
145
  /**
138
146
  * Prefijo de clave de diccionario
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-09-09
3
- updatedAt: 2026-02-25
3
+ updatedAt: 2026-03-10
4
4
  title: Compilateur Intlayer | Extraction automatique de contenu pour l'i18n
5
5
  description: Automatisez votre processus d'internationalisation avec le compilateur Intlayer. Extrayez le contenu directement de vos composants pour une i18n plus rapide et plus efficace dans Vite, Next.js, et plus encore.
6
6
  keywords:
@@ -20,6 +20,9 @@ slugs:
20
20
  - doc
21
21
  - compiler
22
22
  history:
23
+ - version: 8.2.0
24
+ date: 2026-03-10
25
+ changes: Update compiler options, add FilePathPattern support
23
26
  - version: 8.1.7
24
27
  date: 2026-02-25
25
28
  changes: Mise à jour des options du compilateur
@@ -157,7 +160,6 @@ import { type IntlayerConfig, Locales } from "intlayer";
157
160
  const config: IntlayerConfig = {
158
161
  compiler: {
159
162
  /**
160
- * Indique si le compilateur doit être activé.
161
163
  * Réglez sur 'build-only' pour ignorer le compilateur pendant le développement et accélérer les temps de démarrage.
162
164
  */
163
165
  enabled: true,
@@ -178,7 +180,12 @@ const config: IntlayerConfig = {
178
180
  /**
179
181
  * Répertoire de sortie pour les dictionnaires optimisés.
180
182
  */
181
- outputDir: "i18n",
183
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
184
+
185
+ /**
186
+ * Insérer uniquement le contenu dans le fichier généré, sans clé.
187
+ */
188
+ noMetadata: false,
182
189
 
183
190
  /**
184
191
  * Préfixe de clé de dictionnaire
@@ -186,7 +193,7 @@ const config: IntlayerConfig = {
186
193
  dictionaryKeyPrefix: "", // Supprimer le préfixe de base
187
194
 
188
195
  /**
189
- * Indique si les composants doivent être enregistrés après avoir été transformés.
196
+ * Indique si les composants doivent être sauvegardés après avoir été transformés.
190
197
  * De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
191
198
  */
192
199
  saveComponents: false,
@@ -209,3 +216,61 @@ npx intlayer fill # Remplir les traductions manquantes
209
216
  ```
210
217
 
211
218
  > Pour plus de détails, consultez la [documentation CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/cli/ci.md)
219
+
220
+ ### Référence de la configuration du compilateur
221
+
222
+ Les propriétés suivantes peuvent être configurées dans le bloc `compiler` de votre fichier `intlayer.config.ts` :
223
+
224
+ - **enabled**:
225
+ - _Type_: `boolean | 'build-only'`
226
+ - _Par défaut_: `true`
227
+ - _Description_: Indique si le compilateur doit être activé.
228
+ - **dictionaryKeyPrefix**:
229
+ - _Type_: `string`
230
+ - _Par défaut_: `'comp-'`
231
+ - _Description_: Préfixe pour les clés de dictionnaire extraites.
232
+ - **transformPattern**:
233
+ - _Type_: `string | string[]`
234
+ - _Par défaut_: `['**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}', '!**/node_modules/**']`
235
+ - _Description_: Modèles pour parcourir le code à optimiser.
236
+ - **excludePattern**:
237
+ - _Type_: `string | string[]`
238
+ - _Par défaut_: `['**/node_modules/**']`
239
+ - _Description_: Modèles à exclure de l'optimisation.
240
+ - **outputDir** (Deprecated):
241
+ - _Type_: `string`
242
+ - _Par défaut_: `'compiler'`
243
+ - _Description_: Le répertoire où les dictionnaires extraits seront stockés.
244
+
245
+ - **output**:
246
+ - _Type_: `FilePathPattern`
247
+ - _Par défaut_: `({ key }) => 'compiler/${key}.content.json'`
248
+ - _Description_: Définit le chemin des fichiers de sortie. Remplace `outputDir`. Gère les variables dynamiques telles que `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Peut être configuré sous forme de chaîne à l'aide du format `'my/{{var}}/path'` ou sous forme de fonction.
249
+ - _Note_: `./**/*` Les chemins sont résolus par rapport au composant. `/**/*` les chemins sont résolus par rapport au `baseDir` d'Intlayer.
250
+ - _Exemple_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
251
+
252
+ - **noMetadata**:
253
+ - _Type_: `boolean`
254
+ - _Par défaut_: `false`
255
+ - _Description_: Indique si les métadonnées doivent être enregistrées dans le fichier. Si vrai, le compilateur n'enregistrera pas les métadonnées des dictionnaires (clé, enveloppe de contenu).
256
+ - _Note_: Utile si utilisé avec le plugin `loadJSON`.
257
+ - _Exemple_: Si `true` :
258
+ ```json
259
+ {
260
+ "key": "value"
261
+ }
262
+ ```
263
+ Si `false` :
264
+ ```json
265
+ {
266
+ "key": "value",
267
+ "content": {
268
+ "key": "value"
269
+ }
270
+ }
271
+ ```
272
+
273
+ - **saveComponents**:
274
+ - _Type_: `boolean`
275
+ - _Par défaut_: `false`
276
+ - _Description_: Indique si les composants doivent être sauvegardés après avoir été transformés.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-08-13
3
- updatedAt: 2026-02-25
3
+ updatedAt: 2026-03-11
4
4
  title: Configuration
5
5
  description: Apprenez à configurer Intlayer pour votre application. Comprenez les différents paramètres et options disponibles pour personnaliser Intlayer selon vos besoins.
6
6
  keywords:
@@ -14,18 +14,24 @@ slugs:
14
14
  - concept
15
15
  - configuration
16
16
  history:
17
+ - version: 8.3.0
18
+ data: 2026-03-11
19
+ changes: Déplacer 'baseDir' de la configuration 'content' vers la configuration 'system'
20
+ - version: 8.2.0
21
+ date: 2026-03-10
22
+ changes: Mise à jour des options du compilateur, ajout du support de FilePathPattern
17
23
  - version: 8.1.7
18
24
  date: 2026-02-25
19
25
  changes: Mise à jour des options du compilateur
20
26
  - version: 8.0.6
21
27
  date: 2026-02-12
22
- changes: Add support for Open Router, Alibaba, Amazon, Google Vertex Bedrock, Fireworks, Groq, Hugging Face, and Together.ai providers
28
+ changes: Ajout du support pour les fournisseurs Open Router, Alibaba, Amazon, Google Vertex Bedrock, Fireworks, Groq, Hugging Face et Together.ai
23
29
  - version: 8.0.5
24
30
  date: 2026-02-06
25
31
  changes: Ajout de `dataSerialization` à la configuration de l'IA
26
32
  - version: 8.0.0
27
33
  date: 2026-01-22
28
- changes: Move `importMode` build configuration to `dictionary` configuration.
34
+ changes: Déplacer la configuration de build pour importMode vers la configuration du dictionnaire.
29
35
  - version: 8.0.0
30
36
  date: 2026-01-18
31
37
  changes: Séparer la configuration système de la configuration du contenu. Déplacer les chemins internes vers la propriété `system`. Ajouter `codeDir` pour séparer les fichiers de contenu de la transformation du code.
@@ -422,12 +428,12 @@ const config: IntlayerConfig = {
422
428
  */
423
429
  compiler: {
424
430
  /**
425
- * Indicates if the compiler should be enabled.
431
+ * Réglez sur 'build-only' pour ignorer le compilateur pendant le développement et accélérer les temps de démarrage.
426
432
  */
427
433
  enabled: true,
428
434
 
429
435
  /**
430
- * Pattern to traverse the code to optimize.
436
+ * Modèle pour parcourir le code à optimiser.
431
437
  */
432
438
  transformPattern: [
433
439
  "**/*.{js,ts,mjs,cjs,jsx,tsx,vue,svelte}",
@@ -435,23 +441,28 @@ const config: IntlayerConfig = {
435
441
  ],
436
442
 
437
443
  /**
438
- * Pattern to exclude from the optimization.
444
+ * Modèle à exclure de l'optimisation.
439
445
  */
440
446
  excludePattern: ["**/node_modules/**"],
441
447
 
442
448
  /**
443
- * Output directory for the optimized dictionaries.
449
+ * Répertoire de sortie pour les dictionnaires optimisés.
444
450
  */
445
- outputDir: "compiler",
451
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
446
452
 
447
453
  /**
448
- * Dictionary key prefix
454
+ * Insérer uniquement le contenu dans le fichier généré, sans clé.
449
455
  */
450
- dictionaryKeyPrefix: "", // Remove base prefix
456
+ noMetadata: false,
451
457
 
452
458
  /**
453
- * Indicates if the components should be saved after being transformed.
454
- * That way, the compiler can be run only once to transform the app, and then it can be removed.
459
+ * Préfixe de clé de dictionnaire
460
+ */
461
+ dictionaryKeyPrefix: "", // Supprimer le préfixe de base
462
+
463
+ /**
464
+ * Indique si les composants doivent être sauvegardés après avoir été transformés.
465
+ * De cette façon, le compilateur peut être exécuté une seule fois pour transformer l'application, puis il peut être supprimé.
455
466
  */
456
467
  saveComponents: false,
457
468
  },
@@ -707,7 +718,7 @@ Paramètres liés à la gestion du contenu au sein de l'application, incluant le
707
718
  #### Propriétés
708
719
 
709
720
  - **autoFill** :
710
- - _Type_ : `boolean | string | { [key in Locales]?: string }`
721
+ - _Type_ : `boolean | string | FilePathPattern | { [key in Locales]?: string }`
711
722
  - _Défaut_ : `undefined`
712
723
  - _Description_ : Indique comment le contenu doit être automatiquement rempli à l'aide de l'IA. Peut être déclaré globalement dans le fichier `intlayer.config.ts`.
713
724
  - _Exemple_ : true
@@ -730,13 +741,6 @@ Paramètres liés à la gestion du contenu au sein de l'application, incluant le
730
741
  - _Exemple_ : `['.data.ts', '.data.js', '.data.json']`
731
742
  - _Note_ : Personnaliser les extensions de fichiers peut aider à éviter les conflits.
732
743
 
733
- - **baseDir** :
734
- - _Type_ : `string`
735
- - _Défaut_ : `process.cwd()`
736
- - _Description_ : Le répertoire de base pour le projet.
737
- - _Exemple_ : `'/path/to/project'`
738
- - _Note_ : Ceci est utilisé pour résoudre tous les répertoires liés à Intlayer.
739
-
740
744
  - **contentDir** :
741
745
  - _Type_ : `string[]`
742
746
  - _Défaut_ : `['.']`
@@ -775,6 +779,13 @@ Paramètres liés aux chemins internes et aux résultats de sortie d'Intlayer. C
775
779
 
776
780
  #### Propriétés
777
781
 
782
+ - **baseDir** :
783
+ - _Type_ : `string`
784
+ - _Défaut_ : `process.cwd()`
785
+ - _Description_ : Le répertoire de base pour le projet.
786
+ - _Exemple_ : `'/path/to/project'`
787
+ - _Note_ : Ceci est utilisé pour résoudre tous les répertoires liés à Intlayer.
788
+
778
789
  - **dictionariesDir** :
779
790
  - _Type_ : `string`
780
791
  - _Par défaut_ : `'.intlayer/dictionary'`
@@ -837,9 +848,9 @@ Pour plus d'informations sur les fichiers de déclaration de contenu et la faço
837
848
  - **importMode**:
838
849
  - _Note_: **Deprecated**: Use `dictionary.importMode` instead.
839
850
  - _Type_: `'static' | 'dynamic' | 'fetch'`
840
- - _Default_: `'static'`
851
+ - _Par défaut_: `'static'`
841
852
  - _Description_: Controls how dictionaries are imported.
842
- - _Example_: `'dynamic'`
853
+ - _Exemple_: `'dynamic'`
843
854
  - **priority**
844
855
  - **live**
845
856
  - **schema**
@@ -1061,7 +1072,35 @@ Paramètres qui contrôlent le compilateur Intlayer, qui extrait les dictionnair
1061
1072
  - _Description_ : Modèles qui définissent quels fichiers doivent être exclus lors de l'optimisation.
1062
1073
  - _Exemple_ : `['**/node_modules/**', '!**/node_modules/react/**']`
1063
1074
 
1064
- - **outputDir** :
1075
+ - **outputDir** (Deprecated) :
1065
1076
  - _Type_ : `string`
1066
1077
  - _Par défaut_ : `'compiler'`
1067
1078
  - _Description_ : Le répertoire où les dictionnaires extraits seront stockés, relatif au chemin de base de votre projet.
1079
+
1080
+ - **output**:
1081
+ - _Type_: `FilePathPattern`
1082
+ - _Par défaut_: `({ key }) => 'compiler/${key}.content.json'`
1083
+ - _Description_: Définit le chemin des fichiers de sortie. Remplace `outputDir`. Gère les variables dynamiques telles que `{{locale}}`, `{{key}}`, `{{fileName}}`, `{{extension}}`, `{{format}}`, `{{dirPath}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{componentFormat}}`. Peut être configuré sous forme de chaîne à l'aide du format `'my/{{var}}/path'` ou sous forme de fonction.
1084
+ - _Note_: `./**/*` Les chemins sont résolus par rapport au composant. `/**/*` les chemins sont résolus par rapport au `baseDir` d'Intlayer.
1085
+ - _Exemple_: `output: ({ locale, key }) => 'compiler/${locale}/${key}.json'`
1086
+
1087
+ - **noMetadata**:
1088
+ - _Type_: `boolean`
1089
+ - _Par défaut_: `false`
1090
+ - _Description_: Indique si les métadonnées doivent être enregistrées dans le fichier. Si vrai, le compilateur n'enregistrera pas les métadonnées des dictionnaires (clé, enveloppe de contenu).
1091
+ - _Note_: Utile si utilisé avec le plugin `loadJSON`.
1092
+ - _Exemple_: Si `true` :
1093
+ ```json
1094
+ {
1095
+ "key": "value"
1096
+ }
1097
+ ```
1098
+ Si `false` :
1099
+ ```json
1100
+ {
1101
+ "key": "value",
1102
+ "content": {
1103
+ "key": "value"
1104
+ }
1105
+ }
1106
+ ```
@@ -20,6 +20,9 @@ slugs:
20
20
  applicationTemplate: https://github.com/aymericzip/intlayer-next-no-lolale-path-template
21
21
  youtubeVideo: https://www.youtube.com/watch?v=e_PPG7PTqGU
22
22
  history:
23
+ - version: 8.2.0
24
+ date: 2026-03-09
25
+ changes: Update compiler options, add FilePathPattern support
23
26
  - version: 8.1.6
24
27
  date: 2026-02-23
25
28
  changes: Première version
@@ -135,7 +138,12 @@ const config: IntlayerConfig = {
135
138
  /**
136
139
  * Répertoire de sortie pour les dictionnaires optimisés.
137
140
  */
138
- outputDir: "compiler",
141
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
142
+
143
+ /**
144
+ * Insérer uniquement le contenu dans le fichier généré, sans clé.
145
+ */
146
+ noMetadata: false,
139
147
 
140
148
  /**
141
149
  * Préfixe de clé de dictionnaire
@@ -437,12 +437,33 @@ export const Route = createFileRoute("/{-$locale}/")({
437
437
  component: RouteComponent,
438
438
  head: ({ params }) => {
439
439
  const { locale } = params;
440
+ const path = "/"; // The path for this route
441
+
440
442
  const metaContent = getIntlayer("app", locale);
441
443
 
442
444
  return {
445
+ links: [
446
+ // Canonical link: Points to the current localized page
447
+ { rel: "canonical", href: getLocalizedUrl(path, locale) },
448
+
449
+ // Hreflang: Tell Google about all localized versions
450
+ ...localeMap(({ locale: mapLocale }) => ({
451
+ rel: "alternate",
452
+ hrefLang: mapLocale,
453
+ href: getLocalizedUrl(path, mapLocale),
454
+ })),
455
+
456
+ // x-default: For users in unmatched languages
457
+ // Define the default fallback locale (usually your primary language)
458
+ {
459
+ rel: "alternate",
460
+ hrefLang: "x-default",
461
+ href: getLocalizedUrl(path, defaultLocale),
462
+ },
463
+ ],
443
464
  meta: [
444
465
  { title: metaContent.title },
445
- { content: metaContent.meta.description, name: "description" },
466
+ { name: "description", content: metaContent.meta.description },
446
467
  ],
447
468
  };
448
469
  },
@@ -19,6 +19,9 @@ slugs:
19
19
  applicationTemplate: https://github.com/aymericzip/intlayer-vite-react-template
20
20
  youtubeVideo: https://www.youtube.com/watch?v=dS9L7uJeak4
21
21
  history:
22
+ - version: 8.2.0
23
+ date: 2026-03-09
24
+ changes: Update compiler options, add FilePathPattern support
22
25
  - version: 8.1.6
23
26
  date: 2026-02-23
24
27
  changes: Sortie initiale
@@ -132,7 +135,12 @@ const config: IntlayerConfig = {
132
135
  /**
133
136
  * Répertoire de sortie pour les dictionnaires optimisés.
134
137
  */
135
- outputDir: "compiler",
138
+ output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
139
+
140
+ /**
141
+ * Insérer uniquement le contenu dans le fichier généré, sans clé.
142
+ */
143
+ noMetadata: false,
136
144
 
137
145
  /**
138
146
  * Préfixe de clé de dictionnaire