@intlayer/docs 9.3.2 → 9.3.3

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 (115) hide show
  1. package/blog/ar/nextjs-multilingual-seo-comparison.md +10 -10
  2. package/blog/de/nextjs-multilingual-seo-comparison.md +9 -9
  3. package/blog/en/nextjs-multilingual-seo-comparison.md +10 -10
  4. package/blog/en-GB/nextjs-multilingual-seo-comparison.md +10 -10
  5. package/blog/es/nextjs-multilingual-seo-comparison.md +10 -10
  6. package/blog/fr/nextjs-multilingual-seo-comparison.md +10 -10
  7. package/blog/hi/nextjs-multilingual-seo-comparison.md +10 -10
  8. package/blog/id/nextjs-multilingual-seo-comparison.md +10 -10
  9. package/blog/it/nextjs-multilingual-seo-comparison.md +10 -10
  10. package/blog/ja/nextjs-multilingual-seo-comparison.md +9 -9
  11. package/blog/ko/nextjs-multilingual-seo-comparison.md +9 -9
  12. package/blog/pl/nextjs-multilingual-seo-comparison.md +10 -10
  13. package/blog/pt/nextjs-multilingual-seo-comparison.md +9 -9
  14. package/blog/ru/nextjs-multilingual-seo-comparison.md +9 -9
  15. package/blog/tr/nextjs-multilingual-seo-comparison.md +9 -9
  16. package/blog/uk/nextjs-multilingual-seo-comparison.md +10 -10
  17. package/blog/vi/nextjs-multilingual-seo-comparison.md +10 -10
  18. package/blog/zh/nextjs-multilingual-seo-comparison.md +10 -10
  19. package/docs/ar/bundle_optimization.md +1 -1
  20. package/docs/ar/configuration.md +32 -9
  21. package/docs/ar/dictionary/content_file.md +0 -22
  22. package/docs/ar/dictionary/function_fetching.md +23 -0
  23. package/docs/ar/eslint.md +9 -9
  24. package/docs/bn/configuration.md +34 -9
  25. package/docs/bn/eslint.md +9 -9
  26. package/docs/cs/bundle_optimization.md +1 -1
  27. package/docs/cs/configuration.md +33 -9
  28. package/docs/cs/eslint.md +9 -9
  29. package/docs/de/bundle_optimization.md +1 -1
  30. package/docs/de/configuration.md +34 -9
  31. package/docs/de/dictionary/content_file.md +0 -22
  32. package/docs/de/dictionary/function_fetching.md +23 -0
  33. package/docs/de/eslint.md +9 -9
  34. package/docs/en/bundle_optimization.md +1 -1
  35. package/docs/en/configuration.md +34 -9
  36. package/docs/en/dictionary/content_file.md +0 -22
  37. package/docs/en/dictionary/function_fetching.md +23 -0
  38. package/docs/en/eslint.md +9 -9
  39. package/docs/en/packages/intlayer/getLocalizedPath.md +70 -19
  40. package/docs/en-GB/configuration.md +33 -9
  41. package/docs/en-GB/dictionary/content_file.md +0 -22
  42. package/docs/en-GB/dictionary/function_fetching.md +23 -0
  43. package/docs/en-GB/eslint.md +9 -9
  44. package/docs/es/bundle_optimization.md +1 -1
  45. package/docs/es/configuration.md +35 -9
  46. package/docs/es/dictionary/content_file.md +0 -22
  47. package/docs/es/dictionary/function_fetching.md +23 -0
  48. package/docs/es/eslint.md +9 -9
  49. package/docs/fr/bundle_optimization.md +1 -1
  50. package/docs/fr/configuration.md +35 -9
  51. package/docs/fr/dictionary/content_file.md +0 -22
  52. package/docs/fr/dictionary/function_fetching.md +23 -0
  53. package/docs/fr/eslint.md +9 -9
  54. package/docs/hi/configuration.md +35 -9
  55. package/docs/hi/dictionary/content_file.md +0 -22
  56. package/docs/hi/dictionary/function_fetching.md +23 -0
  57. package/docs/hi/eslint.md +9 -9
  58. package/docs/id/configuration.md +35 -9
  59. package/docs/id/dictionary/content_file.md +0 -22
  60. package/docs/id/dictionary/function_fetching.md +23 -0
  61. package/docs/id/eslint.md +9 -9
  62. package/docs/it/bundle_optimization.md +1 -1
  63. package/docs/it/configuration.md +35 -9
  64. package/docs/it/dictionary/content_file.md +0 -22
  65. package/docs/it/dictionary/function_fetching.md +23 -0
  66. package/docs/it/eslint.md +9 -9
  67. package/docs/ja/configuration.md +30 -9
  68. package/docs/ja/dictionary/content_file.md +0 -22
  69. package/docs/ja/dictionary/function_fetching.md +23 -0
  70. package/docs/ja/eslint.md +9 -9
  71. package/docs/ko/configuration.md +31 -9
  72. package/docs/ko/dictionary/content_file.md +0 -22
  73. package/docs/ko/dictionary/function_fetching.md +23 -0
  74. package/docs/ko/eslint.md +9 -9
  75. package/docs/nl/configuration.md +33 -9
  76. package/docs/nl/eslint.md +9 -9
  77. package/docs/pl/bundle_optimization.md +1 -1
  78. package/docs/pl/configuration.md +34 -9
  79. package/docs/pl/dictionary/content_file.md +0 -22
  80. package/docs/pl/dictionary/function_fetching.md +23 -0
  81. package/docs/pl/eslint.md +9 -9
  82. package/docs/pt/bundle_optimization.md +1 -1
  83. package/docs/pt/configuration.md +34 -9
  84. package/docs/pt/dictionary/content_file.md +0 -22
  85. package/docs/pt/dictionary/function_fetching.md +23 -0
  86. package/docs/pt/eslint.md +9 -9
  87. package/docs/ru/bundle_optimization.md +1 -1
  88. package/docs/ru/configuration.md +34 -9
  89. package/docs/ru/dictionary/content_file.md +0 -22
  90. package/docs/ru/dictionary/function_fetching.md +23 -0
  91. package/docs/ru/eslint.md +9 -9
  92. package/docs/tr/bundle_optimization.md +1 -1
  93. package/docs/tr/configuration.md +33 -9
  94. package/docs/tr/dictionary/content_file.md +0 -22
  95. package/docs/tr/dictionary/function_fetching.md +23 -0
  96. package/docs/tr/eslint.md +9 -9
  97. package/docs/uk/configuration.md +35 -9
  98. package/docs/uk/dictionary/content_file.md +0 -22
  99. package/docs/uk/dictionary/function_fetching.md +23 -0
  100. package/docs/uk/eslint.md +9 -9
  101. package/docs/ur/configuration.md +35 -9
  102. package/docs/ur/eslint.md +9 -9
  103. package/docs/vi/bundle_optimization.md +1 -1
  104. package/docs/vi/configuration.md +33 -9
  105. package/docs/vi/dictionary/content_file.md +0 -22
  106. package/docs/vi/dictionary/function_fetching.md +23 -0
  107. package/docs/vi/eslint.md +9 -9
  108. package/docs/zh/bundle_optimization.md +1 -1
  109. package/docs/zh/configuration.md +29 -9
  110. package/docs/zh/dictionary/content_file.md +0 -22
  111. package/docs/zh/dictionary/function_fetching.md +23 -0
  112. package/docs/zh/eslint.md +9 -9
  113. package/docs/zh-TW/bundle_optimization.md +1 -1
  114. package/docs/zh-TW/eslint.md +9 -9
  115. package/package.json +5 -5
@@ -478,6 +478,30 @@ const config: IntlayerConfig = {
478
478
  */
479
479
  purge: true,
480
480
 
481
+ /**
482
+ * Regrouper les chunks de dictionnaire par locale selon la frontière de
483
+ * code-splitting qui les utilise, pour qu'une page chargée paresseusement
484
+ * récupère son contenu en une seule requête.
485
+ * Par défaut : true
486
+ *
487
+ * Note :
488
+ * - S'applique uniquement aux dictionnaires utilisant `importMode: 'dynamic'`.
489
+ */
490
+ chunkGrouping: true,
491
+
492
+ /**
493
+ * Charger un dictionnaire en même temps que le chunk qui l'utilise, au lieu de
494
+ * le récupérer une fois ce chunk rendu. Les lecteurs s'affichent de façon
495
+ * synchrone au lieu de suspendre, donc la navigation ne fait plus clignoter
496
+ * d'état de chargement.
497
+ * Par défaut : true
498
+ *
499
+ * Note :
500
+ * - Seule la locale résolue est attendue, la page ne télécharge donc que la
501
+ * langue qu'elle affiche.
502
+ */
503
+ dictionariesPreload: true,
504
+
481
505
  /**
482
506
  * Format de sortie pour les fichiers de dictionnaire générés.
483
507
  * Par défaut : ['cjs', 'esm']
@@ -1058,15 +1082,17 @@ Les options de build s'appliquent aux plugins `@intlayer/babel` et `@intlayer/sw
1058
1082
 
1059
1083
  > Lorsqu'il est optimisé, Intlayer remplacera les appels de dictionnaire pour optimiser le chunking, de sorte que le bundle final n'importe que les dictionnaires réellement utilisés.
1060
1084
 
1061
- | Champ | Description | Type | Par défaut | Exemple | Note |
1062
- | ----------------- | ----------------------------------------------------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1063
- | `mode` | Contrôle le mode du build. | `'auto'` &#124; <br/> `'manual'` | `'auto'` | `'manual'` | • `'auto'`: build activé automatiquement lors du build de l'application.<br/>• `'manual'`: ne s'exécute que lorsque la commande de build est exécutée.<br/>• Peut être utilisé pour désactiver les builds de dictionnaires (ex: pour éviter l'exécution dans des environnements Node.js). |
1064
- | `optimize` | Contrôle si le build doit être optimisé. | `boolean` | `undefined` | `process.env.NODE_ENV === 'production'` | • Si non défini, l'optimisation est déclenchée lors du build du framework (Vite/Next.js).<br/>• `true` force l'optimisation y compris en mode dev.<br/>• `false` la désactive.<br/>• Une fois activé, remplace les appels de dictionnaire pour optimiser le chunking.<br/>• Repose sur les plugins `@intlayer/babel` et `@intlayer/swc`. |
1065
- | `minify` | Minifier les dictionnaires pour réduire la taille du bundle. | `boolean` | `false` | | • Indique si le bundle doit être minifié.<br/>• Par défaut : `true` en production.<br/>• Cette option sera ignorée si `optimize` est désactivé.<br/>• Cette option sera ignorée si `editor.enabled` est vrai. |
1066
- | `purge` | Purger les clés inutilisées dans les dictionnaires. | `boolean` | `false` | | • Indique si le bundle doit être purgé.<br/>• Par défaut : `true` en production.<br/>• Cette option sera ignorée si `optimize` est désactivé. |
1067
- | `checkTypes` | Indique si le build doit vérifier les types TypeScript et loguer les erreurs. | `boolean` | `false` | | Peut ralentir le build. |
1068
- | `outputFormat` | Contrôle le format de sortie des dictionnaires. | `('esm' &#124; 'cjs')[]` | `['esm', 'cjs']` | `['cjs']` | |
1069
- | `traversePattern` | Motifs définissant quels fichiers parcourir lors de l'optimisation. | `string[]` | `['**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}', '!**/node_modules/**', '!**/dist/**', '!**/.intlayer/**', '!**/*.config.*', '!**/*.test.*', '!**/*.spec.*', '!**/*.stories.*']` | `['src/**/*.{ts,tsx}', '../ui-library/**/*.{ts,tsx}', '!**/node_modules/**']` | Limitez l'optimisation aux fichiers pertinents pour améliorer les performances de build.<br/>• Ignoré si `optimize` est désactivé.<br/>• Utilise des motifs glob. |
1085
+ | Champ | Description | Type | Par défaut | Exemple | Note |
1086
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1087
+ | `mode` | Contrôle le mode du build. | `'auto'` &#124; <br/> `'manual'` | `'auto'` | `'manual'` | • `'auto'`: build activé automatiquement lors du build de l'application.<br/>• `'manual'`: ne s'exécute que lorsque la commande de build est exécutée.<br/>• Peut être utilisé pour désactiver les builds de dictionnaires (ex: pour éviter l'exécution dans des environnements Node.js). |
1088
+ | `optimize` | Contrôle si le build doit être optimisé. | `boolean` | `undefined` | `process.env.NODE_ENV === 'production'` | • Si non défini, l'optimisation est déclenchée lors du build du framework (Vite/Next.js).<br/>• `true` force l'optimisation y compris en mode dev.<br/>• `false` la désactive.<br/>• Une fois activé, remplace les appels de dictionnaire pour optimiser le chunking.<br/>• Repose sur les plugins `@intlayer/babel` et `@intlayer/swc`. |
1089
+ | `minify` | Minifier les dictionnaires pour réduire la taille du bundle. | `boolean` | `false` | | • Indique si le bundle doit être minifié.<br/>• Par défaut : `true` en production.<br/>• Cette option sera ignorée si `optimize` est désactivé.<br/>• Cette option sera ignorée si `editor.enabled` est vrai. |
1090
+ | `purge` | Purger les clés inutilisées dans les dictionnaires. | `boolean` | `false` | | • Indique si le bundle doit être purgé.<br/>• Par défaut : `true` en production.<br/>• Cette option sera ignorée si `optimize` est désactivé. |
1091
+ | `checkTypes` | Indique si le build doit vérifier les types TypeScript et loguer les erreurs. | `boolean` | `false` | | Peut ralentir le build. |
1092
+ | `chunkGrouping` | Indique s'il faut regrouper les chunks de dictionnaire par locale selon la frontière de code-splitting qui les utilise. | `boolean` | `true` | | • Sans regroupement, une page composée de nombreux composants émet une requête par dictionnaire.<br/>• Les dictionnaires atteints depuis plusieurs frontières sont placés dans un chunk partagé, aucune page n'embarque donc le contenu d'une autre.<br/>• S'applique uniquement aux dictionnaires utilisant `importMode: 'dynamic'`.<br/>• S'applique uniquement au build client, et uniquement lors du bundling (pas en dev). |
1093
+ | `dictionariesPreload` | Indique si un dictionnaire doit être chargé avec le chunk qui l'utilise, au lieu d'être récupéré une fois ce chunk rendu. | `boolean` | `true` | | Le point d'entrée généré attend la locale de navigation au niveau racine, une route chargée paresseusement n'est donc pas considérée comme chargée tant que son contenu n'est pas là.<br/>• Les lecteurs s'affichent de façon synchrone au lieu de suspendre, la navigation ne fait donc plus clignoter d'état de chargement.<br/>• Seule la locale résolue est attendue, la page ne télécharge donc que la langue qu'elle affiche.<br/>• S'applique uniquement aux dictionnaires utilisant `importMode: 'dynamic'`, sur le build client.<br/>• Nécessite un bundler supportant le top-level await (Vite, esbuild). |
1094
+ | `outputFormat` | Contrôle le format de sortie des dictionnaires. | `('esm' &#124; 'cjs')[]` | `['esm', 'cjs']` | `['cjs']` | |
1095
+ | `traversePattern` | Motifs définissant quels fichiers parcourir lors de l'optimisation. | `string[]` | `['**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}', '!**/node_modules/**', '!**/dist/**', '!**/.intlayer/**', '!**/*.config.*', '!**/*.test.*', '!**/*.spec.*', '!**/*.stories.*']` | `['src/**/*.{ts,tsx}', '../ui-library/**/*.{ts,tsx}', '!**/node_modules/**']` | • Limitez l'optimisation aux fichiers pertinents pour améliorer les performances de build.<br/>• Ignoré si `optimize` est désactivé.<br/>• Utilise des motifs glob. |
1070
1096
 
1071
1097
  ---
1072
1098
 
@@ -532,28 +532,6 @@ Utilisé en conjonction avec les Variantes, ce champ définit des alternatives d
532
532
 
533
533
  > Voir [Variantes](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/dynamic_dictionaries/variants.md) pour plus d'informations.
534
534
 
535
- #### `meta` (`Record<string, string | number | boolean>`)
536
-
537
- Utilisé en conjonction avec les Enregistrements Dynamiques, ce champ permet de déclarer des enregistrements gérés par le CMS ou des données arbitraires récupérées à l'exécution par un identifiant opaque. L'identité du dictionnaire est définie par l'ensemble arbitraire de paires clé-valeur déclarées dans ce champ `meta`.
538
-
539
- **Exemple :**
540
-
541
- ```typescript
542
- {
543
- key: "product-copy",
544
- meta: {
545
- id: "prod_abc",
546
- userId: "user_123"
547
- },
548
- content: {
549
- name: "Widget Pro",
550
- description: "The best widget."
551
- }
552
- }
553
- ```
554
-
555
- > Voir [Enregistrements Dynamiques](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/dynamic_dictionaries/dynamic_content.md) pour plus d'informations.
556
-
557
535
  ### Propriétés CMS
558
536
 
559
537
  ##### `version` (string)
@@ -89,6 +89,29 @@ Impossible de récupérer du contenu depuis un fichier JSON, utilisez plutôt un
89
89
 
90
90
  Dans ce cas, la fonction `fakeFetch` imite un délai pour simuler le temps de réponse du serveur. Intlayer exécute la fonction asynchrone et utilise le résultat comme contenu pour la clé `text`.
91
91
 
92
+ ## Récupération de contenu distant
93
+
94
+ Vous pouvez également assigner directement une promesse à un champ de contenu. Intlayer l'attend lors de la construction des dictionnaires et y insère la valeur résolue :
95
+
96
+ ```typescript fileName="**/*.content.ts" contentDeclarationFormat={["typescript", "esm", "commonjs"]}
97
+ import type { Dictionary } from "intlayer";
98
+
99
+ const remoteContent = {
100
+ key: "remote_content",
101
+ content: {
102
+ externalContent: fetch("https://example.com").then((res) => res.json()),
103
+ },
104
+ } satisfies Dictionary;
105
+
106
+ export default remoteContent;
107
+ ```
108
+
109
+ ```plaintext fileName="**/*.content.json" contentDeclarationFormat="json"
110
+ Impossible de récupérer du contenu depuis un fichier JSON, utilisez plutôt un fichier .ts ou .js
111
+ ```
112
+
113
+ > La requête est exécutée au moment du build, les données récupérées sont donc un instantané intégré au dictionnaire. Reconstruisez vos dictionnaires pour les actualiser.
114
+
92
115
  ## Utilisation de contenu basé sur une fonction dans les composants React
93
116
 
94
117
  Pour utiliser un contenu basé sur une fonction dans un composant React, vous devez importer `useIntlayer` depuis `react-intlayer` et l'appeler avec l'ID du contenu pour récupérer ce contenu. Voici un exemple :
package/docs/fr/eslint.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2026-08-12
3
- updatedAt: 2026-08-12
3
+ updatedAt: 2026-08-13
4
4
  title: Plugin ESLint | Règles de lint pour Intlayer
5
5
  description: Détectez les chaînes codées en dur, les appels dynamiques que le compilateur Intlayer ne peut pas optimiser et le contenu de dictionnaire inutilisé, avec eslint-plugin-intlayer. Compatible ESLint et oxlint, sur React, Vue, Svelte, Angular et Astro.
6
6
  keywords:
@@ -52,7 +52,7 @@ pnpm add --save-dev eslint-plugin-intlayer
52
52
  yarn add --dev eslint-plugin-intlayer
53
53
  ```
54
54
 
55
- Nécessite ESLint 9 ou une version ultérieure (flat config).
55
+ Nécessite ESLint 9 ou une version ultérieure (flat config). ESLint 10 est pris en charge.
56
56
 
57
57
  ## Utilisation
58
58
 
@@ -61,20 +61,20 @@ Le plugin fonctionne à la fois avec ESLint et [oxlint](https://oxc.rs) — mêm
61
61
  <Tabs defaultTab="eslint">
62
62
  <Tab label="ESLint" value="eslint">
63
63
 
64
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
64
+ ```javascript fileName="eslint.config.mjs"
65
65
  import intlayer from "eslint-plugin-intlayer";
66
66
 
67
67
  export default [...intlayer.configs.recommended];
68
68
  ```
69
69
 
70
- Ou activez les règles une par une :
70
+ Ou étalez une config et définissez vous-même les niveaux de sévérité :
71
71
 
72
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
72
+ ```javascript fileName="eslint.config.mjs"
73
73
  import intlayer from "eslint-plugin-intlayer";
74
74
 
75
75
  export default [
76
+ ...intlayer.configs.recommended,
76
77
  {
77
- plugins: { intlayer },
78
78
  rules: {
79
79
  "intlayer/no-raw-text": "warn",
80
80
  "intlayer/static-dictionary-key": "error",
@@ -144,7 +144,7 @@ Pour corriger tout un fichier d'un coup, lancez `npx intlayer extract` et laisse
144
144
 
145
145
  **Options**
146
146
 
147
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
147
+ ```javascript fileName="eslint.config.mjs"
148
148
  {
149
149
  "intlayer/no-raw-text": [
150
150
  "warn",
@@ -247,7 +247,7 @@ Contrairement aux autres règles, celle-ci ne peut pas répondre uniquement à p
247
247
 
248
248
  **Options**
249
249
 
250
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
250
+ ```javascript fileName="eslint.config.mjs"
251
251
  {
252
252
  "intlayer/no-unused-content": [
253
253
  "warn",
@@ -296,7 +296,7 @@ Toutes les règles fonctionnent sur l'ensemble des intégrations Intlayer, y com
296
296
  | Templates Angular | `.component.html` | `@angular-eslint/template-parser` |
297
297
  | Astro | `.astro` | `astro-eslint-parser` |
298
298
 
299
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
299
+ ```javascript fileName="eslint.config.mjs"
300
300
  import intlayer from "eslint-plugin-intlayer";
301
301
  import tseslint from "typescript-eslint";
302
302
  import vueParser from "vue-eslint-parser";
@@ -471,6 +471,30 @@ const config: IntlayerConfig = {
471
471
  */
472
472
  prune: true,
473
473
 
474
+ /**
475
+ * प्रति-लोकेल डिक्शनरी चंक्स को उस कोड-स्प्लिट सीमा के अनुसार समूहित करें जो
476
+ * उनका उपयोग करती है, ताकि आलसी रूप से लोड होने वाला पेज अपनी सामग्री एक ही
477
+ * अनुरोध में प्राप्त करे।
478
+ * डिफ़ॉल्ट: true
479
+ *
480
+ * नोट:
481
+ * - केवल `importMode: 'dynamic'` का उपयोग करने वाली डिक्शनरियों पर लागू होता
482
+ * है।
483
+ */
484
+ chunkGrouping: true,
485
+
486
+ /**
487
+ * डिक्शनरी को उस चंक के साथ लोड करें जो उसका उपयोग करता है, बजाय उस चंक के
488
+ * रेंडर होने के बाद उसे प्राप्त करने के। पठन सस्पेंड होने के बजाय समकालिक रूप
489
+ * से रेंडर होते हैं, इसलिए नेविगेशन में अब लोडिंग स्थिति नहीं झलकती।
490
+ * डिफ़ॉल्ट: true
491
+ *
492
+ * नोट:
493
+ * - केवल हल की गई लोकेल की प्रतीक्षा की जाती है, इसलिए पेज केवल वही भाषा
494
+ * डाउनलोड करता है जो वह दिखाता है।
495
+ */
496
+ dictionariesPreload: true,
497
+
474
498
  /**
475
499
  * जेनरेट की गई डिक्शनरी फ़ाइलों के लिए आउटपुट स्वरूप।
476
500
  * डिफ़ॉल्ट: ['cjs', 'esm']
@@ -1047,15 +1071,17 @@ Intlayer आपके एप्लिकेशन के अंतर्रा
1047
1071
 
1048
1072
  > ऑप्टिमाइज़ेशन के दौरान, Intlayer कोड स्प्लिटिंग (chunking) को ऑप्टिमाइज़ करने के लिए डिक्शनरी कॉल को बदल देगा ताकि परिणामी बंडल केवल उन्हीं डिक्शनरी को आयात करे जो वास्तव में उपयोग की जाती हैं।
1049
1073
 
1050
- | फ़ील्ड | विवरण | टाइप | डिफ़ॉल्ट | उदाहरण | टिप्पणी |
1051
- | ----------------- | ------------------------------------------------------------------------------------------------------ | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1052
- | `mode` | बिल्ड मोड को नियंत्रित करता है। | `'auto'` &#124; <br/> `'manual'` | `'auto'` | `'manual'` | • `'auto'`: एप्लिकेशन बिल्ड के दौरान बिल्ड स्वचालित रूप से शुरू होता है।<br/>• `'manual'`: केवल एक स्पष्ट बिल्ड कमांड पर निष्पादित होता है।<br/>• डिक्शनरी बिल्ड को बंद करने के लिए उपयोग किया जा सकता है (जैसे Node.js परिवेशों में चलने से बचने के लिए)। |
1053
- | `optimize` | नियंत्रित करता है कि बिल्ड ऑप्टिमाइज़ेशन होना चाहिए या नहीं। | `boolean` | `undefined` | `process.env.NODE_ENV === 'production'` | • यदि परिभाषित नहीं है, तो फ्रेमवर्क बिल्ड (Vite/Next.js) के दौरान ऑप्टिमाइज़ेशन शुरू होता है।<br/>• `true` देव मोड में भी ऑप्टिमाइज़ेशन को बाध्य करता है।<br/>• `false` इसे बंद कर देता है।<br/>• चालू होने पर, चंकिंग ऑप्टिमाइज़ेशन के लिए डिक्शनरी कॉल को बदल देता है।<br/>• `@intlayer/babel` और `@intlayer/swc` प्लगइन्स की आवश्यकता होती है। |
1054
- | `minify` | इंगित करता है कि बंडल के आकार को कम करने के लिए डिक्शनरी को मिनिअफ़ाइ किया जाना चाहिए या नहीं। | `boolean` | `false` | | • बंडल को मिनिअफ़ाइ किया जाना चाहिए या नहीं।<br/>• डिफ़ॉल्ट: प्रोडक्शन में `true`।<br/>• `optimize` अक्षम होने पर यह विकल्प अनदेखा किया जाएगा।<br/>• `editor.enabled` सत्य होने पर यह विकल्प अनदेखा किया जाएगा। |
1055
- | `prune` | इंगित करता है कि डिक्शनरी में अप्रयुक्त कीज़ (unused keys) को हटाया जाना चाहिए या नहीं। | `boolean` | `true` | | • बंडल को छोटा (pruned) किया जाना चाहिए या नहीं।<br/>• डिफ़ॉल्ट: प्रोडक्शन में `true`।<br/>• `optimize` अक्षम होने पर यह विकल्प अनदेखा किया जाएगा। |
1056
- | `checkTypes` | इंगित करता है कि बिल्ड को TypeScript टाइप्स की जाँच करनी चाहिए और त्रुटियों को लॉग करना चाहिए या नहीं। | `boolean` | `false` | | बिल्ड प्रक्रिया को धीमा कर सकता है। |
1057
- | `outputFormat` | डिक्शनरी के आउटपुट स्वरूप को नियंत्रित करता है। | `('esm' &#124; 'cjs')[]` | `['esm', 'cjs']` | `['cjs']` | |
1058
- | `traversePattern` | उन फ़ाइलों को परिभाषित करने वाले पैटर्न जिन्हें ऑप्टिमाइज़ेशन के दौरान स्कैन किया जाना चाहिए। | `string[]` | `['**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}', '!**/node_modules/**', '!**/dist/**', '!**/.intlayer/**', '!**/*.config.*', '!**/*.test.*', '!**/*.spec.*', '!**/*.stories.*']` | `['src/**/*.{ts,tsx}', '../ui-library/**/*.{ts,tsx}', '!**/node_modules/**']` | बिल्ड प्रदर्शन बढ़ाने के लिए ऑप्टिमाइज़ेशन को प्रासंगिक फ़ाइलों तक सीमित करें।<br/>• यदि `optimize` बंद होता, तो अनदेखा कर दिया जाता।<br/>• ग्लोब पैटर्न का उपयोग करता है। |
1074
+ | फ़ील्ड | विवरण | टाइप | डिफ़ॉल्ट | उदाहरण | टिप्पणी |
1075
+ | --------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1076
+ | `mode` | बिल्ड मोड को नियंत्रित करता है। | `'auto'` &#124; <br/> `'manual'` | `'auto'` | `'manual'` | • `'auto'`: एप्लिकेशन बिल्ड के दौरान बिल्ड स्वचालित रूप से शुरू होता है।<br/>• `'manual'`: केवल एक स्पष्ट बिल्ड कमांड पर निष्पादित होता है।<br/>• डिक्शनरी बिल्ड को बंद करने के लिए उपयोग किया जा सकता है (जैसे Node.js परिवेशों में चलने से बचने के लिए)। |
1077
+ | `optimize` | नियंत्रित करता है कि बिल्ड ऑप्टिमाइज़ेशन होना चाहिए या नहीं। | `boolean` | `undefined` | `process.env.NODE_ENV === 'production'` | • यदि परिभाषित नहीं है, तो फ्रेमवर्क बिल्ड (Vite/Next.js) के दौरान ऑप्टिमाइज़ेशन शुरू होता है।<br/>• `true` देव मोड में भी ऑप्टिमाइज़ेशन को बाध्य करता है।<br/>• `false` इसे बंद कर देता है।<br/>• चालू होने पर, चंकिंग ऑप्टिमाइज़ेशन के लिए डिक्शनरी कॉल को बदल देता है।<br/>• `@intlayer/babel` और `@intlayer/swc` प्लगइन्स की आवश्यकता होती है। |
1078
+ | `minify` | इंगित करता है कि बंडल के आकार को कम करने के लिए डिक्शनरी को मिनिअफ़ाइ किया जाना चाहिए या नहीं। | `boolean` | `false` | | • बंडल को मिनिअफ़ाइ किया जाना चाहिए या नहीं।<br/>• डिफ़ॉल्ट: प्रोडक्शन में `true`।<br/>• `optimize` अक्षम होने पर यह विकल्प अनदेखा किया जाएगा।<br/>• `editor.enabled` सत्य होने पर यह विकल्प अनदेखा किया जाएगा। |
1079
+ | `prune` | इंगित करता है कि डिक्शनरी में अप्रयुक्त कीज़ (unused keys) को हटाया जाना चाहिए या नहीं। | `boolean` | `true` | | • बंडल को छोटा (pruned) किया जाना चाहिए या नहीं।<br/>• डिफ़ॉल्ट: प्रोडक्शन में `true`।<br/>• `optimize` अक्षम होने पर यह विकल्प अनदेखा किया जाएगा। |
1080
+ | `checkTypes` | इंगित करता है कि बिल्ड को TypeScript टाइप्स की जाँच करनी चाहिए और त्रुटियों को लॉग करना चाहिए या नहीं। | `boolean` | `false` | | बिल्ड प्रक्रिया को धीमा कर सकता है। |
1081
+ | `chunkGrouping` | क्या प्रति-लोकेल डिक्शनरी चंक्स को उस कोड-स्प्लिट सीमा के अनुसार समूहित किया जाए जो उनका उपयोग करती है। | `boolean` | `true` | | • समूहीकरण के बिना, कई घटकों से बना पेज प्रत्येक डिक्शनरी के लिए एक अनुरोध भेजता है।<br/>• कई सीमाओं से पहुँची जाने वाली डिक्शनरियाँ साझा चंक में चली जाती हैं, इसलिए कोई पेज दूसरे पेज की सामग्री नहीं भेजता।<br/>• केवल `importMode: 'dynamic'` का उपयोग करने वाली डिक्शनरियों पर लागू होता है।<br/>• केवल क्लाइंट बिल्ड पर, और केवल बंडलिंग के समय लागू होता है (dev में नहीं)। |
1082
+ | `dictionariesPreload` | क्या डिक्शनरी को उस चंक के साथ लोड किया जाए जो उसका उपयोग करता है, बजाय उस चंक के रेंडर होने के बाद प्राप्त करने के। | `boolean` | `true` | | उत्पन्न एंट्री पॉइंट शीर्ष स्तर पर ब्राउज़िंग लोकेल की प्रतीक्षा करता है, इसलिए आलसी रूप से लोड होने वाला रूट तब तक लोड नहीं माना जाता जब तक उसकी सामग्री उपलब्ध न हो।<br/>• पठन सस्पेंड होने के बजाय समकालिक रूप से रेंडर होते हैं, इसलिए नेविगेशन में अब लोडिंग स्थिति नहीं झलकती।<br/>• केवल हल की गई लोकेल की प्रतीक्षा की जाती है, इसलिए पेज केवल वही भाषा डाउनलोड करता है जो वह दिखाता है।<br/>• केवल क्लाइंट बिल्ड में `importMode: 'dynamic'` का उपयोग करने वाली डिक्शनरियों पर लागू होता है।<br/>• टॉप-लेवल await समर्थित बंडलर आवश्यक है (Vite, esbuild)। |
1083
+ | `outputFormat` | डिक्शनरी के आउटपुट स्वरूप को नियंत्रित करता है। | `('esm' &#124; 'cjs')[]` | `['esm', 'cjs']` | `['cjs']` | |
1084
+ | `traversePattern` | उन फ़ाइलों को परिभाषित करने वाले पैटर्न जिन्हें ऑप्टिमाइज़ेशन के दौरान स्कैन किया जाना चाहिए। | `string[]` | `['**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}', '!**/node_modules/**', '!**/dist/**', '!**/.intlayer/**', '!**/*.config.*', '!**/*.test.*', '!**/*.spec.*', '!**/*.stories.*']` | `['src/**/*.{ts,tsx}', '../ui-library/**/*.{ts,tsx}', '!**/node_modules/**']` | • बिल्ड प्रदर्शन बढ़ाने के लिए ऑप्टिमाइज़ेशन को प्रासंगिक फ़ाइलों तक सीमित करें।<br/>• यदि `optimize` बंद होता, तो अनदेखा कर दिया जाता।<br/>• ग्लोब पैटर्न का उपयोग करता है। |
1059
1085
 
1060
1086
  ---
1061
1087
 
@@ -534,28 +534,6 @@ Variants के संयोजन में उपयोग किया जा
534
534
 
535
535
  > अधिक जानकारी के लिए [Variants](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/dynamic_dictionaries/variants.md) देखें।
536
536
 
537
- #### `meta` (`Record<string, string | number | boolean>`)
538
-
539
- Dynamic Records के संयोजन में उपयोग किया जाने वाला, यह फ़ील्ड एक अपारदर्शी आईडी द्वारा रनटाइम पर CMS-प्रबंधित रिकॉर्ड या मनमाने डेटा की घोषणा करने की अनुमति देता है। शब्दकोश की पहचान इस `meta` फ़ील्ड में घोषित कुंजी-मान जोड़े के मनमाने सेट द्वारा परिभाषित होती है।
540
-
541
- **उदाहरण:**
542
-
543
- ```typescript
544
- {
545
- key: "product-copy",
546
- meta: {
547
- id: "prod_abc",
548
- userId: "user_123"
549
- },
550
- content: {
551
- name: "Widget Pro",
552
- description: "The best widget."
553
- }
554
- }
555
- ```
556
-
557
- > अधिक जानकारी के लिए [Dynamic Records](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/dynamic_dictionaries/dynamic_content.md) देखें।
558
-
559
537
  ### CMS गुण
560
538
 
561
539
  ##### `version` (स्ट्रिंग)
@@ -89,6 +89,29 @@ JSON फ़ाइल से सामग्री प्राप्त कर
89
89
 
90
90
  इस मामले में, `fakeFetch` फ़ंक्शन सर्वर प्रतिक्रिया समय का अनुकरण करने के लिए एक विलंब का अनुकरण करता है। Intlayer असिंक्रोनस फ़ंक्शन को निष्पादित करता है और परिणाम को `text` कुंजी के लिए सामग्री के रूप में उपयोग करता है।
91
91
 
92
+ ## रिमोट सामग्री प्राप्त करना
93
+
94
+ आप किसी सामग्री फ़ील्ड को सीधे एक प्रॉमिस भी सौंप सकते हैं। Intlayer डिक्शनरी बनाते समय उसका इंतज़ार करता है और हल हुए मान को उसमें शामिल कर देता है:
95
+
96
+ ```typescript fileName="**/*.content.ts" contentDeclarationFormat={["typescript", "esm", "commonjs"]}
97
+ import type { Dictionary } from "intlayer";
98
+
99
+ const remoteContent = {
100
+ key: "remote_content",
101
+ content: {
102
+ externalContent: fetch("https://example.com").then((res) => res.json()),
103
+ },
104
+ } satisfies Dictionary;
105
+
106
+ export default remoteContent;
107
+ ```
108
+
109
+ ```plaintext fileName="**/*.content.json" contentDeclarationFormat="json"
110
+ JSON फ़ाइल से सामग्री प्राप्त करने का कोई तरीका नहीं है, इसके बजाय .ts या .js फ़ाइल का उपयोग करें
111
+ ```
112
+
113
+ > अनुरोध बिल्ड समय पर चलता है, इसलिए प्राप्त डेटा डिक्शनरी में एम्बेड किया गया एक स्नैपशॉट होता है। इसे ताज़ा करने के लिए अपनी डिक्शनरी दोबारा बनाएं।
114
+
92
115
  ## React घटकों में फ़ंक्शन-आधारित सामग्री का उपयोग करना
93
116
 
94
117
  React घटक में फ़ंक्शन-आधारित सामग्री का उपयोग करने के लिए, आपको `react-intlayer` से `useIntlayer` आयात करना होगा और सामग्री प्राप्त करने के लिए इसे सामग्री आईडी के साथ कॉल करना होगा। यहाँ एक उदाहरण है:
package/docs/hi/eslint.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2026-08-12
3
- updatedAt: 2026-08-12
3
+ updatedAt: 2026-08-13
4
4
  title: ESLint प्लगइन | Intlayer के लिए लिंट नियम
5
5
  description: eslint-plugin-intlayer के साथ हार्डकोडेड स्ट्रिंग्स, ऐसे डायनामिक कॉल्स जिन्हें Intlayer कंपाइलर ऑप्टिमाइज़ नहीं कर सकता, और अप्रयुक्त शब्दकोश सामग्री का पता लगाएं। React, Vue, Svelte, Angular और Astro में ESLint और oxlint के साथ काम करता है।
6
6
  keywords:
@@ -52,7 +52,7 @@ pnpm add --save-dev eslint-plugin-intlayer
52
52
  yarn add --dev eslint-plugin-intlayer
53
53
  ```
54
54
 
55
- ESLint 9 या बाद के संस्करण (flat config) की आवश्यकता है।
55
+ ESLint 9 या बाद के संस्करण (flat config) की आवश्यकता है। ESLint 10 समर्थित है।
56
56
 
57
57
  ## उपयोग
58
58
 
@@ -61,20 +61,20 @@ ESLint 9 या बाद के संस्करण (flat config) की आ
61
61
  <Tabs defaultTab="eslint">
62
62
  <Tab label="ESLint" value="eslint">
63
63
 
64
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
64
+ ```javascript fileName="eslint.config.mjs"
65
65
  import intlayer from "eslint-plugin-intlayer";
66
66
 
67
67
  export default [...intlayer.configs.recommended];
68
68
  ```
69
69
 
70
- या नियमों को एक-एक करके सक्षम करें:
70
+ या किसी कॉन्फ़िग को फैलाएँ और गंभीरता स्वयं तय करें:
71
71
 
72
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
72
+ ```javascript fileName="eslint.config.mjs"
73
73
  import intlayer from "eslint-plugin-intlayer";
74
74
 
75
75
  export default [
76
+ ...intlayer.configs.recommended,
76
77
  {
77
- plugins: { intlayer },
78
78
  rules: {
79
79
  "intlayer/no-raw-text": "warn",
80
80
  "intlayer/static-dictionary-key": "error",
@@ -144,7 +144,7 @@ const { title } = useIntlayer("home");
144
144
 
145
145
  **विकल्प**
146
146
 
147
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
147
+ ```javascript fileName="eslint.config.mjs"
148
148
  {
149
149
  "intlayer/no-raw-text": [
150
150
  "warn",
@@ -247,7 +247,7 @@ export default {
247
247
 
248
248
  **विकल्प**
249
249
 
250
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
250
+ ```javascript fileName="eslint.config.mjs"
251
251
  {
252
252
  "intlayer/no-unused-content": [
253
253
  "warn",
@@ -296,7 +296,7 @@ export default {
296
296
  | Angular टेम्प्लेट्स | `.component.html` | `@angular-eslint/template-parser` |
297
297
  | Astro | `.astro` | `astro-eslint-parser` |
298
298
 
299
- ```javascript fileName="eslint.config.mjs" codeFormat="esm"
299
+ ```javascript fileName="eslint.config.mjs"
300
300
  import intlayer from "eslint-plugin-intlayer";
301
301
  import tseslint from "typescript-eslint";
302
302
  import vueParser from "vue-eslint-parser";
@@ -478,6 +478,30 @@ const config: IntlayerConfig = {
478
478
  */
479
479
  purge: true,
480
480
 
481
+ /**
482
+ * Kelompokkan potongan kamus per lokal berdasarkan batas pemisahan kode yang
483
+ * menggunakannya, sehingga halaman yang dimuat secara lazy mengambil kontennya
484
+ * dalam satu permintaan.
485
+ * Default: true
486
+ *
487
+ * Catatan:
488
+ * - Hanya berlaku untuk kamus yang menggunakan `importMode: 'dynamic'`.
489
+ */
490
+ chunkGrouping: true,
491
+
492
+ /**
493
+ * Muat kamus bersama potongan yang menggunakannya, alih-alih mengambilnya
494
+ * setelah potongan tersebut dirender. Pembacaan dirender secara sinkron
495
+ * alih-alih ditangguhkan, sehingga navigasi tidak lagi menampilkan kedipan
496
+ * status pemuatan.
497
+ * Default: true
498
+ *
499
+ * Catatan:
500
+ * - Hanya lokal yang telah ditentukan yang ditunggu, sehingga halaman hanya
501
+ * mengunduh bahasa yang ditampilkannya.
502
+ */
503
+ dictionariesPreload: true,
504
+
481
505
  /**
482
506
  * Format output untuk file kamus yang dihasilkan.
483
507
  * Default: ['cjs', 'esm']
@@ -1054,15 +1078,17 @@ Pengaturan build berlaku untuk plugin `@intlayer/babel` dan `@intlayer/swc`.
1054
1078
 
1055
1079
  > Selama optimasi, Intlayer mengganti panggilan kamus dengan optimasi pemisahan kode (chunking) sehingga bundel akhir hanya mengimpor kamus yang benar-benar digunakan.
1056
1080
 
1057
- | Bidang | Deskripsi | Tipe | Default | Contoh | Catatan |
1058
- | ----------------- | ---------------------------------------------------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1059
- | `mode` | Mengontrol mode eksekusi build. | `'auto'` &#124; <br/> `'manual'` | `'auto'` | `'manual'` | • `'auto'`: Build dipicu secara otomatis selama build aplikasi.<br/>• `'manual'`: Hanya dijalankan melalui perintah build eksplisit.<br/>• Dapat berguna untuk mencegah build kamus (misalnya: untuk menghindari eksekusi di lingkungan Node.js). |
1060
- | `optimize` | Mengontrol apakah optimasi build dilakukan. | `boolean` | `undefined` | `process.env.NODE_ENV === 'production'` | • Jika tidak ditentukan, ini akan dipicu selama build framework (Vite/Next.js).<br/>• `true` memaksakan optimasi bahkan dalam mode pengembangan.<br/>• `false` menonaktifkannya.<br/>• Jika diaktifkan, mengganti panggilan kamus dengan optimasi chunking.<br/>• Memerlukan plugin `@intlayer/babel` dan `@intlayer/swc`. |
1061
- | `minify` | Minifikasikan kamus untuk mengurangi ukuran bundle. | `boolean` | `false` | | • Apakah bundel harus diminifikasi.<br/>• Default: `false` dalam produksi.<br/>• Opsi ini akan diabaikan jika `optimize` dinonaktifkan.<br/>• Opsi ini akan diabaikan jika `editor.enabled` adalah true. |
1062
- | `purge` | Bersihkan kunci yang tidak digunakan dalam kamus. | `boolean` | `false` | | • Apakah bundel harus dibersihkan.<br/>• Default: `false` dalam produksi.<br/>• Opsi ini akan diabaikan jika `optimize` dinonaktifkan. |
1063
- | `checkTypes` | Menunjukkan apakah build harus memeriksa tipe TypeScript dan mencatat error. | `boolean` | `false` | | Dapat memperlambat performa build. |
1064
- | `outputFormat` | Mengontrol format output kamus. | `('esm' &#124; 'cjs')[]` | `['esm', 'cjs']` | `['cjs']` | |
1065
- | `traversePattern` | Pola untuk file yang akan dipindai selama optimasi. | `string[]` | `['**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}', '!**/node_modules/**', '!**/dist/**', '!**/.intlayer/**', '!**/*.config.*', '!**/*.test.*', '!**/*.spec.*', '!**/*.stories.*']` | `['src/**/*.{ts,tsx}', '../ui-library/**/*.{ts,tsx}', '!**/node_modules/**']` | Meningkatkan performa build dengan membatasi optimasi ke file yang relevan.<br/>• Diabaikan jika `optimize` dinonaktifkan.<br/>• Menggunakan pola glob. |
1081
+ | Bidang | Deskripsi | Tipe | Default | Contoh | Catatan |
1082
+ | --------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1083
+ | `mode` | Mengontrol mode eksekusi build. | `'auto'` &#124; <br/> `'manual'` | `'auto'` | `'manual'` | • `'auto'`: Build dipicu secara otomatis selama build aplikasi.<br/>• `'manual'`: Hanya dijalankan melalui perintah build eksplisit.<br/>• Dapat berguna untuk mencegah build kamus (misalnya: untuk menghindari eksekusi di lingkungan Node.js). |
1084
+ | `optimize` | Mengontrol apakah optimasi build dilakukan. | `boolean` | `undefined` | `process.env.NODE_ENV === 'production'` | • Jika tidak ditentukan, ini akan dipicu selama build framework (Vite/Next.js).<br/>• `true` memaksakan optimasi bahkan dalam mode pengembangan.<br/>• `false` menonaktifkannya.<br/>• Jika diaktifkan, mengganti panggilan kamus dengan optimasi chunking.<br/>• Memerlukan plugin `@intlayer/babel` dan `@intlayer/swc`. |
1085
+ | `minify` | Minifikasikan kamus untuk mengurangi ukuran bundle. | `boolean` | `false` | | • Apakah bundel harus diminifikasi.<br/>• Default: `false` dalam produksi.<br/>• Opsi ini akan diabaikan jika `optimize` dinonaktifkan.<br/>• Opsi ini akan diabaikan jika `editor.enabled` adalah true. |
1086
+ | `purge` | Bersihkan kunci yang tidak digunakan dalam kamus. | `boolean` | `false` | | • Apakah bundel harus dibersihkan.<br/>• Default: `false` dalam produksi.<br/>• Opsi ini akan diabaikan jika `optimize` dinonaktifkan. |
1087
+ | `checkTypes` | Menunjukkan apakah build harus memeriksa tipe TypeScript dan mencatat error. | `boolean` | `false` | | Dapat memperlambat performa build. |
1088
+ | `chunkGrouping` | Menentukan apakah potongan kamus per lokal harus dikelompokkan berdasarkan batas pemisahan kode yang menggunakannya. | `boolean` | `true` | | • Tanpa pengelompokan, halaman yang tersusun dari banyak komponen mengirim satu permintaan per kamus.<br/>• Kamus yang dijangkau dari beberapa batas dipindahkan ke potongan bersama, sehingga tidak ada halaman yang membawa konten halaman lain.<br/>• Hanya berlaku untuk kamus yang menggunakan `importMode: 'dynamic'`.<br/>• Hanya berlaku untuk build klien, dan hanya saat bundling (bukan di mode dev). |
1089
+ | `dictionariesPreload` | Menentukan apakah kamus harus dimuat bersama potongan yang menggunakannya, alih-alih diambil setelah potongan tersebut dirender. | `boolean` | `true` | | Titik masuk yang dihasilkan menunggu lokal penjelajahan di tingkat teratas, sehingga rute yang dimuat secara lazy tidak dianggap dimuat sampai kontennya tersedia.<br/>• Pembacaan dirender secara sinkron alih-alih ditangguhkan, sehingga navigasi tidak lagi menampilkan kedipan status pemuatan.<br/>• Hanya lokal yang telah ditentukan yang ditunggu, sehingga halaman hanya mengunduh bahasa yang ditampilkannya.<br/>• Hanya berlaku untuk kamus yang menggunakan `importMode: 'dynamic'`, pada build klien.<br/>• Memerlukan bundler yang mendukung top-level await (Vite, esbuild). |
1090
+ | `outputFormat` | Mengontrol format output kamus. | `('esm' &#124; 'cjs')[]` | `['esm', 'cjs']` | `['cjs']` | |
1091
+ | `traversePattern` | Pola untuk file yang akan dipindai selama optimasi. | `string[]` | `['**/*.{tsx,ts,js,mjs,cjs,jsx,vue,svelte,svte}', '!**/node_modules/**', '!**/dist/**', '!**/.intlayer/**', '!**/*.config.*', '!**/*.test.*', '!**/*.spec.*', '!**/*.stories.*']` | `['src/**/*.{ts,tsx}', '../ui-library/**/*.{ts,tsx}', '!**/node_modules/**']` | • Meningkatkan performa build dengan membatasi optimasi ke file yang relevan.<br/>• Diabaikan jika `optimize` dinonaktifkan.<br/>• Menggunakan pola glob. |
1066
1092
 
1067
1093
  ---
1068
1094
 
@@ -536,28 +536,6 @@ Digunakan bersama dengan Variants, bidang ini menentukan alternatif konten berna
536
536
 
537
537
  > Lihat [Variants](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/dynamic_dictionaries/variants.md) untuk informasi lebih lanjut.
538
538
 
539
- #### `meta` (`Record<string, string | number | boolean>`)
540
-
541
- Digunakan bersama dengan Dynamic Records, bidang ini memungkinkan mendeklarasikan record yang dikelola CMS atau data arbitrer yang diambil saat runtime dengan ID buram. Identitas kamus ditentukan oleh kumpulan pasangan kunci-nilai arbitrer yang dideklarasikan dalam bidang `meta` ini.
542
-
543
- **Contoh:**
544
-
545
- ```typescript
546
- {
547
- key: "product-copy",
548
- meta: {
549
- id: "prod_abc",
550
- userId: "user_123"
551
- },
552
- content: {
553
- name: "Widget Pro",
554
- description: "The best widget."
555
- }
556
- }
557
- ```
558
-
559
- > Lihat [Dynamic Records](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/dynamic_dictionaries/dynamic_content.md) untuk informasi lebih lanjut.
560
-
561
539
  ### Properti CMS
562
540
 
563
541
  ##### `version` (string)
@@ -89,6 +89,29 @@ Tidak ada cara untuk mengambil konten dari file JSON, gunakan file .ts atau .js
89
89
 
90
90
  Dalam kasus ini, fungsi `fakeFetch` meniru penundaan untuk mensimulasikan waktu respons server. Intlayer menjalankan fungsi asinkron dan menggunakan hasilnya sebagai konten untuk kunci `text`.
91
91
 
92
+ ## Mengambil Konten Jarak Jauh
93
+
94
+ Anda juga dapat menetapkan sebuah promise langsung ke sebuah field konten. Intlayer menunggunya saat membangun kamus dan menyisipkan nilai yang telah diselesaikan:
95
+
96
+ ```typescript fileName="**/*.content.ts" contentDeclarationFormat={["typescript", "esm", "commonjs"]}
97
+ import type { Dictionary } from "intlayer";
98
+
99
+ const remoteContent = {
100
+ key: "remote_content",
101
+ content: {
102
+ externalContent: fetch("https://example.com").then((res) => res.json()),
103
+ },
104
+ } satisfies Dictionary;
105
+
106
+ export default remoteContent;
107
+ ```
108
+
109
+ ```plaintext fileName="**/*.content.json" contentDeclarationFormat="json"
110
+ Tidak ada cara untuk mengambil konten dari file JSON, gunakan file .ts atau .js sebagai gantinya
111
+ ```
112
+
113
+ > Permintaan dijalankan pada waktu build, sehingga data yang diambil merupakan snapshot yang tertanam di dalam kamus. Bangun ulang kamus Anda untuk memperbaruinya.
114
+
92
115
  ## Menggunakan Konten Berbasis Fungsi dalam Komponen React
93
116
 
94
117
  Untuk menggunakan konten berbasis fungsi dalam komponen React, Anda perlu mengimpor `useIntlayer` dari `react-intlayer` dan memanggilnya dengan ID konten untuk mengambil konten tersebut. Berikut adalah contohnya: