@intlayer/docs 7.0.4-canary.0 → 7.0.4

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 (107) hide show
  1. package/blog/ar/intlayer_with_i18next.md +68 -106
  2. package/blog/ar/intlayer_with_next-i18next.md +84 -288
  3. package/blog/ar/intlayer_with_next-intl.md +58 -337
  4. package/blog/ar/intlayer_with_react-i18next.md +68 -290
  5. package/blog/ar/intlayer_with_react-intl.md +63 -266
  6. package/blog/de/intlayer_with_i18next.md +77 -97
  7. package/blog/de/intlayer_with_next-i18next.md +69 -296
  8. package/blog/de/intlayer_with_next-intl.md +59 -340
  9. package/blog/de/intlayer_with_react-i18next.md +68 -290
  10. package/blog/de/intlayer_with_react-intl.md +62 -264
  11. package/blog/en/intlayer_with_i18next.md +36 -1638
  12. package/blog/en/intlayer_with_next-i18next.md +22 -847
  13. package/blog/en/intlayer_with_next-intl.md +32 -1053
  14. package/blog/en/intlayer_with_react-i18next.md +38 -764
  15. package/blog/en/intlayer_with_react-intl.md +42 -1018
  16. package/blog/en-GB/intlayer_with_i18next.md +67 -103
  17. package/blog/en-GB/intlayer_with_next-i18next.md +71 -292
  18. package/blog/en-GB/intlayer_with_next-intl.md +58 -337
  19. package/blog/en-GB/intlayer_with_react-i18next.md +67 -289
  20. package/blog/en-GB/intlayer_with_react-intl.md +61 -264
  21. package/blog/es/intlayer_with_i18next.md +67 -103
  22. package/blog/es/intlayer_with_next-i18next.md +71 -296
  23. package/blog/es/intlayer_with_next-intl.md +57 -338
  24. package/blog/es/intlayer_with_react-i18next.md +68 -290
  25. package/blog/es/intlayer_with_react-intl.md +62 -265
  26. package/blog/fr/intlayer_with_i18next.md +66 -104
  27. package/blog/fr/intlayer_with_next-i18next.md +82 -285
  28. package/blog/fr/intlayer_with_next-intl.md +57 -338
  29. package/blog/fr/intlayer_with_react-i18next.md +67 -289
  30. package/blog/fr/intlayer_with_react-intl.md +61 -264
  31. package/blog/hi/intlayer_with_i18next.md +68 -104
  32. package/blog/hi/intlayer_with_next-i18next.md +74 -299
  33. package/blog/hi/intlayer_with_next-intl.md +57 -239
  34. package/blog/hi/intlayer_with_react-i18next.md +69 -291
  35. package/blog/hi/intlayer_with_react-intl.md +65 -268
  36. package/blog/id/intlayer_with_i18next.md +126 -0
  37. package/blog/id/intlayer_with_next-i18next.md +142 -0
  38. package/blog/id/intlayer_with_next-intl.md +113 -0
  39. package/blog/id/intlayer_with_react-i18next.md +124 -0
  40. package/blog/id/intlayer_with_react-intl.md +122 -0
  41. package/blog/it/intlayer_with_i18next.md +67 -103
  42. package/blog/it/intlayer_with_next-i18next.md +71 -296
  43. package/blog/it/intlayer_with_next-intl.md +57 -338
  44. package/blog/it/intlayer_with_react-i18next.md +68 -290
  45. package/blog/it/intlayer_with_react-intl.md +62 -265
  46. package/blog/ja/intlayer_with_i18next.md +68 -103
  47. package/blog/ja/intlayer_with_next-i18next.md +85 -283
  48. package/blog/ja/intlayer_with_next-intl.md +58 -336
  49. package/blog/ja/intlayer_with_react-i18next.md +68 -290
  50. package/blog/ja/intlayer_with_react-intl.md +62 -264
  51. package/blog/ko/intlayer_with_i18next.md +80 -96
  52. package/blog/ko/intlayer_with_next-i18next.md +85 -287
  53. package/blog/ko/intlayer_with_next-intl.md +68 -327
  54. package/blog/ko/intlayer_with_react-i18next.md +68 -290
  55. package/blog/ko/intlayer_with_react-intl.md +64 -266
  56. package/blog/pl/intlayer_with_i18next.md +126 -0
  57. package/blog/pl/intlayer_with_next-i18next.md +142 -0
  58. package/blog/pl/intlayer_with_next-intl.md +111 -0
  59. package/blog/pl/intlayer_with_react-i18next.md +124 -0
  60. package/blog/pl/intlayer_with_react-intl.md +122 -0
  61. package/blog/pt/intlayer_with_i18next.md +67 -103
  62. package/blog/pt/intlayer_with_next-i18next.md +72 -293
  63. package/blog/pt/intlayer_with_next-intl.md +57 -256
  64. package/blog/pt/intlayer_with_react-i18next.md +104 -78
  65. package/blog/pt/intlayer_with_react-intl.md +62 -266
  66. package/blog/ru/intlayer_with_i18next.md +66 -104
  67. package/blog/ru/intlayer_with_next-i18next.md +71 -296
  68. package/blog/ru/intlayer_with_next-intl.md +58 -337
  69. package/blog/ru/intlayer_with_react-i18next.md +68 -290
  70. package/blog/ru/intlayer_with_react-intl.md +62 -265
  71. package/blog/tr/intlayer_with_i18next.md +71 -107
  72. package/blog/tr/intlayer_with_next-i18next.md +72 -297
  73. package/blog/tr/intlayer_with_next-intl.md +58 -339
  74. package/blog/tr/intlayer_with_react-i18next.md +69 -291
  75. package/blog/tr/intlayer_with_react-intl.md +63 -285
  76. package/blog/vi/intlayer_with_i18next.md +126 -0
  77. package/blog/vi/intlayer_with_next-i18next.md +142 -0
  78. package/blog/vi/intlayer_with_next-intl.md +111 -0
  79. package/blog/vi/intlayer_with_react-i18next.md +124 -0
  80. package/blog/vi/intlayer_with_react-intl.md +122 -0
  81. package/blog/zh/intlayer_with_i18next.md +67 -102
  82. package/blog/zh/intlayer_with_next-i18next.md +72 -296
  83. package/blog/zh/intlayer_with_next-intl.md +58 -336
  84. package/blog/zh/intlayer_with_react-i18next.md +68 -290
  85. package/blog/zh/intlayer_with_react-intl.md +63 -106
  86. package/docs/ar/plugins/sync-json.md +244 -0
  87. package/docs/de/plugins/sync-json.md +244 -0
  88. package/docs/en/intlayer_cli.md +25 -0
  89. package/docs/en/intlayer_with_nextjs_14.md +2 -0
  90. package/docs/en/intlayer_with_nextjs_15.md +2 -0
  91. package/docs/en/intlayer_with_nextjs_16.md +2 -0
  92. package/docs/en/plugins/sync-json.md +1 -1
  93. package/docs/en-GB/plugins/sync-json.md +244 -0
  94. package/docs/es/plugins/sync-json.md +244 -0
  95. package/docs/fr/plugins/sync-json.md +244 -0
  96. package/docs/hi/plugins/sync-json.md +244 -0
  97. package/docs/id/plugins/sync-json.md +244 -0
  98. package/docs/it/plugins/sync-json.md +244 -0
  99. package/docs/ja/plugins/sync-json.md +244 -0
  100. package/docs/ko/plugins/sync-json.md +244 -0
  101. package/docs/pl/plugins/sync-json.md +244 -0
  102. package/docs/pt/plugins/sync-json.md +244 -0
  103. package/docs/ru/plugins/sync-json.md +244 -0
  104. package/docs/tr/plugins/sync-json.md +245 -0
  105. package/docs/vi/plugins/sync-json.md +244 -0
  106. package/docs/zh/plugins/sync-json.md +244 -0
  107. package/package.json +14 -14
@@ -1,367 +1,142 @@
1
1
  ---
2
2
  createdAt: 2025-08-23
3
- updatedAt: 2025-08-23
3
+ updatedAt: 2025-10-29
4
4
  title: Intlayer और next-i18next
5
- description: Next.js एप्लिकेशन के लिए next-i18next को एक्सटेंशन करें
5
+ description: एक व्यापक Next.js अंतरराष्ट्रीयकरण समाधान के लिए Intlayer को next-i18next के साथ एकीकृत करें
6
6
  keywords:
7
7
  - i18next
8
8
  - next-i18next
9
9
  - Intlayer
10
- - अंतर्राष्ट्रीयकरण
11
- - दस्तावेज़ीकरण
10
+ - अंतरराष्ट्रीयकरण
11
+ - ब्लॉग
12
12
  - Next.js
13
- - JavaScript
14
- - React
13
+ - जावास्क्रिप्ट
14
+ - रिएक्ट
15
15
  slugs:
16
16
  - blog
17
17
  - intlayer-with-next-i18next
18
+ history:
19
+ - version: 7.0.0
20
+ date: 2025-10-29
21
+ changes: syncJSON प्लगइन में बदलाव और व्यापक पुनर्लेखन
18
22
  ---
19
23
 
20
- # Next.js अंतर्राष्ट्रीयकरण (i18n) next-i18next और Intlayer के साथ
24
+ # next-i18next और Intlayer के साथ Next.js अंतरराष्ट्रीयकरण (i18n)
21
25
 
22
- next-i18next और Intlayer दोनों ओपन-सोर्स अंतर्राष्ट्रीयकरण (i18n) ढांचे हैं जो Next.js अनुप्रयोगों के लिए डिज़ाइन किए गए हैं। उनका उपयोग सॉफ़्टवेयर परियोजनाओं में अनुवाद, स्थानीयकरण और भाषा स्विचिंग के प्रबंधन के लिए किया जाता है।
26
+ ## सामग्री सूची
23
27
 
24
- दोनों समाधानों में तीन मुख्य अवधारणाएँ शामिल हैं:
28
+ <TOC/>
25
29
 
26
- 1. **सामग्री घोषणा**: आपके अनुप्रयोग की अनुवाद योग्य सामग्री को परिभाषित करने की विधि।
27
- - `i18next` के मामले में `resource` के नाम से जाना जाता है, सामग्री घोषणा एक संरचित JSON ऑब्जेक्ट है जिसमें एक या अधिक भाषाओं में अनुवाद के लिए कुंजी-मूल्य जोड़ होते हैं। अधिक जानकारी के लिए [i18next डॉक्यूमेंटेशन](https://www.i18next.com/translation-function/essentials) देखें।
28
- - `Intlayer` के मामले में `content declaration file` के नाम से जाना जाता है, सामग्री घोषणा एक JSON, JS, या TS फ़ाइल हो सकती है जो संरचित डेटा को निर्यात करती है। अधिक जानकारी के लिए [Intlayer डॉक्यूमेंटेशन](https://intlayer.org/fr/doc/concept/content) देखें।
30
+ ## next-i18next क्या है?
29
31
 
30
- 2. **उपकरण**: अनुप्रयोग में सामग्री घोषणाओं को बनाने और व्याख्या करने के लिए उपकरण, जैसे `getI18n()`, `useCurrentLocale()`, या `useChangeLocale()` next-i18next के लिए, और `useIntlayer()` या `useLocale()` Intlayer के लिए।
32
+ **next-i18next** Next.js अनुप्रयोगों के लिए सबसे लोकप्रिय अंतरराष्ट्रीयकरण (i18n) फ्रेमवर्क में से एक है। शक्तिशाली **i18next** इकोसिस्टम के ऊपर निर्मित, यह Next.js परियोजनाओं में अनुवाद, स्थानीयकरण, और भाषा स्विचिंग को प्रबंधित करने के लिए एक व्यापक समाधान प्रदान करता है।
31
33
 
32
- 3. **प्लगइन्स और मिडलवेयर**: URL रिडायरेक्शन, बंडल ऑप्टिमाइजेशन, और अधिक के प्रबंधन के लिए सुविधाएँ, जैसे next-i18next के लिए `next-i18next/middleware` या Intlayer के लिए `intlayerMiddleware`।
34
+ हालांकि, next-i18next के साथ कुछ चुनौतियाँ भी हैं:
33
35
 
34
- ## Intlayer बनाम i18next: महत्वपूर्ण मतभेद
36
+ - **जटिल कॉन्फ़िगरेशन**: next-i18next को सेटअप करने के लिए कई कॉन्फ़िगरेशन फ़ाइलों और सर्वर-साइड तथा क्लाइंट-साइड i18n इंस्टेंस की सावधानीपूर्वक सेटअप की आवश्यकता होती है।
37
+ - **विखरे हुए अनुवाद**: अनुवाद फ़ाइलें आमतौर पर कंपोनेंट्स से अलग निर्देशिकाओं में संग्रहीत होती हैं, जिससे स्थिरता बनाए रखना कठिन हो जाता है।
38
+ - **मैनुअल नेमस्पेस प्रबंधन**: डेवलपर्स को नेमस्पेस को मैन्युअली प्रबंधित करना पड़ता है और अनुवाद संसाधनों के सही लोडिंग को सुनिश्चित करना होता है।
39
+ - **सीमित प्रकार सुरक्षा**: TypeScript समर्थन के लिए अतिरिक्त कॉन्फ़िगरेशन की आवश्यकता होती है और यह अनुवादों के लिए स्वचालित प्रकार जनरेशन प्रदान नहीं करता है।
35
40
 
36
- i18next और Intlayer के बीच मतभेदों का पता लगाने के लिए हमारे [next-i18next बनाम next-intl बनाम Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/blog/hi/i18next_vs_next-intl_vs_intlayer.md) के ब्लॉग पोस्ट पर जाएँ।
41
+ ## Intlayer क्या है?
37
42
 
38
- ## Intlayer के साथ next-i18next शब्दकोश कैसे उत्पन्न करें
43
+ **Intlayer** एक अभिनव, ओपन-सोर्स अंतरराष्ट्रीयकरण लाइब्रेरी है जिसे पारंपरिक i18n समाधानों की कमियों को दूर करने के लिए डिज़ाइन किया गया है। यह Next.js अनुप्रयोगों में सामग्री प्रबंधन के लिए एक आधुनिक दृष्टिकोण प्रदान करता है।
39
44
 
40
- ### Intlayer को next-i18next के साथ उपयोग करने का कारण?
45
+ हमारे [next-i18next vs. next-intl vs. Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/blog/hi/next-i18next_vs_next-intl_vs_intlayer.md) ब्लॉग पोस्ट में next-intl के साथ एक ठोस तुलना देखें।
41
46
 
42
- Intlayer सामग्री घोषणा फ़ाइलें आमतौर पर बेहतर डेवलपर अनुभव प्रदान करती हैं। वे दो मुख्य लाभों के कारण अधिक लचीली और प्रबंधन योग्य हैं:
47
+ ## Intlayer को next-i18next के साथ क्यों संयोजित करें?
43
48
 
44
- 1. **लचीला स्थान**: एक Intlayer सामग्री घोषणा फ़ाइल अनुप्रयोग की फ़ाइल वृक्ष में कहीं भी रखी जा सकती है, जिससे अप्रयुक्त सामग्री घोषणाओं को छोड़े बिना दोहराए गए या हटाए गए घटकों का प्रबंधन सरल हो जाता है।
49
+ जबकि Intlayer एक उत्कृष्ट स्टैंडअलोन i18n समाधान प्रदान करता है (हमारे [Next.js इंटीग्रेशन गाइड](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/intlayer_with_nextjs_16.md) देखें), आप इसे कई कारणों से next-i18next के साथ संयोजित करना चाह सकते हैं:
45
50
 
46
- उदाहरण फ़ाइल संरचनाएँ:
51
+ 1. **मौजूदा कोडबेस**: आपके पास एक स्थापित next-i18next कार्यान्वयन है और आप धीरे-धीरे Intlayer के बेहतर डेवलपर अनुभव की ओर माइग्रेट करना चाहते हैं।
52
+ 2. **पुराने आवश्यकताएँ**: आपके प्रोजेक्ट को मौजूदा i18next प्लगइन्स या वर्कफ़्लोज़ के साथ संगतता की आवश्यकता है।
53
+ 3. **टीम की परिचितता**: आपकी टीम next-i18next के साथ सहज है लेकिन बेहतर सामग्री प्रबंधन चाहती है।
47
54
 
48
- ```bash codeFormat="typescript"
49
- .
50
- └── src
51
- └── components
52
- └── MyComponent
53
- ├── index.content.ts # सामग्री घोषणा फ़ाइल
54
- └── index.tsx
55
- ```
55
+ **इसके लिए, Intlayer को next-i18next के लिए एक एडाप्टर के रूप में लागू किया जा सकता है जो CLI या CI/CD पाइपलाइनों में आपके JSON अनुवादों को स्वचालित करने, आपके अनुवादों का परीक्षण करने, और भी बहुत कुछ करने में मदद करता है।**
56
56
 
57
- ```bash codeFormat="esm"
58
- .
59
- └── src
60
- └── components
61
- └── MyComponent
62
- ├── index.content.mjs # सामग्री घोषणा फ़ाइल
63
- └── index.mjx
64
- ```
57
+ यह गाइड आपको दिखाता है कि कैसे Intlayer की श्रेष्ठ कंटेंट घोषणा प्रणाली का लाभ उठाते हुए next-i18next के साथ संगतता बनाए रखी जाए।
65
58
 
66
- ```bash codeFormat="cjs"
67
- .
68
- └── src
69
- └── components
70
- └── MyComponent
71
- ├── index.content.cjs # सामग्री घोषणा फ़ाइल
72
- └── index.cjx
73
- ```
59
+ ---
74
60
 
75
- ```bash codeFormat="json"
76
- .
77
- └── src
78
- └── components
79
- └── MyComponent
80
- ├── index.content.json # सामग्री घोषणा फ़ाइल
81
- └── index.jsx
82
- ```
61
+ ## Intlayer को next-i18next के साथ सेटअप करने के लिए चरण-दर-चरण गाइड
83
62
 
84
- 2. **केंद्रीकृत अनुवाद**: Intlayer सभी अनुवादों को एकल फ़ाइल में संग्रहीत करता है, यह सुनिश्चित करता है कि कोई अनुवाद गायब नहीं है। जब TypeScript का उपयोग किया जाता है, तो गायब अनुवादों का स्वचालित रूप से पता लगाया जाता है और उन्हें त्रुटियों के रूप में रिपोर्ट किया जाता है।
63
+ ### चरण 1: निर्भरताएँ इंस्टॉल करें
85
64
 
86
- ### स्थापना
65
+ अपनी पसंदीदा पैकेज मैनेजर का उपयोग करके आवश्यक पैकेज इंस्टॉल करें:
87
66
 
88
67
  ```bash packageManager="npm"
89
- npm install intlayer i18next next-i18next i18next-resources-to-backend
68
+ npm install intlayer @intlayer/sync-json-plugin
90
69
  ```
91
70
 
92
- ```bash packageManager="yarn"
93
- yarn add intlayer i18next next-i18next i18next-resources-to-backend
71
+ ```bash packageManager="pnpm"
72
+ pnpm add intlayer @intlayer/sync-json-plugin
94
73
  ```
95
74
 
96
- ```bash packageManager="pnpm"
97
- pnpm add intlayer i18next next-i18next i18next-resources-to-backend
75
+ ```bash packageManager="yarn"
76
+ yarn add intlayer @intlayer/sync-json-plugin
98
77
  ```
99
78
 
100
- ### Intlayer को i18next शब्दकोश निर्यात करने के लिए कॉन्फ़िगर करना
79
+ **पैकेज व्याख्याएँ:**
80
+
81
+ - **intlayer**: सामग्री घोषणा और प्रबंधन के लिए कोर लाइब्रेरी
82
+ - **next-intlayer**: Next.js इंटीग्रेशन लेयर बिल्ड प्लगइन्स के साथ
83
+ - **i18next**: कोर i18n फ्रेमवर्क
84
+ - **next-i18next**: i18next के लिए Next.js रैपर
85
+ - **i18next-resources-to-backend**: i18next के लिए डायनामिक रिसोर्स लोडिंग
86
+ - **@intlayer/sync-json-plugin**: Intlayer सामग्री घोषणाओं को i18next JSON फॉर्मेट में सिंक करने के लिए प्लगइन
101
87
 
102
- > i18next संसाधनों का निर्यात अन्य ढांचों के साथ 1:1 संगतता सुनिश्चित नहीं करता है। समस्याओं को कम करने के लिए Intlayer-आधारित कॉन्फ़िगरेशन से चिपके रहना अनुशंसित है।
88
+ ### चरण 2: JSON को रैप करने के लिए Intlayer प्लगइन लागू करें
103
89
 
104
- i18next संसाधनों को निर्यात करने के लिए, एक `intlayer.config.ts` फ़ाइल में Intlayer को कॉन्फ़िगर करें। उदाहरण कॉन्फ़िगरेशन:
90
+ अपने समर्थित लोकल्स को परिभाषित करने के लिए एक Intlayer कॉन्फ़िगरेशन फ़ाइल बनाएं:
105
91
 
106
- ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
92
+ **यदि आप i18next के लिए JSON शब्दकोश भी एक्सपोर्ट करना चाहते हैं**, तो `syncJSON` प्लगइन जोड़ें:
93
+
94
+ ```typescript fileName="intlayer.config.ts"
107
95
  import { Locales, type IntlayerConfig } from "intlayer";
96
+ import { syncJSON } from "@intlayer/sync-json-plugin";
108
97
 
109
98
  const config: IntlayerConfig = {
110
99
  internationalization: {
111
100
  locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
112
101
  defaultLocale: Locales.ENGLISH,
113
102
  },
114
- content: {
115
- dictionaryOutput: ["i18next"],
116
- i18nextResourcesDir: "./i18next/resources",
117
- },
103
+ plugins: [
104
+ syncJSON({
105
+ source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
106
+ }),
107
+ ],
118
108
  };
119
109
 
120
110
  export default config;
121
111
  ```
122
112
 
123
- ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
124
- import { Locales } from "intlayer";
125
-
126
- /** @type {import('intlayer').IntlayerConfig} */
127
- const config = {
128
- internationalization: {
129
- locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
130
- defaultLocale: Locales.ENGLISH,
131
- },
132
- content: {
133
- dictionaryOutput: ["i18next"],
134
- i18nextResourcesDir: "./i18next/resources",
135
- },
136
- };
137
-
138
- export default config;
139
- ```
113
+ `syncJSON` प्लगइन स्वचालित रूप से JSON को रैप करेगा। यह JSON फ़ाइलों को पढ़ेगा और लिखेगा बिना सामग्री संरचना को बदले।
140
114
 
141
- ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
142
- const { Locales } = require("intlayer");
115
+ यदि आप JSON को intlayer सामग्री घोषणा फ़ाइलों (`.content` फ़ाइलें) के साथ सह-अस्तित्व में रखना चाहते हैं, तो Intlayer इस प्रकार आगे बढ़ेगा:
143
116
 
144
- /** @type {import('intlayer').IntlayerConfig} */
145
- const config = {
146
- internationalization: {
147
- locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
148
- defaultLocale: Locales.ENGLISH,
149
- },
150
- content: {
151
- dictionaryOutput: ["i18next"],
152
- i18nextResourcesDir: "./i18next/resources",
153
- },
154
- };
117
+ 1. JSON और सामग्री घोषणा फ़ाइलों दोनों को लोड करेगा और उन्हें intlayer शब्दकोश में परिवर्तित करेगा।
118
+ 2. यदि JSON और सामग्री घोषणा फ़ाइलों के बीच कोई संघर्ष होता है, तो Intlayer उन सभी शब्दकोशों को मर्ज करने की प्रक्रिया करेगा। यह प्लगइन्स की प्राथमिकता और सामग्री घोषणा फ़ाइल की प्राथमिकता पर निर्भर करता है (सभी कॉन्फ़िगर करने योग्य हैं)।
155
119
 
156
- module.exports = config;
157
- ```
120
+ यदि JSON का अनुवाद करने के लिए CLI या CMS का उपयोग करके परिवर्तन किए जाते हैं, तो Intlayer नई अनुवादों के साथ JSON फ़ाइल को अपडेट करेगा।
158
121
 
159
- यहाँ आपके दस्तावेज़ के शेष भागों का निरंतरता और सुधार है:
122
+ `syncJSON` प्लगइन के बारे में अधिक विवरण देखने के लिए, कृपया [syncJSON प्लगइन दस्तावेज़](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/plugins/sync-json.md) देखें।
160
123
 
161
124
  ---
162
125
 
163
- ### आपके i18next कॉन्फ़िगरेशन में शब्दकोशों को आयात करना
164
-
165
- उत्पन्न संसाधनों को आपके i18next कॉन्फ़िगरेशन में आयात करने के लिए, `i18next-resources-to-backend` का उपयोग करें। नीचे उदाहरण दिए गए हैं:
166
-
167
- ```typescript fileName="i18n/client.ts" codeFormat="typescript"
168
- import i18next from "i18next";
169
- import resourcesToBackend from "i18next-resources-to-backend";
170
-
171
- i18next.use(
172
- resourcesToBackend(
173
- (language: string, namespace: string) =>
174
- import(`../i18next/resources/${language}/${namespace}.json`)
175
- )
176
- );
177
- ```
178
-
179
- ```javascript fileName="i18n/client.mjs" codeFormat="esm"
180
- import i18next from "i18next";
181
- import resourcesToBackend from "i18next-resources-to-backend";
182
-
183
- i18next.use(
184
- resourcesToBackend(
185
- (language, namespace) =>
186
- import(`../i18next/resources/${language}/${namespace}.json`)
187
- )
188
- );
189
- ```
190
-
191
- ```javascript fileName="i18n/client.cjs" codeFormat="commonjs"
192
- const i18next = require("i18next");
193
- const resourcesToBackend = require("i18next-resources-to-backend");
194
-
195
- i18next.use(
196
- resourcesToBackend(
197
- (language, namespace) =>
198
- import(`../i18next/resources/${language}/${namespace}.json`)
199
- )
200
- );
201
- ```
202
-
203
- ### सामग्री घोषणा
204
-
205
- विभिन्न प्रारूपों में सामग्री घोषणा फ़ाइलों के उदाहरण:
206
-
207
- ```typescript fileName="**/*.content.ts" contentDeclarationFormat="typescript"
208
- import { t, type Dictionary } from "intlayer";
209
-
210
- const content = {
211
- key: "my-content",
212
- content: {
213
- myTranslatedContent: t({
214
- en: "Hello World",
215
- es: "Hola Mundo",
216
- fr: "Bonjour le monde",
217
- }),
218
- },
219
- } satisfies Dictionary;
220
-
221
- export default content;
222
- ```
223
-
224
- ```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
225
- import { t } from "intlayer";
226
-
227
- /** @type {import('intlayer').Dictionary} */
228
- const content = {
229
- key: "my-content",
230
- content: {
231
- myTranslatedContent: t({
232
- en: "Hello World",
233
- es: "Hola Mundo",
234
- fr: "Bonjour le monde",
235
- }),
236
- },
237
- };
238
- ```
239
-
240
- ```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
241
- const { t } = require("intlayer");
242
-
243
- module.exports = {
244
- key: "my-content",
245
- content: {
246
- myTranslatedContent: t({
247
- en: "Hello World",
248
- es: "Hola Mundo",
249
- fr: "Bonjour le monde",
250
- }),
251
- },
252
- };
253
- ```
254
-
255
- ```json fileName="**/*.content.json" contentDeclarationFormat="json"
256
- {
257
- "$schema": "https://intlayer.org/schema.json",
258
- "key": "my-content",
259
- "content": {
260
- "myTranslatedContent": {
261
- "nodeType": "translation",
262
- "translation": {
263
- "en": "Hello World",
264
- "fr": "Bonjour le monde",
265
- "es": "Hola Mundo"
266
- }
267
- }
268
- }
269
- }
270
- ```
271
-
272
- ### next-i18next संसाधनों का निर्माण
273
-
274
- next-i18next संसाधनों का निर्माण करने के लिए, निम्नलिखित कमांड चलाएँ:
275
-
276
- ```bash packageManager="npm"
277
- npx run intlayer build
278
- ```
279
-
280
- ```bash packageManager="yarn"
281
- yarn intlayer build
282
- ```
283
-
284
- ```bash packageManager="pnpm"
285
- pnpm intlayer build
286
- ```
287
-
288
- यह `./i18next/resources` निर्देशिका में संसाधन उत्पन्न करेगा। अपेक्षित आउटपुट:
289
-
290
- ```bash
291
- .
292
- └── i18next
293
- └── resources
294
- └── en
295
- └── my-content.json
296
- └── fr
297
- └── my-content.json
298
- └── es
299
- └── my-content.json
300
- ```
301
-
302
- नोट: i18next namespace Intlayer घोषणा कुंजी के अनुरूप है।
303
-
304
- ### Next.js प्लगइन का कार्यान्वयन
305
-
306
- एक बार कॉन्फ़िगर हो जाने के बाद, जब भी Intlayer सामग्री घोषणा फ़ाइलें अपडेट होती हैं, तब आपके i18next संसाधनों को फिर से बनाने के लिए Next.js प्लगइन को लागू करें।
307
-
308
- ```typescript fileName="next.config.mjs"
309
- import { withIntlayer } from "next-intlayer/server";
310
-
311
- /** @type {import('next').NextConfig} */
312
- const nextConfig = {};
313
-
314
- export default withIntlayer(nextConfig);
315
- ```
126
+ ## Git कॉन्फ़िगरेशन
316
127
 
317
- ### Next.js घटकों में सामग्री का उपयोग करना
128
+ जनरेट की गई फ़ाइलों को संस्करण नियंत्रण से बाहर करें:
318
129
 
319
- Next.js प्लगइन को लागू करने के बाद, आप अपने घटकों में सामग्री का उपयोग कर सकते हैं:
320
-
321
- ```typescript fileName="src/components/myComponent/index.tsx" codeFormat="typescript"
322
- import type { FC } from "react";
323
- import { useTranslation } from "react-i18next";
324
-
325
- const IndexPage: FC = () => {
326
- const { t } = useTranslation();
327
-
328
- return (
329
- <div>
330
- <h1>{t("my-content.title")}</h1>
331
- <p>{t("my-content.description")}</p>
332
- </div>
333
- );
334
- };
335
-
336
- export default IndexPage;
130
+ ```plaintext fileName=".gitignore"
131
+ # Intlayer द्वारा जनरेट की गई फ़ाइलों को अनदेखा करें
132
+ .intlayer
133
+ intl
337
134
  ```
338
135
 
339
- ```jsx fileName="src/components/myComponent/index.mjx" codeFormat="esm"
340
- import { useTranslation } from "react-i18next";
136
+ ये फ़ाइलें बिल्ड प्रक्रिया के दौरान स्वचालित रूप से पुनः उत्पन्न होती हैं और इन्हें आपके रिपॉजिटरी में कमिट करने की आवश्यकता नहीं है।
341
137
 
342
- const IndexPage = () => {
343
- const { t } = useTranslation();
138
+ ### VS कोड एक्सटेंशन
344
139
 
345
- return (
346
- <div>
347
- <h1>{t("my-content.title")}</h1>
348
- <p>{t("my-content.description")}</p>
349
- </div>
350
- );
351
- };
352
- ```
353
-
354
- ```jsx fileName="src/components/myComponent/index.cjx" codeFormat="commonjs"
355
- const { useTranslation } = require("react-i18next");
356
-
357
- const IndexPage = () => {
358
- const { t } = useTranslation();
140
+ बेहतर डेवलपर अनुभव के लिए, आधिकारिक **Intlayer VS कोड एक्सटेंशन** इंस्टॉल करें:
359
141
 
360
- return (
361
- <div>
362
- <h1>{t("my-content.title")}</h1>
363
- <p>{t("my-content.description")}</p>
364
- </div>
365
- );
366
- };
367
- ```
142
+ [VS कोड मार्केटप्लेस से इंस्टॉल करें](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)