@intlayer/docs 9.3.1 → 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 (151) 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/dist/cjs/generated/docs.entry.cjs +20 -0
  20. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  21. package/dist/esm/generated/docs.entry.mjs +20 -0
  22. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  23. package/dist/types/generated/docs.entry.d.ts +1 -0
  24. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  25. package/docs/ar/bundle_optimization.md +1 -1
  26. package/docs/ar/configuration.md +32 -9
  27. package/docs/ar/dictionary/content_file.md +0 -22
  28. package/docs/ar/dictionary/function_fetching.md +23 -0
  29. package/docs/ar/eslint.md +336 -0
  30. package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +1 -1
  31. package/docs/bn/configuration.md +34 -9
  32. package/docs/bn/eslint.md +336 -0
  33. package/docs/cs/bundle_optimization.md +1 -1
  34. package/docs/cs/configuration.md +33 -9
  35. package/docs/cs/eslint.md +336 -0
  36. package/docs/de/bundle_optimization.md +1 -1
  37. package/docs/de/configuration.md +34 -9
  38. package/docs/de/dictionary/content_file.md +0 -22
  39. package/docs/de/dictionary/function_fetching.md +23 -0
  40. package/docs/de/eslint.md +336 -0
  41. package/docs/en/bundle_optimization.md +1 -1
  42. package/docs/en/configuration.md +34 -9
  43. package/docs/en/dictionary/content_file.md +0 -22
  44. package/docs/en/dictionary/function_fetching.md +23 -0
  45. package/docs/en/eslint.md +336 -0
  46. package/docs/en/packages/intlayer/getLocalizedPath.md +70 -19
  47. package/docs/en-GB/configuration.md +33 -9
  48. package/docs/en-GB/dictionary/content_file.md +0 -22
  49. package/docs/en-GB/dictionary/function_fetching.md +23 -0
  50. package/docs/en-GB/eslint.md +336 -0
  51. package/docs/en-GB/intlayer_with_create_react_app.md +32 -35
  52. package/docs/en-GB/intlayer_with_react_router_v7_fs_routes.md +1 -1
  53. package/docs/es/bundle_optimization.md +1 -1
  54. package/docs/es/configuration.md +35 -9
  55. package/docs/es/dictionary/content_file.md +0 -22
  56. package/docs/es/dictionary/function_fetching.md +23 -0
  57. package/docs/es/eslint.md +336 -0
  58. package/docs/fr/bundle_optimization.md +1 -1
  59. package/docs/fr/configuration.md +35 -9
  60. package/docs/fr/dictionary/content_file.md +0 -22
  61. package/docs/fr/dictionary/function_fetching.md +23 -0
  62. package/docs/fr/eslint.md +336 -0
  63. package/docs/hi/configuration.md +35 -9
  64. package/docs/hi/dictionary/content_file.md +0 -22
  65. package/docs/hi/dictionary/function_fetching.md +23 -0
  66. package/docs/hi/eslint.md +336 -0
  67. package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +1 -1
  68. package/docs/hi/intlayer_with_vite+svelte.md +2 -2
  69. package/docs/id/configuration.md +35 -9
  70. package/docs/id/dictionary/content_file.md +0 -22
  71. package/docs/id/dictionary/function_fetching.md +23 -0
  72. package/docs/id/eslint.md +336 -0
  73. package/docs/it/bundle_optimization.md +1 -1
  74. package/docs/it/configuration.md +35 -9
  75. package/docs/it/dictionary/content_file.md +0 -22
  76. package/docs/it/dictionary/function_fetching.md +23 -0
  77. package/docs/it/eslint.md +336 -0
  78. package/docs/ja/configuration.md +30 -9
  79. package/docs/ja/dictionary/content_file.md +0 -22
  80. package/docs/ja/dictionary/function_fetching.md +23 -0
  81. package/docs/ja/eslint.md +336 -0
  82. package/docs/ja/intlayer_with_react_router_v7.md +1 -146
  83. package/docs/ja/intlayer_with_vite+react.md +5 -1
  84. package/docs/ko/configuration.md +31 -9
  85. package/docs/ko/dictionary/content_file.md +0 -22
  86. package/docs/ko/dictionary/function_fetching.md +23 -0
  87. package/docs/ko/eslint.md +336 -0
  88. package/docs/ko/intlayer_with_lynx+react.md +4 -0
  89. package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +1 -1
  90. package/docs/ko/intlayer_with_storybook.md +5 -5
  91. package/docs/nl/configuration.md +33 -9
  92. package/docs/nl/eslint.md +336 -0
  93. package/docs/pl/bundle_optimization.md +1 -1
  94. package/docs/pl/configuration.md +34 -9
  95. package/docs/pl/dictionary/content_file.md +0 -22
  96. package/docs/pl/dictionary/function_fetching.md +23 -0
  97. package/docs/pl/eslint.md +336 -0
  98. package/docs/pl/intlayer_with_astro.md +1 -114
  99. package/docs/pl/migration_from_i18next_to_intlayer.md +4 -0
  100. package/docs/pl/migration_from_next-i18next_to_intlayer.md +8 -4
  101. package/docs/pl/migration_from_next-intl_to_intlayer.md +11 -5
  102. package/docs/pl/migration_from_nuxtjs_i18n_to_intlayer.md +8 -4
  103. package/docs/pl/migration_from_react-i18next_to_intlayer.md +8 -4
  104. package/docs/pl/migration_from_vue-i18n_to_intlayer.md +4 -0
  105. package/docs/pt/bundle_optimization.md +1 -1
  106. package/docs/pt/configuration.md +34 -9
  107. package/docs/pt/dictionary/content_file.md +0 -22
  108. package/docs/pt/dictionary/function_fetching.md +23 -0
  109. package/docs/pt/eslint.md +336 -0
  110. package/docs/pt/intlayer_with_astro.md +1 -114
  111. package/docs/ru/bundle_optimization.md +1 -1
  112. package/docs/ru/configuration.md +34 -9
  113. package/docs/ru/dictionary/content_file.md +0 -22
  114. package/docs/ru/dictionary/function_fetching.md +23 -0
  115. package/docs/ru/eslint.md +336 -0
  116. package/docs/tr/bundle_optimization.md +1 -1
  117. package/docs/tr/configuration.md +33 -9
  118. package/docs/tr/dictionary/content_file.md +0 -22
  119. package/docs/tr/dictionary/function_fetching.md +23 -0
  120. package/docs/tr/eslint.md +336 -0
  121. package/docs/uk/configuration.md +35 -9
  122. package/docs/uk/dictionary/content_file.md +0 -22
  123. package/docs/uk/dictionary/function_fetching.md +23 -0
  124. package/docs/uk/eslint.md +336 -0
  125. package/docs/uk/packages/angular-intlayer/exports.md +2 -2
  126. package/docs/ur/configuration.md +35 -9
  127. package/docs/ur/eslint.md +336 -0
  128. package/docs/vi/bundle_optimization.md +1 -1
  129. package/docs/vi/configuration.md +33 -9
  130. package/docs/vi/dictionary/content_file.md +0 -22
  131. package/docs/vi/dictionary/function_fetching.md +23 -0
  132. package/docs/vi/eslint.md +336 -0
  133. package/docs/zh/bundle_optimization.md +1 -1
  134. package/docs/zh/configuration.md +29 -9
  135. package/docs/zh/dictionary/content_file.md +0 -22
  136. package/docs/zh/dictionary/function_fetching.md +23 -0
  137. package/docs/zh/eslint.md +336 -0
  138. package/docs/zh/intlayer_with_create_react_app.md +4 -0
  139. package/docs/zh/intlayer_with_lynx+react.md +4 -0
  140. package/docs/zh/intlayer_with_nextjs_14.md +0 -2
  141. package/docs/zh/intlayer_with_nextjs_15.md +0 -2
  142. package/docs/zh/intlayer_with_nextjs_page_router.md +0 -2
  143. package/docs/zh/intlayer_with_nuxt.md +1 -1
  144. package/docs/zh/intlayer_with_react_router_v7.md +4 -0
  145. package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +4 -0
  146. package/docs/zh/intlayer_with_solid_start.md +1 -1
  147. package/docs/zh/intlayer_with_vite+vue.md +0 -2
  148. package/docs/zh-TW/bundle_optimization.md +1 -1
  149. package/docs/zh-TW/eslint.md +336 -0
  150. package/package.json +7 -7
  151. package/src/generated/docs.entry.ts +20 -0
@@ -0,0 +1,336 @@
1
+ ---
2
+ createdAt: 2026-08-12
3
+ updatedAt: 2026-08-13
4
+ title: ESLint प्लगइन | Intlayer के लिए लिंट नियम
5
+ description: eslint-plugin-intlayer के साथ हार्डकोडेड स्ट्रिंग्स, ऐसे डायनामिक कॉल्स जिन्हें Intlayer कंपाइलर ऑप्टिमाइज़ नहीं कर सकता, और अप्रयुक्त शब्दकोश सामग्री का पता लगाएं। React, Vue, Svelte, Angular और Astro में ESLint और oxlint के साथ काम करता है।
6
+ keywords:
7
+ - Intlayer
8
+ - ESLint
9
+ - oxlint
10
+ - लिंटिंग
11
+ - i18n
12
+ - अंतर्राष्ट्रीयकरण
13
+ - no-raw-text
14
+ - हार्डकोडेड स्ट्रिंग्स
15
+ - अप्रयुक्त अनुवाद
16
+ - अप्रयुक्त सामग्री
17
+ - React
18
+ - Vue
19
+ - Svelte
20
+ - Angular
21
+ slugs:
22
+ - doc
23
+ - eslint
24
+ history:
25
+ - version: 9.3.1
26
+ date: 2026-08-12
27
+ changes: "प्रारंभिक इतिहास"
28
+ author: aymericzip
29
+ ---
30
+
31
+ # ESLint x OXLint प्लगइन
32
+
33
+ `eslint-plugin-intlayer` उन i18n गलतियों को पकड़ता है जिन्हें TypeScript नहीं पकड़ सकता:
34
+
35
+ 1. **हार्डकोडेड टेक्स्ट** जो कभी डिक्शनरी में नहीं गया।
36
+ 2. **डायनामिक कॉल्स** जो टाइप-चेक पास करते हैं और रन होते हैं, लेकिन Intlayer कंपाइलर उन्हें ऑप्टिमाइज़ नहीं कर सकता।
37
+ 3. **अप्रयुक्त सामग्री (Dead content)** — डिक्शनरी और फ़ील्ड्स जिन्हें प्रोजेक्ट में कहीं भी नहीं पढ़ा जाता (वैकल्पिक/ऑप्ट-इन)।
38
+
39
+ अज्ञात डिक्शनरी कीज, अज्ञात फ़ील्ड पाथ और अनुपलब्ध लोकेल्स पहले से ही कंपाइल एरर हैं, इसलिए प्लगइन उन्हें दोबारा रिपोर्ट नहीं करता है।
40
+
41
+ ## इंस्टॉलेशन
42
+
43
+ ```bash packageManager="npm"
44
+ npm install --save-dev eslint-plugin-intlayer
45
+ ```
46
+
47
+ ```bash packageManager="pnpm"
48
+ pnpm add --save-dev eslint-plugin-intlayer
49
+ ```
50
+
51
+ ```bash packageManager="yarn"
52
+ yarn add --dev eslint-plugin-intlayer
53
+ ```
54
+
55
+ ESLint 9 या बाद के संस्करण (flat config) की आवश्यकता है। ESLint 10 समर्थित है।
56
+
57
+ ## उपयोग
58
+
59
+ यह प्लगइन ESLint और [oxlint](https://oxc.rs) दोनों में समान नियमों और विकल्पों के साथ चलता है।
60
+
61
+ <Tabs defaultTab="eslint">
62
+ <Tab label="ESLint" value="eslint">
63
+
64
+ ```javascript fileName="eslint.config.mjs"
65
+ import intlayer from "eslint-plugin-intlayer";
66
+
67
+ export default [...intlayer.configs.recommended];
68
+ ```
69
+
70
+ या किसी कॉन्फ़िग को फैलाएँ और गंभीरता स्वयं तय करें:
71
+
72
+ ```javascript fileName="eslint.config.mjs"
73
+ import intlayer from "eslint-plugin-intlayer";
74
+
75
+ export default [
76
+ ...intlayer.configs.recommended,
77
+ {
78
+ rules: {
79
+ "intlayer/no-raw-text": "warn",
80
+ "intlayer/static-dictionary-key": "error",
81
+ "intlayer/no-dynamic-field-access": "error",
82
+ "intlayer/enforce-adapter-import": "warn",
83
+ "intlayer/no-unused-content": "warn",
84
+ },
85
+ },
86
+ ];
87
+ ```
88
+
89
+ </Tab>
90
+ <Tab label="oxlint" value="oxlint">
91
+
92
+ ```json fileName=".oxlintrc.json"
93
+ {
94
+ "jsPlugins": ["eslint-plugin-intlayer"],
95
+ "rules": {
96
+ "intlayer/no-raw-text": "warn",
97
+ "intlayer/static-dictionary-key": "error",
98
+ "intlayer/no-dynamic-field-access": "error",
99
+ "intlayer/enforce-adapter-import": "warn"
100
+ }
101
+ }
102
+ ```
103
+
104
+ दो सावधानियां: oxlint का JS प्लगइन समर्थन अभी भी अल्फा चरण में है, और oxlint कस्टम पार्सर्स का समर्थन नहीं करता है — इसलिए `.vue`, `.svelte`, `.astro` और Angular टेम्प्लेट्स को वहां लिंट नहीं किया जाता है। अपनी JS/TS/JSX फ़ाइलों पर oxlint चलाएं और बाकी के लिए ESLint बनाए रखें।
105
+
106
+ `no-unused-content` को ऊपर जानबूझकर छोड़ दिया गया है: इसे नियम संदर्भ से कार्यशील निर्देशिका और जांची गई फ़ाइल पथ की आवश्यकता होती है, जिसकी गारंटी अल्फा JS प्लगइन ब्रिज नहीं देता है। इसे ESLint के तहत चलाएं।
107
+
108
+ </Tab>
109
+ </Tabs>
110
+
111
+ ### कॉन्फ़िग्स
112
+
113
+ | कॉन्फ़िग | `no-raw-text` | `static-dictionary-key` | `no-dynamic-field-access` | `enforce-adapter-import` | `no-unused-content` |
114
+ | --------------- | ------------------------- | ----------------------- | ------------------------- | ------------------------ | ------------------- |
115
+ | `recommended` | warn | error | error | off | off |
116
+ | `strict` | error (+ गैर-JSX लिटरल्स) | error | error | error | off |
117
+ | `contract-only` | off | error | error | off | off |
118
+
119
+ `recommended` जानबूझकर `no-raw-text` को `warn` पर रखता है: इसे किसी मौजूदा कोडबेस पर लागू करने से सभी अनुवादित न किए गए स्ट्रिंग्स एक साथ सामने आ जाते हैं, जिससे पहले दिन ही आपका बिल्ड टूटना नहीं चाहिए।
120
+
121
+ `enforce-adapter-import` डिफ़ॉल्ट रूप से बंद है — यदि आप चाहें तो इसे स्पष्ट रूप से सक्षम करें।
122
+
123
+ `no-unused-content` हर कॉन्फ़िग में बंद है, जिसमें `strict` भी शामिल है। यह एकमात्र ऐसा नियम है जो आपके Intlayer कॉन्फ़िगरेशन को पढ़ता है और डिस्क से आपकी सोर्स फ़ाइलों को स्कैन करता है, इसलिए इसे चालू करना एक विचारशील निर्णय होना चाहिए।
124
+
125
+ ## नियम
126
+
127
+ ### `no-raw-text`
128
+
129
+ उपयोगकर्ता-उन्मुख ऐसे टेक्स्ट की रिपोर्ट करता है जो डिक्शनरी में घोषित नहीं है। यह `intlayer extract` के समान डिटेक्शन का उपयोग करता है, इसलिए ब्रांड नाम, CSS क्लास और तकनीकी पहचानकर्ताओं को अनदेखा कर दिया जाता है।
130
+
131
+ ```jsx
132
+ // ✗ रिपोर्ट किया गया
133
+ <h1>Welcome to our documentation</h1>
134
+ <input placeholder="Enter your email address" />
135
+
136
+ // ✓ सही
137
+ const { title } = useIntlayer("home");
138
+ <h1>{title}</h1>
139
+ ```
140
+
141
+ सामग्री घोषणा फ़ाइलें (`*.content.ts`, …) छोड़ दी जाती हैं।
142
+
143
+ एक बार में पूरी फ़ाइल को ठीक करने के लिए, `npx intlayer extract` चलाएं और कंपाइलर को स्ट्रिंग्स को डिक्शनरी में स्थानांतरित करने दें।
144
+
145
+ **विकल्प**
146
+
147
+ ```javascript fileName="eslint.config.mjs"
148
+ {
149
+ "intlayer/no-raw-text": [
150
+ "warn",
151
+ {
152
+ // वे विशेषताएं जिनका मान उपयोगकर्ता-उन्मुख टेक्स्ट है।
153
+ // डिफ़ॉल्ट: title, placeholder, alt, aria-label, label
154
+ attributes: ["title", "placeholder", "alt", "aria-label", "label"],
155
+
156
+ // वे तत्व जिनकी सामग्री कभी भी उपयोगकर्ता-उन्मुख टेक्स्ट नहीं होती है।
157
+ // डिफ़ॉल्ट: code, pre, script, style
158
+ ignoreElements: ["code", "pre", "script", "style"],
159
+
160
+ // कभी रिपोर्ट न किए जाने वाले टेक्स्ट के लिए रेगुलर एक्सप्रेशन।
161
+ ignorePatterns: ["^Powered by"],
162
+
163
+ // मार्कअप के बाहर स्ट्रिंग लिटरल्स की भी रिपोर्ट करें। डिफ़ॉल्ट: false
164
+ includeStringLiterals: false,
165
+ },
166
+ ],
167
+ }
168
+ ```
169
+
170
+ ### `static-dictionary-key`
171
+
172
+ आवश्यकता है कि डिक्शनरी कुंजी एक स्ट्रिंग लिटरल होनी चाहिए।
173
+
174
+ कंपाइलर केवल तभी डिक्शनरी को प्री-लोड कर सकता है जब वह कॉल साइट पर सीधे कुंजी पढ़ सके। एक गणना की गई कुंजी के साथ यह चुपचाप अनुकूलन को छोड़ देता है और इसके बजाय हर डिक्शनरी को बंडल कर देता है।
175
+
176
+ ```typescript
177
+ // ✗ रिपोर्ट किया गया
178
+ useIntlayer(dictionaryKey);
179
+ useIntlayer(`home-${suffix}`);
180
+ getTranslations({ namespace: page });
181
+
182
+ // ✗ वेरिएबल अभी भी लिटरल नहीं है
183
+ const key = "home";
184
+ useIntlayer(key);
185
+
186
+ // ✓ सही
187
+ useIntlayer("home");
188
+ getTranslations({ namespace: "home" });
189
+ ```
190
+
191
+ यह `useIntlayer`, `getIntlayer` और प्रत्येक संगतता एडॉप्टर (`useTranslation`, `useTranslations`, `formatMessage`, `<FormattedMessage id>`, `<Trans i18nKey>`, …) पर लागू होता है।
192
+
193
+ ### `no-dynamic-field-access`
194
+
195
+ आवश्यकता है कि डिक्शनरी से आप जो फ़ील्ड पढ़ते हैं वह स्थैतिक रूप से ज्ञात हो।
196
+
197
+ कंपाइलर उन फ़ील्ड्स को हटा देता है जिनका उपयोग वह नहीं देखता है। एक कंप्यूटेड एक्सेस इसके लिए अदृश्य होता है, इसलिए रनटाइम पर यह `undefined` लौटा सकता है।
198
+
199
+ ```typescript
200
+ // ✗ रिपोर्ट किया गया
201
+ const content = useIntlayer("home");
202
+ content[fieldName];
203
+
204
+ const t = useTranslations("home");
205
+ t(messageKey);
206
+
207
+ // ✓ सही
208
+ content.title;
209
+ content["title"];
210
+ content.items[0];
211
+ t("hero.title");
212
+ ```
213
+
214
+ ### `enforce-adapter-import`
215
+
216
+ मूल पैकेज के बजाय `@intlayer/*` संगतता एडॉप्टर को प्राथमिकता देता है। मूल पैकेज केवल तभी Intlayer पर रीज़ॉल्व होता है जब बंडलर उपनाम कॉन्फ़िगर किया गया हो; एडॉप्टर हमेशा करता है। `--fix` के साथ ऑटोफ़िक्सेबल।
217
+
218
+ ```typescript
219
+ // ✗ रिपोर्ट किया गया
220
+ import { useTranslation } from "react-i18next";
221
+ import { getTranslations } from "next-intl/server";
222
+
223
+ // ✓ सही
224
+ import { useTranslation } from "@intlayer/react-i18next";
225
+ import { getTranslations } from "@intlayer/next-intl/server";
226
+ ```
227
+
228
+ ### `no-unused-content`
229
+
230
+ **डिफ़ॉल्ट रूप से बंद।** ऐसी सामग्री की रिपोर्ट करता है जिसे आपके प्रोजेक्ट में कुछ भी नहीं पढ़ता है, साथ ही एक से अधिक स्थानों पर घोषित डिक्शनरी कीज की रिपोर्ट करता है।
231
+
232
+ ```typescript fileName="src/home.content.ts"
233
+ export default {
234
+ key: "home", // ✗ तब रिपोर्ट किया जाता है जब प्रोजेक्ट में कोई कॉलर "home" का अनुरोध नहीं करता है
235
+ content: {
236
+ title: t({ hi: "शीर्षक", en: "Title" }),
237
+
238
+ // ✗ तब रिपोर्ट किया जाता है जब कुछ भी `hero` को नहीं पढ़ता है
239
+ hero: {
240
+ subtitle: t({ hi: "उपशीर्षक", en: "Subtitle" }),
241
+ },
242
+ },
243
+ };
244
+ ```
245
+
246
+ अन्य नियमों के विपरीत, यह नियम केवल सामने की फ़ाइल से निर्णय नहीं ले सकता — एक फ़ील्ड केवल पूरे प्रोजेक्ट के सापेक्ष ही अप्रयुक्त होती है। लिंट रन की पहली सामग्री घोषणा पर यह आपके Intlayer कॉन्फ़िगरेशन को लोड करता है, उन सोर्स फ़ाइलों को स्कैन करता है जिन्हें वह कॉन्फ़िगरेशन घोषित करता है (`build.traversePattern`, `compiler.transformPattern`) और उसी उपयोग विश्लेषक को चलाता है जो `@intlayer/lsp` और VS Code एक्सटेंशन में "अप्रयुक्त" स्ट्राइकथ्रू को शक्ति प्रदान करता है। परिणाम को `cacheTtl` मिलीसेकंड के लिए कैश किया जाता है, इसलिए स्कैन प्रत्येक फ़ाइल के बजाय प्रति रन एक बार होता है।
247
+
248
+ **विकल्प**
249
+
250
+ ```javascript fileName="eslint.config.mjs"
251
+ {
252
+ "intlayer/no-unused-content": [
253
+ "warn",
254
+ {
255
+ // उन डिक्शनरी कीज की रिपोर्ट करें जिन्हें कोई संदर्भित नहीं करता है। डिफ़ॉल्ट: true
256
+ reportUnusedDictionaries: true,
257
+
258
+ // उन कंटेंट फ़ील्ड्स की रिपोर्ट करें जिन्हें कुछ भी नहीं पढ़ता है। डिफ़ॉल्ट: true
259
+ reportUnusedFields: true,
260
+
261
+ // एक से अधिक स्थानों पर घोषित कीज की रिपोर्ट करें। डिफ़ॉल्ट: true
262
+ reportDuplicateKeys: true,
263
+
264
+ // कभी रिपोर्ट न किए जाने वाले फ़ील्ड पाथ के लिए रेगुलर एक्सप्रेशन।
265
+ ignoreFields: ["^meta"],
266
+
267
+ // प्रोजेक्ट रूट जहां से स्कैन शुरू होता है। डिफ़ॉल्ट: ESLint की कार्यशील निर्देशिका
268
+ baseDir: process.cwd(),
269
+
270
+ // एक प्रोजेक्ट स्कैन का पुन: उपयोग कितने समय तक किया जाता है (ms में)। डिफ़ॉल्ट: 30000
271
+ cacheTtl: 30000,
272
+ },
273
+ ],
274
+ }
275
+ ```
276
+
277
+ जब आप लंबे समय तक चलने वाले एडिटर सर्वर से लिंट करते हैं और चाहते हैं कि आपके संपादन जल्दी दिखाई दें, तो `cacheTtl` कम करें; जब एक ही लिंट रन मोनोरेपो में कई Intlayer प्रोजेक्ट्स में फैला हो तो `baseDir` सेट करें।
278
+
279
+ > **यह गलत रिपोर्ट से बचने को प्राथमिकता देता है।** यहां एक झूठी सकारात्मक रिपोर्ट एक अनुवाद को हटा सकती है, इसलिए जब डिक्शनरी का उपयोग ऐसे तरीके से किया जाता है जिसे विश्लेषण ट्रैक नहीं कर सकता है, तो कुछ भी रिपोर्ट नहीं किया जाता है: पूरा कंटेंट ऑब्जेक्ट पास करना, इससे बाउंड अनुवाद फ़ंक्शन (`const t = useTranslations("home")`), सीधे आयात के माध्यम से पहुंचा गया डिक्लेरेशन (`useDictionary(myDictionary)`), किसी अन्य डिक्शनरी से `nest()`, या स्प्रेड ऑपरेटर द्वारा गैर-विस्तृत बनाई गई फ़ील्ड सूची। सिंगल-फ़ाइल घटक (`.vue`, `.svelte`, `.astro`) उनके द्वारा उल्लिखित डिक्शनरी के प्रत्येक फ़ील्ड का उपयोग करते हुए गिने जाते हैं, क्योंकि उनके स्क्रिप्ट ब्लॉक यहां पार्स नहीं किए जाते हैं।
280
+
281
+ `reportDuplicateKeys` उन अनमर्ज्ड डिक्शनरीज़ को पढ़ता है जिन्हें बिल्ड `.intlayer/` के तहत लिखता है, इसलिए यह तब तक शांत रहता है जब तक कि प्रोजेक्ट कम से कम एक बार बिल्ड न हो जाए। एक कुंजी साझा करने वाले दो डिक्लेरेशन मर्ज किए जाते हैं, जो एक वैध पैटर्न है — रिपोर्ट इसलिए मौजूद है क्योंकि दोनों पक्षों पर परिभाषित फ़ील्ड चुपचाप दो मानों में से केवल एक को रखता है।
282
+
283
+ विश्लेषक `@intlayer/lsp` से लोड होता है, जो ESM के रूप में वितरित होता है। इसलिए नियम को एक ऐसे Node संस्करण की आवश्यकता होती है जो ES मॉड्यूल को `require()` कर सके — Node 20.19+ या 22.12+। इससे पुराने किसी भी संस्करण पर यह लिंट रन को विफल करने के बजाय कुछ भी रिपोर्ट नहीं करता है।
284
+
285
+ ## फ्रेमवर्क
286
+
287
+ प्रत्येक नियम सभी Intlayer एकीकरणों में काम करता है, जिसमें Vue, Svelte और Angular टेम्प्लेट्स शामिल हैं। आपको केवल ESLint को यह बताना होगा कि प्रत्येक फ़ाइल प्रकार को कौन सा पार्सर पढ़ता है।
288
+
289
+ | फ्रेमवर्क | फ़ाइलें | पार्सर |
290
+ | ------------------------- | ----------------- | --------------------------------- |
291
+ | React, Preact, Solid, Lit | `.jsx` `.tsx` | `typescript-eslint` |
292
+ | Next.js | `.jsx` `.tsx` | `typescript-eslint` |
293
+ | Vue, Nuxt | `.vue` | `vue-eslint-parser` |
294
+ | Svelte, SvelteKit | `.svelte` | `svelte-eslint-parser` |
295
+ | Angular | `.ts` | `typescript-eslint` |
296
+ | Angular टेम्प्लेट्स | `.component.html` | `@angular-eslint/template-parser` |
297
+ | Astro | `.astro` | `astro-eslint-parser` |
298
+
299
+ ```javascript fileName="eslint.config.mjs"
300
+ import intlayer from "eslint-plugin-intlayer";
301
+ import tseslint from "typescript-eslint";
302
+ import vueParser from "vue-eslint-parser";
303
+ import svelteParser from "svelte-eslint-parser";
304
+ import angularTemplateParser from "@angular-eslint/template-parser";
305
+
306
+ export default [
307
+ ...intlayer.configs.recommended,
308
+
309
+ {
310
+ files: ["**/*.{ts,tsx,jsx}"],
311
+ languageOptions: { parser: tseslint.parser },
312
+ },
313
+ {
314
+ files: ["**/*.vue"],
315
+ languageOptions: {
316
+ parser: vueParser,
317
+ parserOptions: { parser: tseslint.parser },
318
+ },
319
+ },
320
+ {
321
+ files: ["**/*.svelte"],
322
+ languageOptions: {
323
+ parser: svelteParser,
324
+ parserOptions: { parser: tseslint.parser },
325
+ },
326
+ },
327
+ {
328
+ files: ["**/*.component.html"],
329
+ languageOptions: { parser: angularTemplateParser },
330
+ },
331
+ ];
332
+ ```
333
+
334
+ केवल वही पार्सर स्थापित करें जिनकी आपके प्रोजेक्ट को आवश्यकता है।
335
+
336
+ > **ज्ञात सीमा।** Vue और Angular टेम्प्लेट्स में, `{{ content[key] }}` जैसा एक्सप्रेशन `no-dynamic-field-access` द्वारा जाँचा नहीं जाता है। स्क्रिप्ट ब्लॉक में लिखे गए डायनामिक रीड सामान्य रूप से पकड़े जाते हैं।
@@ -145,7 +145,7 @@ bun add vite-intlayer --dev
145
145
 
146
146
  </Step>
147
147
 
148
- </Steps>
148
+ <Step number={5} title="लेआउट कंपोनेंट बनाएं">
149
149
 
150
150
  #### फ़ाइल संरचना
151
151
 
@@ -319,9 +319,9 @@ const changeLocale = (event: Event) => {
319
319
  Intlayer सीधे आपके Svelte एप्लिकेशन में Markdown सामग्री को रेंडर करने का समर्थन करता है। डिफ़ॉल्ट रूप से, Markdown को सादा टेक्स्ट के रूप में माना जाता है। Markdown को समृद्ध HTML में बदलने के लिए, आप `@humanspeak/svelte-markdown` या किसी अन्य markdown पार्सर को एकीकृत कर सकते हैं।
320
320
 
321
321
  > `intlayer` पैकेज का उपयोग क�
322
- > </Steps>
322
+ > </Step>
323
323
 
324
- e}>
324
+ <Step number={8} title="intlayer संपादक / CMS सेट करें" isOptional={true}>
325
325
 
326
326
  intlayer संपादक सेट करने के लिए, आपको [intlayer संपादक दस्तावेज़](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/intlayer_visual_editor.md) का पालन करना होगा।
327
327
 
@@ -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: