@intlayer/docs 7.0.4-canary.0 → 7.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blog/ar/intlayer_with_i18next.md +68 -106
- package/blog/ar/intlayer_with_next-i18next.md +84 -288
- package/blog/ar/intlayer_with_next-intl.md +58 -337
- package/blog/ar/intlayer_with_react-i18next.md +68 -290
- package/blog/ar/intlayer_with_react-intl.md +63 -266
- package/blog/de/intlayer_with_i18next.md +77 -97
- package/blog/de/intlayer_with_next-i18next.md +69 -296
- package/blog/de/intlayer_with_next-intl.md +59 -340
- package/blog/de/intlayer_with_react-i18next.md +68 -290
- package/blog/de/intlayer_with_react-intl.md +62 -264
- package/blog/en/intlayer_with_i18next.md +36 -1638
- package/blog/en/intlayer_with_next-i18next.md +22 -847
- package/blog/en/intlayer_with_next-intl.md +32 -1053
- package/blog/en/intlayer_with_react-i18next.md +38 -764
- package/blog/en/intlayer_with_react-intl.md +42 -1018
- package/blog/en-GB/intlayer_with_i18next.md +67 -103
- package/blog/en-GB/intlayer_with_next-i18next.md +71 -292
- package/blog/en-GB/intlayer_with_next-intl.md +58 -337
- package/blog/en-GB/intlayer_with_react-i18next.md +67 -289
- package/blog/en-GB/intlayer_with_react-intl.md +61 -264
- package/blog/es/intlayer_with_i18next.md +67 -103
- package/blog/es/intlayer_with_next-i18next.md +71 -296
- package/blog/es/intlayer_with_next-intl.md +57 -338
- package/blog/es/intlayer_with_react-i18next.md +68 -290
- package/blog/es/intlayer_with_react-intl.md +62 -265
- package/blog/fr/intlayer_with_i18next.md +66 -104
- package/blog/fr/intlayer_with_next-i18next.md +82 -285
- package/blog/fr/intlayer_with_next-intl.md +57 -338
- package/blog/fr/intlayer_with_react-i18next.md +67 -289
- package/blog/fr/intlayer_with_react-intl.md +61 -264
- package/blog/hi/intlayer_with_i18next.md +68 -104
- package/blog/hi/intlayer_with_next-i18next.md +74 -299
- package/blog/hi/intlayer_with_next-intl.md +57 -239
- package/blog/hi/intlayer_with_react-i18next.md +69 -291
- package/blog/hi/intlayer_with_react-intl.md +65 -268
- package/blog/id/intlayer_with_i18next.md +126 -0
- package/blog/id/intlayer_with_next-i18next.md +142 -0
- package/blog/id/intlayer_with_next-intl.md +113 -0
- package/blog/id/intlayer_with_react-i18next.md +124 -0
- package/blog/id/intlayer_with_react-intl.md +122 -0
- package/blog/it/intlayer_with_i18next.md +67 -103
- package/blog/it/intlayer_with_next-i18next.md +71 -296
- package/blog/it/intlayer_with_next-intl.md +57 -338
- package/blog/it/intlayer_with_react-i18next.md +68 -290
- package/blog/it/intlayer_with_react-intl.md +62 -265
- package/blog/ja/intlayer_with_i18next.md +68 -103
- package/blog/ja/intlayer_with_next-i18next.md +85 -283
- package/blog/ja/intlayer_with_next-intl.md +58 -336
- package/blog/ja/intlayer_with_react-i18next.md +68 -290
- package/blog/ja/intlayer_with_react-intl.md +62 -264
- package/blog/ko/intlayer_with_i18next.md +80 -96
- package/blog/ko/intlayer_with_next-i18next.md +85 -287
- package/blog/ko/intlayer_with_next-intl.md +68 -327
- package/blog/ko/intlayer_with_react-i18next.md +68 -290
- package/blog/ko/intlayer_with_react-intl.md +64 -266
- package/blog/pl/intlayer_with_i18next.md +126 -0
- package/blog/pl/intlayer_with_next-i18next.md +142 -0
- package/blog/pl/intlayer_with_next-intl.md +111 -0
- package/blog/pl/intlayer_with_react-i18next.md +124 -0
- package/blog/pl/intlayer_with_react-intl.md +122 -0
- package/blog/pt/intlayer_with_i18next.md +67 -103
- package/blog/pt/intlayer_with_next-i18next.md +72 -293
- package/blog/pt/intlayer_with_next-intl.md +57 -256
- package/blog/pt/intlayer_with_react-i18next.md +104 -78
- package/blog/pt/intlayer_with_react-intl.md +62 -266
- package/blog/ru/intlayer_with_i18next.md +66 -104
- package/blog/ru/intlayer_with_next-i18next.md +71 -296
- package/blog/ru/intlayer_with_next-intl.md +58 -337
- package/blog/ru/intlayer_with_react-i18next.md +68 -290
- package/blog/ru/intlayer_with_react-intl.md +62 -265
- package/blog/tr/intlayer_with_i18next.md +71 -107
- package/blog/tr/intlayer_with_next-i18next.md +72 -297
- package/blog/tr/intlayer_with_next-intl.md +58 -339
- package/blog/tr/intlayer_with_react-i18next.md +69 -291
- package/blog/tr/intlayer_with_react-intl.md +63 -285
- package/blog/vi/intlayer_with_i18next.md +126 -0
- package/blog/vi/intlayer_with_next-i18next.md +142 -0
- package/blog/vi/intlayer_with_next-intl.md +111 -0
- package/blog/vi/intlayer_with_react-i18next.md +124 -0
- package/blog/vi/intlayer_with_react-intl.md +122 -0
- package/blog/zh/intlayer_with_i18next.md +67 -102
- package/blog/zh/intlayer_with_next-i18next.md +72 -296
- package/blog/zh/intlayer_with_next-intl.md +58 -336
- package/blog/zh/intlayer_with_react-i18next.md +68 -290
- package/blog/zh/intlayer_with_react-intl.md +63 -106
- package/docs/ar/plugins/sync-json.md +244 -0
- package/docs/de/plugins/sync-json.md +244 -0
- package/docs/en/intlayer_cli.md +25 -0
- package/docs/en/intlayer_with_nextjs_14.md +2 -0
- package/docs/en/intlayer_with_nextjs_15.md +2 -0
- package/docs/en/intlayer_with_nextjs_16.md +2 -0
- package/docs/en/plugins/sync-json.md +1 -1
- package/docs/en-GB/plugins/sync-json.md +244 -0
- package/docs/es/plugins/sync-json.md +244 -0
- package/docs/fr/plugins/sync-json.md +244 -0
- package/docs/hi/plugins/sync-json.md +244 -0
- package/docs/id/plugins/sync-json.md +244 -0
- package/docs/it/plugins/sync-json.md +244 -0
- package/docs/ja/plugins/sync-json.md +244 -0
- package/docs/ko/plugins/sync-json.md +244 -0
- package/docs/pl/plugins/sync-json.md +244 -0
- package/docs/pt/plugins/sync-json.md +244 -0
- package/docs/ru/plugins/sync-json.md +244 -0
- package/docs/tr/plugins/sync-json.md +245 -0
- package/docs/vi/plugins/sync-json.md +244 -0
- package/docs/zh/plugins/sync-json.md +244 -0
- package/package.json +14 -14
|
@@ -1,293 +1,111 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-01-02
|
|
3
|
-
updatedAt: 2025-
|
|
4
|
-
title: Intlayer
|
|
5
|
-
description:
|
|
6
|
-
keywords:
|
|
7
|
-
- next-intl
|
|
8
|
-
- Intlayer
|
|
9
|
-
- अंतर्राष्ट्रीयकरण
|
|
10
|
-
- दस्तावेज़ीकरण
|
|
11
|
-
- Next.js
|
|
12
|
-
- JavaScript
|
|
13
|
-
- React
|
|
3
|
+
updatedAt: 2025-10-29
|
|
4
|
+
title: Intlayer का उपयोग करके अपने next-intl JSON अनुवादों को स्वचालित कैसे करें
|
|
5
|
+
description: Next.js अनुप्रयोगों में बेहतर अंतरराष्ट्रीयकरण के लिए Intlayer और next-intl के साथ अपने JSON अनुवादों को स्वचालित करें।
|
|
14
6
|
slugs:
|
|
15
7
|
- blog
|
|
16
8
|
- intlayer-with-next-intl
|
|
9
|
+
history:
|
|
10
|
+
- version: 7.0.0
|
|
11
|
+
date: 2025-10-29
|
|
12
|
+
changes: syncJSON प्लगइन में बदलाव
|
|
17
13
|
---
|
|
18
14
|
|
|
19
|
-
#
|
|
15
|
+
# Intlayer का उपयोग करके अपने next-intl JSON अनुवादों को स्वचालित कैसे करें
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
## Intlayer क्या है?
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
**Intlayer** एक अभिनव, ओपन-सोर्स अंतरराष्ट्रीयकरण लाइब्रेरी है जिसे पारंपरिक i18n समाधानों की कमियों को दूर करने के लिए डिज़ाइन किया गया है। यह Next.js अनुप्रयोगों में सामग्री प्रबंधन के लिए एक आधुनिक दृष्टिकोण प्रदान करता है।
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
- Intlayer में इसे `सामग्री घोषणा फ़ाइल` कहा जाता है, जो JSON, JS, या TS फ़ाइल हो सकती है जो संरचित डेटा निर्यात करती है। अधिक जानकारी के लिए [Intlayer दस्तावेज़](https://intlayer.org/fr/doc/concept/content) देखें।
|
|
27
|
-
- next-intl में इसे `messages` या `locale messages` कहा जाता है, जो आमतौर पर JSON फ़ाइलों में होती हैं। अधिक जानकारी के लिए [next-intl दस्तावेज़](https://github.com/amannn/next-intl) देखें।
|
|
21
|
+
हमारे [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 के साथ एक ठोस तुलना देखें।
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
## Intlayer को next-intl के साथ क्यों मिलाएं?
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
जबकि Intlayer एक उत्कृष्ट स्वतंत्र i18n समाधान प्रदान करता है (हमारे [Next.js एकीकरण गाइड](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/intlayer_with_nextjs_16.md) देखें), आप इसे कई कारणों से next-intl के साथ मिलाना चाह सकते हैं:
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
1. **मौजूदा कोडबेस**: आपके पास एक स्थापित next-intl कार्यान्वयन है और आप धीरे-धीरे Intlayer के बेहतर डेवलपर अनुभव की ओर माइग्रेट करना चाहते हैं।
|
|
28
|
+
2. **पुराने आवश्यकताएं**: आपके प्रोजेक्ट को मौजूदा next-intl प्लगइन्स या वर्कफ़्लोज़ के साथ संगतता की आवश्यकता है।
|
|
29
|
+
3. **टीम की परिचितता**: आपकी टीम next-intl के साथ सहज है लेकिन बेहतर सामग्री प्रबंधन चाहती है।
|
|
34
30
|
|
|
35
|
-
Intlayer
|
|
31
|
+
**इसके लिए, Intlayer को next-intl के लिए एक एडाप्टर के रूप में लागू किया जा सकता है ताकि CLI या CI/CD पाइपलाइनों में आपके JSON अनुवादों को स्वचालित करने, आपके अनुवादों का परीक्षण करने और अधिक में मदद मिल सके।**
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
यह गाइड आपको दिखाता है कि कैसे Intlayer की श्रेष्ठ सामग्री घोषणा प्रणाली का लाभ उठाते हुए next-intl के साथ संगतता बनाए रखी जाए।
|
|
38
34
|
|
|
39
|
-
|
|
35
|
+
## सामग्री सूची
|
|
40
36
|
|
|
41
|
-
|
|
37
|
+
<TOC/>
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
## next-intl के साथ Intlayer सेटअप करने के लिए चरण-दर-चरण गाइड
|
|
44
40
|
|
|
45
|
-
|
|
41
|
+
### चरण 1: निर्भरताएँ स्थापित करें
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
.
|
|
49
|
-
└── src
|
|
50
|
-
└── components
|
|
51
|
-
└── MyComponent
|
|
52
|
-
├── index.content.ts # सामग्री घोषणा फ़ाइल
|
|
53
|
-
└── index.tsx
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
```bash codeFormat="esm"
|
|
57
|
-
.
|
|
58
|
-
└── src
|
|
59
|
-
└── components
|
|
60
|
-
└── MyComponent
|
|
61
|
-
├── index.content.mjs # सामग्री घोषणा फ़ाइल
|
|
62
|
-
└── index.mjx
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
```bash codeFormat="cjs"
|
|
66
|
-
.
|
|
67
|
-
└── src
|
|
68
|
-
└── components
|
|
69
|
-
└── MyComponent
|
|
70
|
-
├── index.content.cjs # सामग्री घोषणा फ़ाइल
|
|
71
|
-
└── index.cjx
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
```bash codeFormat="json"
|
|
75
|
-
.
|
|
76
|
-
└── src
|
|
77
|
-
└── components
|
|
78
|
-
└── MyComponent
|
|
79
|
-
├── index.content.json # सामग्री घोषणा फ़ाइल
|
|
80
|
-
└── index.jsx
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
2. **केंद्रीकृत अनुवाद**: Intlayer सभी अनुवादों को एकल सामग्री घोषणा में संग्रहीत करती है, यह सुनिश्चित करते हुए कि कोई अनुवाद गायब न हो। TypeScript परियोजनाओं में, गायब अनुवादों को प्रकार त्रुटियों के रूप में स्वचालित रूप से चिह्नित किया जाता है, जिससे डेवलपर्स को तुरंत फीडबैक मिलता है।
|
|
84
|
-
|
|
85
|
-
### स्थापना
|
|
86
|
-
|
|
87
|
-
Intlayer और next-intl का उपयोग करने के लिए, दोनों पुस्तकालयों को स्थापित करें:
|
|
43
|
+
आवश्यक पैकेज इंस्टॉल करें:
|
|
88
44
|
|
|
89
45
|
```bash packageManager="npm"
|
|
90
|
-
npm install intlayer
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
```bash packageManager="yarn"
|
|
94
|
-
yarn add intlayer next-intl
|
|
46
|
+
npm install intlayer @intlayer/sync-json-plugin
|
|
95
47
|
```
|
|
96
48
|
|
|
97
49
|
```bash packageManager="pnpm"
|
|
98
|
-
pnpm add intlayer
|
|
50
|
+
pnpm add intlayer @intlayer/sync-json-plugin
|
|
99
51
|
```
|
|
100
52
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
अपने प्रोजेक्ट की जड़ में एक `intlayer.config.ts` फ़ाइल (या `.mjs` / `.cjs`) बनाएं या अपडेट करें:
|
|
106
|
-
|
|
107
|
-
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
108
|
-
import { Locales, type IntlayerConfig } from "intlayer";
|
|
53
|
+
```bash packageManager="yarn"
|
|
54
|
+
yarn add intlayer @intlayer/sync-json-plugin
|
|
55
|
+
```
|
|
109
56
|
|
|
110
|
-
|
|
111
|
-
internationalization: {
|
|
112
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
113
|
-
defaultLocale: Locales.ENGLISH,
|
|
114
|
-
},
|
|
115
|
-
content: {
|
|
116
|
-
dictionaryOutput: ["next-intl"], // next-intl आउटपुट का उपयोग करें
|
|
117
|
-
nextIntlMessagesDir: "./intl/messages", // जहां next-intl संदेशों को सहेजना है
|
|
118
|
-
},
|
|
119
|
-
};
|
|
57
|
+
**पैकेज विवरण:**
|
|
120
58
|
|
|
121
|
-
|
|
122
|
-
|
|
59
|
+
- **intlayer**: अंतरराष्ट्रीयकरण प्रबंधन, सामग्री घोषणा, और निर्माण के लिए मुख्य पुस्तकालय
|
|
60
|
+
- **@intlayer/sync-json-plugin**: Intlayer सामग्री घोषणाओं को next-intl संगत JSON प्रारूप में निर्यात करने के लिए प्लगइन
|
|
123
61
|
|
|
124
|
-
|
|
125
|
-
import { Locales } from "intlayer";
|
|
62
|
+
### चरण 2: JSON को लपेटने के लिए Intlayer प्लगइन लागू करें
|
|
126
63
|
|
|
127
|
-
|
|
128
|
-
const config = {
|
|
129
|
-
internationalization: {
|
|
130
|
-
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
131
|
-
defaultLocale: Locales.ENGLISH,
|
|
132
|
-
},
|
|
133
|
-
content: {
|
|
134
|
-
dictionaryOutput: ["react-intl"],
|
|
135
|
-
nextIntlMessagesDir: "./intl/messages",
|
|
136
|
-
},
|
|
137
|
-
};
|
|
64
|
+
अपने समर्थित लोकल्स को परिभाषित करने के लिए एक Intlayer कॉन्फ़िगरेशन फ़ाइल बनाएं:
|
|
138
65
|
|
|
139
|
-
|
|
140
|
-
```
|
|
66
|
+
**यदि आप next-intl के लिए JSON शब्दकोश भी निर्यात करना चाहते हैं**, तो `syncJSON` प्लगइन जोड़ें:
|
|
141
67
|
|
|
142
|
-
```
|
|
143
|
-
|
|
68
|
+
```typescript fileName="intlayer.config.ts"
|
|
69
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
70
|
+
import { syncJSON } from "@intlayer/sync-json-plugin";
|
|
144
71
|
|
|
145
|
-
|
|
146
|
-
const config = {
|
|
72
|
+
const config: IntlayerConfig = {
|
|
147
73
|
internationalization: {
|
|
148
74
|
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
149
75
|
defaultLocale: Locales.ENGLISH,
|
|
150
76
|
},
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
module.exports = config;
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### सामग्री घोषणा
|
|
161
|
-
|
|
162
|
-
नीचे विभिन्न प्रारूपों में सामग्री घोषणा फ़ाइलों के उदाहरण दिए गए हैं। Intlayer इन्हें संदेश फ़ाइलों में संकलित करेगा जिन्हें next-intl उपभोग कर सकता है।
|
|
163
|
-
|
|
164
|
-
```typescript fileName="**/*.content.ts" contentDeclarationFormat="typescript"
|
|
165
|
-
import { t, type Dictionary } from "intlayer";
|
|
166
|
-
|
|
167
|
-
const content = {
|
|
168
|
-
key: "my-component",
|
|
169
|
-
content: {
|
|
170
|
-
helloWorld: t({
|
|
171
|
-
en: "Hello World",
|
|
172
|
-
es: "Hola Mundo",
|
|
173
|
-
fr: "Bonjour le monde",
|
|
77
|
+
plugins: [
|
|
78
|
+
syncJSON({
|
|
79
|
+
source: ({ key, locale }) => `./messages/${locale}/${key}.json`,
|
|
174
80
|
}),
|
|
175
|
-
|
|
176
|
-
} satisfies Dictionary;
|
|
177
|
-
|
|
178
|
-
export default content;
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
|
|
182
|
-
import { t } from "intlayer";
|
|
183
|
-
|
|
184
|
-
/** @type {import('intlayer').Dictionary} */
|
|
185
|
-
const content = {
|
|
186
|
-
key: "my-component",
|
|
187
|
-
content: {
|
|
188
|
-
helloWorld: t({
|
|
189
|
-
en: "Hello World",
|
|
190
|
-
es: "Hola Mundo",
|
|
191
|
-
fr: "Bonjour le monde",
|
|
192
|
-
}),
|
|
193
|
-
},
|
|
81
|
+
],
|
|
194
82
|
};
|
|
195
83
|
|
|
196
|
-
export default
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
|
|
200
|
-
const { t } = require("intlayer");
|
|
201
|
-
|
|
202
|
-
module.exports = {
|
|
203
|
-
key: "my-component",
|
|
204
|
-
content: {
|
|
205
|
-
helloWorld: t({
|
|
206
|
-
en: "Hello World",
|
|
207
|
-
es: "Hola Mundo",
|
|
208
|
-
fr: "Bonjour le monde",
|
|
209
|
-
}),
|
|
210
|
-
},
|
|
211
|
-
};
|
|
84
|
+
export default config;
|
|
212
85
|
```
|
|
213
86
|
|
|
214
|
-
|
|
215
|
-
{
|
|
216
|
-
"$schema": "https://intlayer.org/schema.json",
|
|
217
|
-
"key": "my-component",
|
|
218
|
-
"content": {
|
|
219
|
-
"helloWorld": {
|
|
220
|
-
"nodeType": "translation",
|
|
221
|
-
"translation": {
|
|
222
|
-
"en": "Hello World",
|
|
223
|
-
"fr": "Bonjour le monde",
|
|
224
|
-
"es": "Hola Mundo"
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
```
|
|
87
|
+
`syncJSON` प्लगइन स्वचालित रूप से JSON को लपेटेगा। यह JSON फ़ाइलों को पढ़ेगा और लिखेगा बिना सामग्री संरचना को बदले।
|
|
230
88
|
|
|
231
|
-
|
|
89
|
+
यदि आप उस JSON को intlayer सामग्री घोषणा फ़ाइलों (`.content` फ़ाइलें) के साथ सह-अस्तित्व में रखना चाहते हैं, तो Intlayer इस प्रकार आगे बढ़ेगा:
|
|
232
90
|
|
|
233
|
-
|
|
91
|
+
1. JSON और सामग्री घोषणा दोनों फ़ाइलों को लोड करेगा और उन्हें intlayer शब्दकोश में परिवर्तित करेगा।
|
|
92
|
+
2. यदि JSON और सामग्री घोषणा फ़ाइलों के बीच कोई संघर्ष होता है, तो Intlayer उन सभी शब्दकोशों को मर्ज करने की प्रक्रिया करेगा। यह प्लगइन्स की प्राथमिकता और सामग्री घोषणा फ़ाइल की प्राथमिकता पर निर्भर करता है (सभी कॉन्फ़िगर करने योग्य हैं)।
|
|
234
93
|
|
|
235
|
-
|
|
236
|
-
npx intlayer dictionaries build
|
|
237
|
-
```
|
|
94
|
+
यदि JSON का अनुवाद करने के लिए CLI का उपयोग करके या CMS का उपयोग करके परिवर्तन किए जाते हैं, तो Intlayer नई अनुवादों के साथ JSON फ़ाइल को अपडेट करेगा।
|
|
238
95
|
|
|
239
|
-
|
|
240
|
-
yarn intlayer build
|
|
241
|
-
```
|
|
96
|
+
## Git कॉन्फ़िगरेशन
|
|
242
97
|
|
|
243
|
-
|
|
244
|
-
pnpm intlayer build
|
|
245
|
-
```
|
|
98
|
+
स्वचालित रूप से उत्पन्न Intlayer फ़ाइलों को अनदेखा करने की सलाह दी जाती है:
|
|
246
99
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
.
|
|
251
|
-
└── intl
|
|
252
|
-
└── messages
|
|
253
|
-
└── hi
|
|
254
|
-
└── my-content.json
|
|
255
|
-
└── fr
|
|
256
|
-
└── my-content.json
|
|
257
|
-
└── es
|
|
258
|
-
└── my-content.json
|
|
100
|
+
```plaintext fileName=".gitignore"
|
|
101
|
+
# Intlayer द्वारा उत्पन्न फ़ाइलों को अनदेखा करें
|
|
102
|
+
.intlayer
|
|
259
103
|
```
|
|
260
104
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
### अपने Next.js ऐप में next-intl का उपयोग करना
|
|
264
|
-
|
|
265
|
-
> अधिक विवरण के लिए, आधिकारिक [next-intl उपयोग दस्तावेज़](https://github.com/amannn/next-intl#readme) देखें।
|
|
266
|
-
|
|
267
|
-
1. **एक Middleware बनाएँ (वैकल्पिक):**
|
|
268
|
-
यदि आप स्वचालित स्थानीयकरण पहचान या रीडायरेक्शन प्रबंधित करना चाहते हैं, तो next-intl के [createMiddleware](https://github.com/amannn/next-intl#createMiddleware) का उपयोग करें।
|
|
269
|
-
|
|
270
|
-
```typescript fileName="middleware.ts"
|
|
271
|
-
import createMiddleware from "next-intl/middleware";
|
|
272
|
-
import { NextResponse } from "next/server";
|
|
273
|
-
|
|
274
|
-
export default createMiddleware({
|
|
275
|
-
locales: ["en", "fr", "es"],
|
|
276
|
-
defaultLocale: "en",
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
export const config = {
|
|
280
|
-
matcher: ["/((?!api|_next|.*\\..*).*)"],
|
|
281
|
-
};
|
|
282
|
-
```
|
|
105
|
+
ये फ़ाइलें आपके बिल्ड प्रक्रिया के दौरान पुनः उत्पन्न की जा सकती हैं और इन्हें संस्करण नियंत्रण में कमिट करने की आवश्यकता नहीं है।
|
|
283
106
|
|
|
284
|
-
|
|
285
|
-
यदि आप ऐप राउटर (Next.js 13+) का उपयोग कर रहे हैं, तो एक लेआउट बनाएँ:
|
|
107
|
+
### VS कोड एक्सटेंशन
|
|
286
108
|
|
|
287
|
-
|
|
288
|
-
import { NextIntlClientProvider } from 'next-intl';
|
|
289
|
-
import { notFound } from 'next/navigation';
|
|
290
|
-
import React, { ReactNode } from 'react';
|
|
109
|
+
बेहतर डेवलपर अनुभव के लिए, आधिकारिक **Intlayer VS Code एक्सटेंशन** इंस्टॉल करें:
|
|
291
110
|
|
|
292
|
-
|
|
293
|
-
```
|
|
111
|
+
[VS कोड मार्केटप्लेस से इंस्टॉल करें](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|