@intlayer/docs 7.3.10 → 7.3.12
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/dist/cjs/generated/docs.entry.cjs +19 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +19 -0
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +1 -0
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/docs/ar/intlayer_with_nuxt.md +305 -421
- package/docs/ar/intlayer_with_react_router_v7.md +33 -4
- package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +516 -0
- package/docs/ar/intlayer_with_tanstack.md +2 -12
- package/docs/ar/intlayer_with_vite+vue.md +1 -0
- package/docs/de/intlayer_with_nuxt.md +296 -394
- package/docs/de/intlayer_with_react_router_v7.md +33 -4
- package/docs/de/intlayer_with_react_router_v7_fs_routes.md +573 -0
- package/docs/de/intlayer_with_tanstack.md +1 -0
- package/docs/de/intlayer_with_vite+vue.md +1 -0
- package/docs/en/intlayer_with_nuxt.md +242 -321
- package/docs/en/intlayer_with_react_router_v7.md +24 -0
- package/docs/en/intlayer_with_react_router_v7_fs_routes.md +570 -0
- package/docs/en/intlayer_with_tanstack.md +2 -12
- package/docs/en/intlayer_with_vite+vue.md +49 -48
- package/docs/en-GB/intlayer_with_nuxt.md +262 -358
- package/docs/en-GB/intlayer_with_react_router_v7.md +33 -4
- package/docs/en-GB/intlayer_with_react_router_v7_fs_routes.md +513 -0
- package/docs/en-GB/intlayer_with_tanstack.md +2 -12
- package/docs/en-GB/intlayer_with_vite+vue.md +1 -0
- package/docs/es/intlayer_with_nuxt.md +284 -375
- package/docs/es/intlayer_with_react_router_v7.md +33 -4
- package/docs/es/intlayer_with_react_router_v7_fs_routes.md +575 -0
- package/docs/es/intlayer_with_tanstack.md +1 -0
- package/docs/es/intlayer_with_vite+vue.md +1 -2
- package/docs/fr/intlayer_with_nuxt.md +288 -387
- package/docs/fr/intlayer_with_react_router_v7.md +34 -5
- package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +574 -0
- package/docs/fr/intlayer_with_tanstack.md +1 -0
- package/docs/fr/intlayer_with_vite+vue.md +1 -0
- package/docs/hi/intlayer_with_nuxt.md +318 -434
- package/docs/hi/intlayer_with_react_router_v7.md +33 -4
- package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +518 -0
- package/docs/hi/intlayer_with_tanstack.md +2 -12
- package/docs/hi/intlayer_with_vite+vue.md +1 -0
- package/docs/id/intlayer_with_nuxt.md +275 -376
- package/docs/id/intlayer_with_react_router_v7.md +29 -4
- package/docs/id/intlayer_with_react_router_v7_fs_routes.md +521 -0
- package/docs/id/intlayer_with_tanstack.md +2 -12
- package/docs/id/intlayer_with_vite+vue.md +1 -0
- package/docs/it/intlayer_with_nuxt.md +312 -408
- package/docs/it/intlayer_with_react_router_v7.md +33 -4
- package/docs/it/intlayer_with_react_router_v7_fs_routes.md +574 -0
- package/docs/it/intlayer_with_tanstack.md +1 -0
- package/docs/ja/intlayer_with_nuxt.md +319 -414
- package/docs/ja/intlayer_with_react_router_v7.md +33 -4
- package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +574 -0
- package/docs/ja/intlayer_with_tanstack.md +2 -12
- package/docs/ja/intlayer_with_vite+vue.md +1 -0
- package/docs/ko/intlayer_with_nuxt.md +307 -406
- package/docs/ko/intlayer_with_react_router_v7.md +33 -4
- package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +515 -0
- package/docs/ko/intlayer_with_tanstack.md +2 -12
- package/docs/ko/intlayer_with_vite+vue.md +1 -0
- package/docs/pl/intlayer_with_nuxt.md +282 -457
- package/docs/pl/intlayer_with_react_router_v7.md +32 -5
- package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +615 -0
- package/docs/pl/intlayer_with_tanstack.md +2 -12
- package/docs/pl/intlayer_with_vite+vue.md +1 -0
- package/docs/pt/intlayer_with_nuxt.md +288 -403
- package/docs/pt/intlayer_with_react_router_v7.md +28 -0
- package/docs/pt/intlayer_with_tanstack.md +1 -0
- package/docs/ru/intlayer_with_nuxt.md +300 -410
- package/docs/ru/intlayer_with_react_router_v7.md +33 -4
- package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +574 -0
- package/docs/ru/intlayer_with_tanstack.md +1 -0
- package/docs/ru/intlayer_with_vite+vue.md +1 -0
- package/docs/tr/intlayer_with_nuxt.md +327 -392
- package/docs/tr/intlayer_with_react_router_v7.md +33 -4
- package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +572 -0
- package/docs/tr/intlayer_with_tanstack.md +2 -12
- package/docs/tr/intlayer_with_vite+vue.md +1 -0
- package/docs/vi/intlayer_with_nuxt.md +282 -399
- package/docs/vi/intlayer_with_react_router_v7.md +29 -4
- package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +523 -0
- package/docs/vi/intlayer_with_tanstack.md +2 -12
- package/docs/vi/intlayer_with_vite+vue.md +1 -0
- package/docs/zh/intlayer_with_nuxt.md +311 -444
- package/docs/zh/intlayer_with_react_router_v7.md +33 -4
- package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +516 -0
- package/docs/zh/intlayer_with_tanstack.md +2 -12
- package/docs/zh/intlayer_with_vite+vue.md +1 -0
- package/package.json +6 -6
- package/src/generated/docs.entry.ts +19 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-06-18
|
|
3
|
-
updatedAt: 2025-
|
|
4
|
-
title:
|
|
3
|
+
updatedAt: 2025-12-07
|
|
4
|
+
title: अपने Nuxt और Vue ऐप का अनुवाद कैसे करें – i18n गाइड 2025
|
|
5
5
|
description: जानें कि अपनी Nuxt और Vue वेबसाइट को बहुभाषी कैसे बनाएं। अंतरराष्ट्रीयकरण (i18n) और अनुवाद के लिए दस्तावेज़ का पालन करें।
|
|
6
6
|
keywords:
|
|
7
7
|
- अंतरराष्ट्रीयकरण
|
|
@@ -14,35 +14,70 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- nuxt-and-vue
|
|
17
|
-
applicationTemplate: https://github.com/aymericzip/intlayer-nuxt-template
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-nuxt-4-template
|
|
18
|
+
youtubeVideo: https://www.youtube.com/watch?v=IE3XWkZ6a5U
|
|
18
19
|
history:
|
|
20
|
+
- version: 7.3.11
|
|
21
|
+
date: 2025-12-07
|
|
22
|
+
changes: LocaleSwitcher, SEO, मेटाडेटा अपडेट करें
|
|
19
23
|
- version: 5.5.10
|
|
20
24
|
date: 2025-06-29
|
|
21
|
-
changes:
|
|
25
|
+
changes: इतिहास प्रारंभ करें
|
|
22
26
|
---
|
|
23
27
|
|
|
24
|
-
# Intlayer
|
|
28
|
+
# Intlayer का उपयोग करके अपनी Nuxt और Vue वेबसाइट का अनुवाद करें | अंतरराष्ट्रीयकरण (i18n)
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
## सामग्री तालिका
|
|
31
|
+
|
|
32
|
+
<TOC/>
|
|
27
33
|
|
|
28
34
|
## Intlayer क्या है?
|
|
29
35
|
|
|
30
|
-
**Intlayer** एक अभिनव, ओपन-सोर्स अंतरराष्ट्रीयकरण (i18n) लाइब्रेरी है जिसे आधुनिक वेब
|
|
36
|
+
**Intlayer** एक अभिनव, ओपन-सोर्स अंतरराष्ट्रीयकरण (i18n) लाइब्रेरी है जिसे आधुनिक वेब एप्लिकेशन में बहुभाषी समर्थन को सरल बनाने के लिए डिज़ाइन किया गया है।
|
|
31
37
|
|
|
32
38
|
Intlayer के साथ, आप कर सकते हैं:
|
|
33
39
|
|
|
34
|
-
- **घोषणात्मक शब्दकोशों का उपयोग करके अनुवादों का आसानी से प्रबंधन करें** जो कंपोनेंट स्तर पर होते हैं।
|
|
35
|
-
- **मेटाडेटा, रूट्स, और सामग्री को गतिशील रूप से स्थानीयकृत
|
|
36
|
-
- **TypeScript समर्थन सुनिश्चित करें** ऑटो-जेनरेटेड प्रकारों के साथ,
|
|
37
|
-
- **उन्नत
|
|
40
|
+
- **घोषणात्मक शब्दकोशों का उपयोग करके अनुवादों का आसानी से प्रबंधन करें** जो कि कंपोनेंट स्तर पर होते हैं।
|
|
41
|
+
- **मेटाडेटा, रूट्स, और सामग्री को गतिशील रूप से स्थानीयकृत करें।**
|
|
42
|
+
- **TypeScript समर्थन सुनिश्चित करें** ऑटो-जेनरेटेड प्रकारों के साथ, जिससे ऑटो-कम्प्लीशन और त्रुटि पहचान में सुधार होता है।
|
|
43
|
+
- **उन्नत सुविधाओं का लाभ उठाएं**, जैसे गतिशील लोकल डिटेक्शन और स्विचिंग।
|
|
38
44
|
|
|
39
45
|
---
|
|
40
46
|
|
|
41
47
|
## Nuxt एप्लिकेशन में Intlayer सेटअप करने के लिए चरण-दर-चरण मार्गदर्शिका
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
<iframe
|
|
50
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-nuxt-4-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
51
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
52
|
+
title="डेमो कोडसैंडबॉक्स - Intlayer का उपयोग करके अपने एप्लिकेशन का अंतरराष्ट्रीयकरण कैसे करें"
|
|
53
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
54
|
+
loading="lazy"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
### चरण 1: Dependencies इंस्टॉल करें
|
|
58
|
+
|
|
59
|
+
<Tab defaultTab="video">
|
|
60
|
+
<TabItem label="वीडियो" value="video">
|
|
61
|
+
|
|
62
|
+
<iframe title="अपने Nuxt और Vue ऐप को Intlayer का उपयोग करके कैसे अनुवादित करें? Intlayer की खोज करें" class="m-auto aspect-[16/9] w-full overflow-hidden rounded-lg border-0" allow="autoplay; gyroscope;" loading="lazy" width="1080" height="auto" src="https://www.youtube.com/embed/IE3XWkZ6a5U?autoplay=0&origin=http://intlayer.org&controls=0&rel=1"/>
|
|
63
|
+
|
|
64
|
+
</TabItem>
|
|
65
|
+
<TabItem label="कोड" value="code">
|
|
66
|
+
|
|
67
|
+
<iframe
|
|
68
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-nuxt-4-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
69
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
70
|
+
title="डेमो कोडसैंडबॉक्स - Intlayer का उपयोग करके अपने एप्लिकेशन का अंतरराष्ट्रीयकरण कैसे करें"
|
|
71
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
72
|
+
loading="lazy"
|
|
73
|
+
/>
|
|
74
|
+
|
|
75
|
+
</TabItem>
|
|
76
|
+
</Tab>
|
|
77
|
+
|
|
78
|
+
GitHub पर [एप्लिकेशन टेम्पलेट](https://github.com/aymericzip/intlayer-nuxt-4-template) देखें।
|
|
44
79
|
|
|
45
|
-
npm का उपयोग करके आवश्यक पैकेज
|
|
80
|
+
npm का उपयोग करके आवश्यक पैकेज इंस्टॉल करें:
|
|
46
81
|
|
|
47
82
|
```bash packageManager="npm"
|
|
48
83
|
npm install intlayer vue-intlayer
|
|
@@ -61,10 +96,10 @@ yarn add --save-dev nuxt-intlayer
|
|
|
61
96
|
|
|
62
97
|
- **intlayer**
|
|
63
98
|
|
|
64
|
-
|
|
99
|
+
कोर पैकेज जो कॉन्फ़िगरेशन प्रबंधन, अनुवाद, [सामग्री घोषणा](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/dictionary/content_file.md), ट्रांसपाइलेशन, और [CLI कमांड्स](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/cli/index.md) के लिए अंतरराष्ट्रीयकरण उपकरण प्रदान करता है।
|
|
65
100
|
|
|
66
101
|
- **vue-intlayer**
|
|
67
|
-
वह पैकेज जो Intlayer को Vue एप्लिकेशन के साथ एकीकृत करता है। यह Vue कंपोनेंट्स के लिए
|
|
102
|
+
वह पैकेज जो Intlayer को Vue एप्लिकेशन के साथ एकीकृत करता है। यह Vue कंपोनेंट्स के लिए कॉम्पोज़ेबल्स प्रदान करता है।
|
|
68
103
|
|
|
69
104
|
- **nuxt-intlayer**
|
|
70
105
|
Nuxt मॉड्यूल जो Intlayer को Nuxt एप्लिकेशन के साथ एकीकृत करता है। यह स्वचालित सेटअप, लोकल डिटेक्शन के लिए मिडलवेयर, कुकी प्रबंधन, और URL पुनर्निर्देशन प्रदान करता है।
|
|
@@ -86,9 +121,6 @@ const config: IntlayerConfig = {
|
|
|
86
121
|
],
|
|
87
122
|
defaultLocale: Locales.ENGLISH,
|
|
88
123
|
},
|
|
89
|
-
content: {
|
|
90
|
-
contentDir: ["."], // क्योंकि डिफ़ॉल्ट रूप से Intlayer `./src` डायरेक्टरी से सामग्री घोषणा फ़ाइलों को देखेगा
|
|
91
|
-
},
|
|
92
124
|
};
|
|
93
125
|
|
|
94
126
|
export default config;
|
|
@@ -108,9 +140,6 @@ const config = {
|
|
|
108
140
|
],
|
|
109
141
|
defaultLocale: Locales.ENGLISH,
|
|
110
142
|
},
|
|
111
|
-
content: {
|
|
112
|
-
contentDir: ["."],
|
|
113
|
-
},
|
|
114
143
|
};
|
|
115
144
|
|
|
116
145
|
export default config;
|
|
@@ -130,15 +159,12 @@ const config = {
|
|
|
130
159
|
],
|
|
131
160
|
defaultLocale: Locales.ENGLISH,
|
|
132
161
|
},
|
|
133
|
-
content: {
|
|
134
|
-
contentDir: ["."],
|
|
135
|
-
},
|
|
136
162
|
};
|
|
137
163
|
|
|
138
164
|
module.exports = config;
|
|
139
165
|
```
|
|
140
166
|
|
|
141
|
-
> इस कॉन्फ़िगरेशन फ़ाइल के माध्यम से, आप स्थानीयकृत
|
|
167
|
+
> इस कॉन्फ़िगरेशन फ़ाइल के माध्यम से, आप स्थानीयकृत URLs, मिडलवेयर रीडायरेक्शन, कुकी नाम, आपकी कंटेंट घोषणाओं का स्थान और एक्सटेंशन सेट कर सकते हैं, कंसोल में Intlayer लॉग्स को अक्षम कर सकते हैं, और भी बहुत कुछ। उपलब्ध सभी पैरामीटर की पूरी सूची के लिए, कृपया [कॉन्फ़िगरेशन दस्तावेज़](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/configuration.md) देखें।
|
|
142
168
|
|
|
143
169
|
### चरण 3: अपने Nuxt कॉन्फ़िगरेशन में Intlayer को एकीकृत करें
|
|
144
170
|
|
|
@@ -153,258 +179,46 @@ export default defineNuxtConfig({
|
|
|
153
179
|
});
|
|
154
180
|
```
|
|
155
181
|
|
|
156
|
-
> `nuxt-intlayer` मॉड्यूल स्वचालित रूप से Intlayer को Nuxt के साथ एकीकृत करता है। यह
|
|
182
|
+
> `nuxt-intlayer` मॉड्यूल स्वचालित रूप से Intlayer को Nuxt के साथ एकीकृत करता है। यह कंटेंट घोषणा निर्माण सेट करता है, विकास मोड में फ़ाइलों की निगरानी करता है, स्थानीय पहचान के लिए मिडलवेयर प्रदान करता है, और स्थानीयकृत रूटिंग का प्रबंधन करता है।
|
|
157
183
|
|
|
158
184
|
### चरण 4: अपनी सामग्री घोषित करें
|
|
159
185
|
|
|
160
|
-
अनुवाद संग्रहीत करने के लिए अपनी
|
|
161
|
-
|
|
162
|
-
```tsx fileName="components/helloWorld.content.ts" contentDeclarationFormat="typescript"
|
|
163
|
-
import { t, type Dictionary } from "intlayer";
|
|
164
|
-
|
|
165
|
-
const helloWorldContent = {
|
|
166
|
-
key: "helloworld",
|
|
167
|
-
content: {
|
|
168
|
-
count: t({ en: "count is ", fr: "le compte est ", es: "el recuento es " }),
|
|
169
|
-
edit: t({
|
|
170
|
-
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
171
|
-
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
172
|
-
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
173
|
-
}),
|
|
174
|
-
checkOut: t({ en: "Check out ", fr: "Vérifiez ", es: "Compruebe " }),
|
|
175
|
-
nuxtIntlayer: t({
|
|
176
|
-
en: "Nuxt Intlayer documentation",
|
|
177
|
-
fr: "Documentation de Nuxt Intlayer",
|
|
178
|
-
es: "Documentación de Nuxt Intlayer",
|
|
179
|
-
}),
|
|
180
|
-
learnMore: t({
|
|
181
|
-
en: "Learn more about Nuxt in the ",
|
|
182
|
-
fr: "En savoir plus sur Nuxt dans la ",
|
|
183
|
-
es: "Aprenda más sobre Nuxt en la ",
|
|
184
|
-
}),
|
|
185
|
-
nuxtDocs: t({
|
|
186
|
-
en: "Nuxt Documentation",
|
|
187
|
-
fr: "Documentation Nuxt",
|
|
188
|
-
es: "Documentación de Nuxt",
|
|
189
|
-
}),
|
|
190
|
-
readTheDocs: t({
|
|
191
|
-
en: "Click on the Nuxt logo to learn more",
|
|
192
|
-
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
193
|
-
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
194
|
-
}),
|
|
195
|
-
},
|
|
196
|
-
} satisfies Dictionary;
|
|
197
|
-
|
|
198
|
-
export default helloWorldContent;
|
|
199
|
-
```
|
|
186
|
+
अनुवाद संग्रहीत करने के लिए अपनी कंटेंट घोषणाएँ बनाएं और प्रबंधित करें:
|
|
200
187
|
|
|
201
|
-
```
|
|
202
|
-
import { t } from "intlayer";
|
|
188
|
+
```tsx fileName="content/home-page.content.ts" contentDeclarationFormat="typescript"
|
|
189
|
+
import { type Dictionary, t } from "intlayer";
|
|
203
190
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
key: "helloworld",
|
|
191
|
+
const content = {
|
|
192
|
+
key: "home-page",
|
|
207
193
|
content: {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
213
|
-
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
214
|
-
}),
|
|
215
|
-
checkOut: t({ en: "Check out ", fr: "Vérifiez ", es: "Compruebe " }),
|
|
216
|
-
nuxtIntlayer: t({
|
|
217
|
-
en: "Nuxt Intlayer documentation",
|
|
218
|
-
fr: "Documentation de Nuxt Intlayer",
|
|
219
|
-
es: "Documentación de Nuxt Intlayer",
|
|
220
|
-
}),
|
|
221
|
-
learnMore: t({
|
|
222
|
-
en: "Learn more about Nuxt in the ",
|
|
223
|
-
fr: "En savoir plus sur Nuxt dans la ",
|
|
224
|
-
es: "Aprenda más sobre Nuxt en la ",
|
|
194
|
+
title: t({
|
|
195
|
+
en: "Hello world",
|
|
196
|
+
fr: "Bonjour le monde",
|
|
197
|
+
es: "Hola mundo",
|
|
225
198
|
}),
|
|
226
|
-
|
|
227
|
-
en: "
|
|
228
|
-
fr: "
|
|
229
|
-
es: "
|
|
199
|
+
metaTitle: t({
|
|
200
|
+
en: "Welcome | My Application",
|
|
201
|
+
fr: "Bienvenue | Mon Application",
|
|
202
|
+
es: "Bienvenido | Mi Aplicación",
|
|
230
203
|
}),
|
|
231
|
-
|
|
232
|
-
en: "
|
|
233
|
-
fr: "
|
|
234
|
-
es: "
|
|
235
|
-
}),
|
|
236
|
-
},
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
export default helloWorldContent;
|
|
240
|
-
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
241
|
-
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
204
|
+
metaDescription: t({
|
|
205
|
+
en: "Discover your multilingual Nuxt app homepage powered by Intlayer.",
|
|
206
|
+
fr: "Découvrez la page d'accueil multilingue de votre application Nuxt propulsée par Intlayer.",
|
|
207
|
+
es: "Descubre la página de inicio multilingüe de tu aplicación Nuxt impulsada por Intlayer.",
|
|
242
208
|
}),
|
|
243
209
|
},
|
|
244
210
|
} satisfies Dictionary;
|
|
245
211
|
|
|
246
|
-
export default
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
```javascript fileName="components/helloWorld.content.mjs" contentDeclarationFormat="esm"
|
|
250
|
-
import { t } from "intlayer";
|
|
251
|
-
|
|
252
|
-
/** @type {import('intlayer').Dictionary} */
|
|
253
|
-
const helloWorldContent = {
|
|
254
|
-
key: "helloworld",
|
|
255
|
-
content: {
|
|
256
|
-
count: t({ en: "count is ", fr: "le compte est ", es: "el recuento es " }),
|
|
257
|
-
edit: t({
|
|
258
|
-
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
259
|
-
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
260
|
-
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
261
|
-
}),
|
|
262
|
-
checkOut: t({
|
|
263
|
-
en: "Check out ",
|
|
264
|
-
hi: "देखें ",
|
|
265
|
-
fr: "Vérifiez ",
|
|
266
|
-
es: "Compruebe ",
|
|
267
|
-
}),
|
|
268
|
-
nuxtIntlayer: t({
|
|
269
|
-
en: "Nuxt Intlayer documentation",
|
|
270
|
-
hi: "Nuxt Intlayer दस्तावेज़",
|
|
271
|
-
fr: "Documentation de Nuxt Intlayer",
|
|
272
|
-
es: "Documentación de Nuxt Intlayer",
|
|
273
|
-
}),
|
|
274
|
-
learnMore: t({
|
|
275
|
-
en: "Learn more about Nuxt in the ",
|
|
276
|
-
hi: "Nuxt के बारे में अधिक जानें ",
|
|
277
|
-
fr: "En savoir plus sur Nuxt dans la ",
|
|
278
|
-
es: "Aprenda más sobre Nuxt en la ",
|
|
279
|
-
}),
|
|
280
|
-
nuxtDocs: t({
|
|
281
|
-
en: "Nuxt Documentation",
|
|
282
|
-
hi: "Nuxt दस्तावेज़",
|
|
283
|
-
fr: "Documentation Nuxt",
|
|
284
|
-
es: "Documentación de Nuxt",
|
|
285
|
-
}),
|
|
286
|
-
readTheDocs: t({
|
|
287
|
-
en: "Click on the Nuxt logo to learn more",
|
|
288
|
-
hi: "अधिक जानने के लिए Nuxt लोगो पर क्लिक करें",
|
|
289
|
-
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
290
|
-
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
291
|
-
}),
|
|
292
|
-
},
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
export default helloWorldContent;
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
```javascript fileName="components/helloWorld.content.cjs" contentDeclarationFormat="commonjs"
|
|
299
|
-
const { t } = require("intlayer");
|
|
300
|
-
|
|
301
|
-
/** @type {import('intlayer').Dictionary} */
|
|
302
|
-
const helloWorldContent = {
|
|
303
|
-
key: "helloworld",
|
|
304
|
-
content: {
|
|
305
|
-
count: t({ en: "count is ", fr: "le compte est ", es: "el recuento es " }),
|
|
306
|
-
edit: t({
|
|
307
|
-
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
308
|
-
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
309
|
-
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
310
|
-
}),
|
|
311
|
-
checkOut: t({ en: "Check out ", fr: "Vérifiez ", es: "Compruebe " }),
|
|
312
|
-
nuxtIntlayer: t({
|
|
313
|
-
en: "Nuxt Intlayer documentation",
|
|
314
|
-
fr: "Documentation de Nuxt Intlayer",
|
|
315
|
-
es: "Nuxt Intlayer दस्तावेज़ीकरण",
|
|
316
|
-
}),
|
|
317
|
-
learnMore: t({
|
|
318
|
-
en: "Nuxt के बारे में अधिक जानें ",
|
|
319
|
-
fr: "En savoir plus sur Nuxt dans la ",
|
|
320
|
-
es: "Aprenda más sobre Nuxt en la ",
|
|
321
|
-
}),
|
|
322
|
-
nuxtDocs: t({
|
|
323
|
-
en: "Nuxt दस्तावेज़ीकरण",
|
|
324
|
-
fr: "Documentation Nuxt",
|
|
325
|
-
es: "Documentación de Nuxt",
|
|
326
|
-
}),
|
|
327
|
-
readTheDocs: t({
|
|
328
|
-
en: "अधिक जानने के लिए Nuxt लोगो पर क्लिक करें",
|
|
329
|
-
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
330
|
-
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
331
|
-
}),
|
|
332
|
-
},
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
module.exports = helloWorldContent;
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
```json fileName="components/helloWorld.content.json" contentDeclarationFormat="json"
|
|
339
|
-
{
|
|
340
|
-
"$schema": "https://intlayer.org/schema.json",
|
|
341
|
-
"key": "helloworld",
|
|
342
|
-
"content": {
|
|
343
|
-
"count": {
|
|
344
|
-
"nodeType": "translation",
|
|
345
|
-
"translation": {
|
|
346
|
-
"en": "count is ",
|
|
347
|
-
"hi": "गिनती है ",
|
|
348
|
-
"fr": "le compte est ",
|
|
349
|
-
"es": "el recuento es "
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
"edit": {
|
|
353
|
-
"nodeType": "translation",
|
|
354
|
-
"translation": {
|
|
355
|
-
"en": "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
356
|
-
"hi": "परीक्षण के लिए <code>components/HelloWorld.vue</code> संपादित करें और HMR को सहेजें",
|
|
357
|
-
"fr": "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
358
|
-
"es": "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR"
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
"checkOut": {
|
|
362
|
-
"nodeType": "translation",
|
|
363
|
-
"translation": {
|
|
364
|
-
"en": "Check out ",
|
|
365
|
-
"hi": "देखें ",
|
|
366
|
-
"fr": "Vérifiez ",
|
|
367
|
-
"es": "Compruebe "
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
"nuxtIntlayer": {
|
|
371
|
-
"nodeType": "translation",
|
|
372
|
-
"translation": {
|
|
373
|
-
"hi": "Nuxt Intlayer प्रलेखन"
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
"learnMore": {
|
|
377
|
-
"nodeType": "translation",
|
|
378
|
-
"translation": {
|
|
379
|
-
"hi": "Nuxt के बारे में अधिक जानें "
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
"nuxtDocs": {
|
|
383
|
-
"nodeType": "translation",
|
|
384
|
-
"translation": {
|
|
385
|
-
"hi": "Nuxt प्रलेखन"
|
|
386
|
-
}
|
|
387
|
-
},
|
|
388
|
-
"readTheDocs": {
|
|
389
|
-
"nodeType": "translation",
|
|
390
|
-
"translation": {
|
|
391
|
-
"hi": "अधिक जानने के लिए Nuxt लोगो पर क्लिक करें"
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
"es": "Haga clic en el logotipo de Nuxt para obtener más información"
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}
|
|
212
|
+
export default content;
|
|
399
213
|
```
|
|
400
214
|
|
|
401
|
-
> आपकी
|
|
215
|
+
> आपकी कंटेंट घोषणाएँ आपकी एप्लिकेशन में कहीं भी परिभाषित की जा सकती हैं जब तक कि वे `contentDir` निर्देशिका (डिफ़ॉल्ट रूप से, `./src`) में शामिल हों। और कंटेंट घोषणा फ़ाइल एक्सटेंशन से मेल खाती हों (डिफ़ॉल्ट रूप से, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)।
|
|
402
216
|
|
|
403
|
-
> अधिक विवरण के लिए, [
|
|
217
|
+
> अधिक विवरण के लिए, [content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/dictionary/content_file.md) देखें।
|
|
404
218
|
|
|
405
219
|
### चरण 5: अपने कोड में Intlayer का उपयोग करें
|
|
406
220
|
|
|
407
|
-
अपने Nuxt एप्लिकेशन में `useIntlayer`
|
|
221
|
+
अपने Nuxt एप्लिकेशन में `useIntlayer` composable का उपयोग करके अपनी कंटेंट डिक्शनरीज़ तक पहुँचें:
|
|
408
222
|
|
|
409
223
|
```vue fileName="components/HelloWorld.vue"
|
|
410
224
|
<script setup lang="ts">
|
|
@@ -453,86 +267,76 @@ const countRef = ref(0);
|
|
|
453
267
|
</template>
|
|
454
268
|
```
|
|
455
269
|
|
|
456
|
-
#### Intlayer में
|
|
270
|
+
#### Intlayer में कंटेंट तक पहुँच
|
|
457
271
|
|
|
458
|
-
Intlayer आपकी
|
|
272
|
+
Intlayer आपकी कंटेंट तक पहुँचने के लिए विभिन्न APIs प्रदान करता है:
|
|
459
273
|
|
|
460
|
-
- **कंपोनेंट-आधारित सिंटैक्स** (
|
|
461
|
-
|
|
274
|
+
- **कंपोनेंट-आधारित सिंटैक्स** (सिफारिश की गई):
|
|
275
|
+
`<myContent />`, या `<Component :is="myContent" />` सिंटैक्स का उपयोग करके कंटेंट को Intlayer Node के रूप में रेंडर करें। यह [Visual Editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/intlayer_visual_editor.md) और [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/intlayer_CMS.md) के साथ सहजता से एकीकृत होता है।
|
|
462
276
|
|
|
463
277
|
- **स्ट्रिंग-आधारित सिंटैक्स**:
|
|
464
|
-
|
|
278
|
+
कंटेंट को प्लेन टेक्स्ट के रूप में रेंडर करने के लिए `{{ myContent }}` का उपयोग करें, बिना Visual Editor सपोर्ट के।
|
|
465
279
|
|
|
466
280
|
- **रॉ HTML सिंटैक्स**:
|
|
467
|
-
|
|
281
|
+
कंटेंट को रॉ HTML के रूप में रेंडर करने के लिए `<div v-html="myContent" />` का उपयोग करें, बिना Visual Editor सपोर्ट के।
|
|
468
282
|
|
|
469
283
|
- **डिस्ट्रक्चरिंग सिंटैक्स**:
|
|
470
|
-
`useIntlayer` कॉम्पोज़ेबल
|
|
471
|
-
-
|
|
472
|
-
- या
|
|
284
|
+
`useIntlayer` कॉम्पोज़ेबल कंटेंट के साथ एक Proxy लौटाता है। इस Proxy को डिस्ट्रक्चर करके कंटेंट तक पहुंचा जा सकता है जबकि रिएक्टिविटी बनी रहती है।
|
|
285
|
+
- `const content = useIntlayer("myContent");` का उपयोग करें और `{{ content.myContent }}` / `<content.myContent />`।
|
|
286
|
+
- या `const { myContent } = useIntlayer("myContent");` का उपयोग करें और `{{ myContent}}` / `<myContent/>` से कंटेंट को डीस्ट्रक्चर करें।
|
|
473
287
|
|
|
474
288
|
### (वैकल्पिक) चरण 6: अपनी सामग्री की भाषा बदलें
|
|
475
289
|
|
|
476
|
-
अपनी सामग्री की भाषा बदलने के लिए, आप `useLocale` कॉम्पोज़ेबल द्वारा प्रदान
|
|
290
|
+
अपनी सामग्री की भाषा बदलने के लिए, आप `useLocale` कॉम्पोज़ेबल द्वारा प्रदान किए गए `setLocale` फ़ंक्शन का उपयोग कर सकते हैं। यह फ़ंक्शन आपको एप्लिकेशन की लोकल सेट करने और सामग्री को तदनुसार अपडेट करने की अनुमति देता है।
|
|
477
291
|
|
|
478
|
-
भाषाओं के बीच स्विच करने के लिए एक कॉम्पोनेंट
|
|
292
|
+
`NuxtLink` का उपयोग करके भाषाओं के बीच स्विच करने के लिए एक कॉम्पोनेंट बनाएं। **लोकल स्विचिंग के लिए बटन के बजाय लिंक का उपयोग करना SEO और पेज की खोज योग्यता के लिए एक सर्वोत्तम अभ्यास है**, क्योंकि यह खोज इंजन को आपकी सभी स्थानीयकृत पृष्ठों के संस्करणों को क्रॉल और इंडेक्स करने की अनुमति देता है:
|
|
479
293
|
|
|
480
294
|
```vue fileName="components/LocaleSwitcher.vue"
|
|
481
|
-
<template>
|
|
482
|
-
<div class="locale-switcher">
|
|
483
|
-
<select v-model="selectedLocale" @change="changeLocale">
|
|
484
|
-
<option v-for="loc in availableLocales" :key="loc" :value="loc">
|
|
485
|
-
{{ getLocaleName(loc) }}
|
|
486
|
-
</option>
|
|
487
|
-
</select>
|
|
488
|
-
</div>
|
|
489
|
-
</template>
|
|
490
|
-
|
|
491
295
|
<script setup lang="ts">
|
|
492
|
-
import {
|
|
493
|
-
import { getLocaleName } from "intlayer";
|
|
296
|
+
import { getLocaleName, getLocalizedUrl } from "intlayer";
|
|
494
297
|
import { useLocale } from "vue-intlayer";
|
|
495
298
|
|
|
496
|
-
//
|
|
299
|
+
// Nuxt स्वचालित रूप से useRoute को इम्पोर्ट करता है
|
|
300
|
+
const route = useRoute();
|
|
497
301
|
const { locale, availableLocales, setLocale } = useLocale();
|
|
498
|
-
|
|
499
|
-
// चयनित लोकल को ref के साथ ट्रैक करें
|
|
500
|
-
const selectedLocale = ref(locale.value);
|
|
501
|
-
|
|
502
|
-
// चयन बदलने पर लोकल अपडेट करें
|
|
503
|
-
const changeLocale = () => setLocale(selectedLocale.value);
|
|
504
|
-
|
|
505
|
-
// global locale के साथ selectedLocale को सिंक में रखें
|
|
506
|
-
watch(
|
|
507
|
-
() => locale.value,
|
|
508
|
-
(newLocale) => {
|
|
509
|
-
selectedLocale.value = newLocale;
|
|
510
|
-
}
|
|
511
|
-
);
|
|
512
302
|
</script>
|
|
303
|
+
|
|
304
|
+
<template>
|
|
305
|
+
<nav class="locale-switcher">
|
|
306
|
+
<NuxtLink
|
|
307
|
+
v-for="localeEl in availableLocales"
|
|
308
|
+
:key="localeEl"
|
|
309
|
+
:to="getLocalizedUrl(route.fullPath, localeEl)"
|
|
310
|
+
class="locale-link"
|
|
311
|
+
:class="{ 'active-locale': localeEl === locale }"
|
|
312
|
+
@click="setLocale(localeEl)"
|
|
313
|
+
>
|
|
314
|
+
{{ getLocaleName(localeEl) }}
|
|
315
|
+
</NuxtLink>
|
|
316
|
+
</nav>
|
|
513
317
|
</template>
|
|
318
|
+
```
|
|
514
319
|
|
|
515
|
-
|
|
516
|
-
.locale-switcher {
|
|
517
|
-
margin: 1rem 0;
|
|
518
|
-
}
|
|
320
|
+
> `NuxtLink` का उपयोग उचित `href` गुणों के साथ (जो `getLocalizedUrl` के माध्यम से होता है) यह सुनिश्चित करता है कि सर्च इंजन आपकी पृष्ठों के सभी भाषा संस्करणों को खोज सकें। यह केवल JavaScript-आधारित locale स्विचिंग की तुलना में बेहतर है, जिसे सर्च इंजन क्रॉलर शायद फॉलो न करें।
|
|
519
321
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
322
|
+
फिर, अपने `app.vue` को लेआउट्स का उपयोग करने के लिए सेट करें:
|
|
323
|
+
|
|
324
|
+
```vue fileName="app.vue"
|
|
325
|
+
<template>
|
|
326
|
+
<NuxtLayout>
|
|
327
|
+
<NuxtPage />
|
|
328
|
+
</NuxtLayout>
|
|
329
|
+
</template>
|
|
526
330
|
```
|
|
527
331
|
|
|
528
|
-
|
|
332
|
+
### (वैकल्पिक) चरण 6b: नेविगेशन के साथ एक लेआउट बनाएं
|
|
529
333
|
|
|
530
|
-
|
|
334
|
+
Nuxt लेआउट्स आपको अपने पृष्ठों के लिए एक सामान्य संरचना परिभाषित करने की अनुमति देते हैं। एक डिफ़ॉल्ट लेआउट बनाएं जिसमें locale स्विचर और नेविगेशन शामिल हो:
|
|
335
|
+
|
|
336
|
+
```vue fileName="layouts/default.vue"
|
|
531
337
|
<script setup lang="ts">
|
|
532
|
-
import
|
|
338
|
+
import Links from "~/components/Links.vue";
|
|
533
339
|
import LocaleSwitcher from "~/components/LocaleSwitcher.vue";
|
|
534
|
-
|
|
535
|
-
const content = useIntlayer("app"); // संबंधित intlayer घोषणा फ़ाइल बनाएँ
|
|
536
340
|
</script>
|
|
537
341
|
|
|
538
342
|
<template>
|
|
@@ -541,15 +345,20 @@ const content = useIntlayer("app"); // संबंधित intlayer घोष
|
|
|
541
345
|
<LocaleSwitcher />
|
|
542
346
|
</header>
|
|
543
347
|
<main>
|
|
544
|
-
<
|
|
348
|
+
<slot />
|
|
545
349
|
</main>
|
|
350
|
+
|
|
351
|
+
<Links href="/">Home</Links>
|
|
352
|
+
<Links href="/about">About</Links>
|
|
546
353
|
</div>
|
|
547
354
|
</template>
|
|
548
355
|
```
|
|
549
356
|
|
|
357
|
+
`Links` कंपोनेंट (नीचे दिखाया गया) यह सुनिश्चित करता है कि आंतरिक नेविगेशन लिंक स्वचालित रूप से स्थानीयकृत हों।
|
|
358
|
+
|
|
550
359
|
### (वैकल्पिक) चरण 7: अपने एप्लिकेशन में स्थानीयकृत रूटिंग जोड़ें
|
|
551
360
|
|
|
552
|
-
|
|
361
|
+
जब आप `nuxt-intlayer` मॉड्यूल का उपयोग करते हैं, तो Nuxt स्वचालित रूप से स्थानीयकृत रूटिंग को संभालता है। यह आपकी pages डायरेक्टरी संरचना के आधार पर प्रत्येक भाषा के लिए स्वचालित रूप से रूट बनाता है।
|
|
553
362
|
|
|
554
363
|
उदाहरण:
|
|
555
364
|
|
|
@@ -561,266 +370,341 @@ pages/
|
|
|
561
370
|
└── index.vue → /contact, /fr/contact, /es/contact
|
|
562
371
|
```
|
|
563
372
|
|
|
564
|
-
|
|
373
|
+
स्थानीयकृत पेज बनाने के लिए, बस `pages/` डायरेक्टरी में अपने Vue फाइलें बनाएं। यहाँ दो उदाहरण पेज दिए गए हैं:
|
|
565
374
|
|
|
566
|
-
|
|
375
|
+
**होम पेज (`pages/index.vue`):**
|
|
376
|
+
|
|
377
|
+
```vue fileName="pages/index.vue"
|
|
567
378
|
<script setup lang="ts">
|
|
568
379
|
import { useIntlayer } from "vue-intlayer";
|
|
569
380
|
|
|
570
|
-
const content = useIntlayer("
|
|
381
|
+
const content = useIntlayer("home-page");
|
|
382
|
+
|
|
383
|
+
useHead({
|
|
384
|
+
title: content.metaTitle.value,
|
|
385
|
+
meta: [
|
|
386
|
+
{
|
|
387
|
+
name: "description",
|
|
388
|
+
content: content.metaDescription.value,
|
|
389
|
+
},
|
|
390
|
+
],
|
|
391
|
+
});
|
|
571
392
|
</script>
|
|
572
393
|
|
|
573
394
|
<template>
|
|
574
|
-
<
|
|
575
|
-
<h1>{{ content.title }}</h1>
|
|
576
|
-
<p>{{ content.description }}</p>
|
|
577
|
-
</div>
|
|
395
|
+
<h1><content.title /></h1>
|
|
578
396
|
</template>
|
|
579
397
|
```
|
|
580
398
|
|
|
581
|
-
`
|
|
399
|
+
**अबाउट पेज (`pages/about.vue`):**
|
|
582
400
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
- भाषा कुकीज़ का प्रबंधन करें
|
|
587
|
-
- उपयोगकर्ताओं को उपयुक्त स्थानीयकृत URL पर पुनः निर्देशित करें
|
|
401
|
+
```vue fileName="pages/about.vue"
|
|
402
|
+
<script setup lang="ts">
|
|
403
|
+
import { useIntlayer } from "vue-intlayer";
|
|
588
404
|
|
|
589
|
-
|
|
405
|
+
const content = useIntlayer("about-page");
|
|
590
406
|
|
|
591
|
-
|
|
407
|
+
useHead({
|
|
408
|
+
title: content.metaTitle.raw, // प्रिमिटिव स्ट्रिंग एक्सेस के लिए .raw का उपयोग करें
|
|
409
|
+
meta: [
|
|
410
|
+
{
|
|
411
|
+
name: "description",
|
|
412
|
+
content: content.metaDescription.raw, // प्रिमिटिव स्ट्रिंग एक्सेस के लिए .raw का उपयोग करें
|
|
413
|
+
},
|
|
414
|
+
],
|
|
415
|
+
});
|
|
416
|
+
</script>
|
|
592
417
|
|
|
593
|
-
```vue fileName="components/LocalizedLink.vue"
|
|
594
418
|
<template>
|
|
595
|
-
<
|
|
596
|
-
<slot />
|
|
597
|
-
</NuxtLink>
|
|
419
|
+
<h1><content.title /></h1>
|
|
598
420
|
</template>
|
|
421
|
+
```
|
|
599
422
|
|
|
423
|
+
> नोट: `useHead` Nuxt में ऑटो-इम्पोर्ट होता है। आप अपनी जरूरत के अनुसार कंटेंट वैल्यूज़ को `.value` (reactive) या `.raw` (primitive string) के माध्यम से एक्सेस कर सकते हैं।
|
|
424
|
+
|
|
425
|
+
`nuxt-intlayer` मॉड्यूल स्वचालित रूप से:
|
|
426
|
+
|
|
427
|
+
- उपयोगकर्ता की पसंदीदा लोकल का पता लगाता है
|
|
428
|
+
- URL के माध्यम से लोकल स्विचिंग को संभालता है
|
|
429
|
+
- उपयुक्त `<html lang="">` एट्रिब्यूट सेट करता है
|
|
430
|
+
- लोकल कुकीज़ का प्रबंधन करता है
|
|
431
|
+
- उपयोगकर्ताओं को उपयुक्त स्थानीयकृत URL पर रीडायरेक्ट करता है
|
|
432
|
+
|
|
433
|
+
### (वैकल्पिक) चरण 8: एक स्थानीयकृत लिंक कंपोनेंट बनाना
|
|
434
|
+
|
|
435
|
+
अपने एप्लिकेशन की नेविगेशन को वर्तमान locale का सम्मान करने के लिए, आप एक कस्टम `Links` कंपोनेंट बना सकते हैं। यह कंपोनेंट स्वचालित रूप से आंतरिक URLs के साथ वर्तमान भाषा का प्रीफिक्स जोड़ता है, जो **SEO और पेज की खोज योग्यता** के लिए आवश्यक है।
|
|
436
|
+
|
|
437
|
+
```vue fileName="components/Links.vue"
|
|
600
438
|
<script setup lang="ts">
|
|
601
|
-
import { computed } from "vue";
|
|
602
439
|
import { getLocalizedUrl } from "intlayer";
|
|
603
440
|
import { useLocale } from "vue-intlayer";
|
|
604
441
|
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
442
|
+
interface Props {
|
|
443
|
+
href: string;
|
|
444
|
+
locale?: string;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
const props = defineProps<Props>();
|
|
448
|
+
|
|
449
|
+
const { locale: currentLocale } = useLocale();
|
|
611
450
|
|
|
612
|
-
|
|
451
|
+
// अंतिम पथ की गणना करें
|
|
452
|
+
const finalPath = computed(() => {
|
|
453
|
+
// 1. जांचें कि लिंक बाहरी है या नहीं
|
|
454
|
+
const isExternal = /^https?:\/\//.test(props.href || "");
|
|
613
455
|
|
|
614
|
-
//
|
|
615
|
-
|
|
456
|
+
// 2. यदि बाहरी है, तो जैसा है वैसा लौटाएं (NuxtLink <a> टैग जनरेशन को संभालता है)
|
|
457
|
+
if (isExternal) return props.href;
|
|
616
458
|
|
|
617
|
-
// आंतरिक
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
);
|
|
459
|
+
// 3. यदि आंतरिक है, तो URL को स्थानीयकृत करें
|
|
460
|
+
const targetLocale = props.locale || currentLocale.value;
|
|
461
|
+
return getLocalizedUrl(props.href, targetLocale);
|
|
462
|
+
});
|
|
621
463
|
</script>
|
|
464
|
+
|
|
465
|
+
<template>
|
|
466
|
+
<NuxtLink :to="finalPath" v-bind="$attrs">
|
|
467
|
+
<slot />
|
|
468
|
+
</NuxtLink>
|
|
469
|
+
</template>
|
|
622
470
|
```
|
|
623
471
|
|
|
624
|
-
फिर इस
|
|
472
|
+
फिर इस कंपोनेंट का उपयोग अपने एप्लिकेशन में पूरे स्थान पर करें:
|
|
473
|
+
|
|
474
|
+
```vue fileName="layouts/default.vue"
|
|
475
|
+
<script setup lang="ts">
|
|
476
|
+
import Links from "~/components/Links.vue";
|
|
477
|
+
import LocaleSwitcher from "~/components/LocaleSwitcher.vue";
|
|
478
|
+
</script>
|
|
625
479
|
|
|
626
|
-
```vue fileName="pages/index.vue"
|
|
627
480
|
<template>
|
|
628
481
|
<div>
|
|
629
|
-
<
|
|
630
|
-
|
|
631
|
-
</
|
|
632
|
-
<
|
|
633
|
-
|
|
634
|
-
</
|
|
482
|
+
<header>
|
|
483
|
+
<LocaleSwitcher />
|
|
484
|
+
</header>
|
|
485
|
+
<main>
|
|
486
|
+
<slot />
|
|
487
|
+
</main>
|
|
488
|
+
|
|
489
|
+
<Links href="/">होम</Links>
|
|
490
|
+
<Links href="/about">अबाउट</Links>
|
|
635
491
|
</div>
|
|
636
492
|
</template>
|
|
637
|
-
|
|
638
|
-
<script setup lang="ts">
|
|
639
|
-
import { useIntlayer } from "vue-intlayer";
|
|
640
|
-
import LocalizedLink from "~/components/LocalizedLink.vue";
|
|
641
|
-
|
|
642
|
-
const content = useIntlayer("home");
|
|
643
|
-
</script>
|
|
644
493
|
```
|
|
645
494
|
|
|
495
|
+
> `NuxtLink` का उपयोग स्थानीयकृत पथों के साथ करने से, आप सुनिश्चित करते हैं कि:
|
|
496
|
+
>
|
|
497
|
+
> - सर्च इंजन आपकी पृष्ठों के सभी भाषा संस्करणों को क्रॉल और इंडेक्स कर सकते हैं
|
|
498
|
+
> - उपयोगकर्ता सीधे स्थानीयकृत URLs साझा कर सकते हैं
|
|
499
|
+
> - ब्राउज़र इतिहास स्थानीयकृत-पूर्वसर्ग वाले URLs के साथ सही ढंग से काम करता है
|
|
500
|
+
|
|
646
501
|
### (वैकल्पिक) चरण 9: मेटाडेटा और SEO को संभालना
|
|
647
502
|
|
|
648
|
-
Nuxt उत्कृष्ट SEO क्षमताएँ प्रदान करता है। आप स्थानीयकृत मेटाडेटा को संभालने के लिए
|
|
503
|
+
Nuxt `useHead` कॉम्पोज़ेबल (स्वतः-आयातित) के माध्यम से उत्कृष्ट SEO क्षमताएँ प्रदान करता है। आप Intlayer का उपयोग स्थानीयकृत मेटाडेटा को संभालने के लिए कर सकते हैं, `.raw` या `.value` एक्सेसर का उपयोग करके प्रिमिटिव स्ट्रिंग मान प्राप्त करने के लिए:
|
|
649
504
|
|
|
650
505
|
```vue fileName="pages/about.vue"
|
|
651
506
|
<script setup lang="ts">
|
|
652
|
-
import {
|
|
653
|
-
import { getIntlayer } from "intlayer";
|
|
654
|
-
import { useLocale } from "vue-intlayer";
|
|
507
|
+
import { useIntlayer } from "vue-intlayer";
|
|
655
508
|
|
|
656
|
-
|
|
657
|
-
const content =
|
|
509
|
+
// useHead Nuxt में स्वतः-आयातित है
|
|
510
|
+
const content = useIntlayer("about-page");
|
|
658
511
|
|
|
659
|
-
|
|
660
|
-
title: content.
|
|
661
|
-
|
|
512
|
+
useHead({
|
|
513
|
+
title: content.metaTitle.raw, // प्रिमिटिव स्ट्रिंग एक्सेस के लिए .raw का उपयोग करें
|
|
514
|
+
meta: [
|
|
515
|
+
{
|
|
516
|
+
name: "description",
|
|
517
|
+
content: content.metaDescription.raw, // प्रिमिटिव स्ट्रिंग एक्सेस के लिए .raw का उपयोग करें
|
|
518
|
+
},
|
|
519
|
+
],
|
|
662
520
|
});
|
|
663
521
|
</script>
|
|
664
522
|
|
|
665
523
|
<template>
|
|
666
|
-
<
|
|
667
|
-
<h1>{{ content.pageTitle }}</h1>
|
|
668
|
-
<p>{{ content.pageContent }}</p>
|
|
669
|
-
</div>
|
|
524
|
+
<h1><content.title /></h1>
|
|
670
525
|
</template>
|
|
671
526
|
```
|
|
672
527
|
|
|
673
|
-
|
|
528
|
+
> वैकल्पिक रूप से, आप Vue reactivity के बिना कंटेंट प्राप्त करने के लिए `import { getIntlayer } from "intlayer"` फ़ंक्शन का उपयोग कर सकते हैं।
|
|
674
529
|
|
|
675
|
-
|
|
530
|
+
> **कंटेंट मानों तक पहुँच:**
|
|
531
|
+
>
|
|
532
|
+
> - प्रिमिटिव स्ट्रिंग मान प्राप्त करने के लिए `.raw` का उपयोग करें (गैर-रिएक्टिव)
|
|
533
|
+
> - रिएक्टिव मान प्राप्त करने के लिए `.value` का उपयोग करें
|
|
534
|
+
> - विज़ुअल एडिटर समर्थन के लिए `<content.key />` कंपोनेंट सिंटैक्स का उपयोग करें
|
|
535
|
+
|
|
536
|
+
संबंधित कंटेंट घोषणा बनाएँ:
|
|
537
|
+
|
|
538
|
+
```ts fileName="pages/about-page.content.ts" contentDeclarationFormat="typescript"
|
|
676
539
|
import { t, type Dictionary } from "intlayer";
|
|
677
|
-
import type { useSeoMeta } from "nuxt/app";
|
|
678
540
|
|
|
679
|
-
const
|
|
680
|
-
key: "about-
|
|
541
|
+
const aboutPageContent = {
|
|
542
|
+
key: "about-page",
|
|
681
543
|
content: {
|
|
682
|
-
|
|
544
|
+
metaTitle: t({
|
|
683
545
|
en: "About Us - My Company",
|
|
684
546
|
fr: "À Propos - Ma Société",
|
|
685
547
|
es: "Acerca de Nosotros - Mi Empresa",
|
|
686
548
|
}),
|
|
687
|
-
|
|
549
|
+
metaDescription: t({
|
|
550
|
+
hi: "हमारी कंपनी और हमारे मिशन के बारे में अधिक जानें",
|
|
688
551
|
en: "Learn more about our company and our mission",
|
|
689
552
|
fr: "En savoir plus sur notre société et notre mission",
|
|
690
553
|
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
691
554
|
}),
|
|
555
|
+
title: t({
|
|
556
|
+
hi: "हमारे बारे में",
|
|
557
|
+
en: "About Us",
|
|
558
|
+
fr: "À Propos",
|
|
559
|
+
es: "Acerca de Nosotros",
|
|
560
|
+
}),
|
|
692
561
|
},
|
|
693
|
-
} satisfies Dictionary
|
|
562
|
+
} satisfies Dictionary;
|
|
694
563
|
|
|
695
|
-
export default
|
|
564
|
+
export default aboutPageContent;
|
|
696
565
|
```
|
|
697
566
|
|
|
698
|
-
```
|
|
567
|
+
```javascript fileName="pages/about-page.content.mjs" contentDeclarationFormat="esm"
|
|
699
568
|
import { t } from "intlayer";
|
|
700
569
|
|
|
701
570
|
/** @type {import('intlayer').Dictionary} */
|
|
702
|
-
const
|
|
703
|
-
key: "about-
|
|
571
|
+
const aboutPageContent = {
|
|
572
|
+
key: "about-page",
|
|
704
573
|
content: {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
en: "
|
|
574
|
+
metaTitle: t({
|
|
575
|
+
hi: "हमारे बारे में - मेरी कंपनी",
|
|
576
|
+
en: "About Us - My Company",
|
|
708
577
|
fr: "À Propos - Ma Société",
|
|
709
578
|
es: "Acerca de Nosotros - Mi Empresa",
|
|
710
579
|
}),
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
en: "हमारी कंपनी और हमारे मिशन के बारे में अधिक जानें",
|
|
580
|
+
metaDescription: t({
|
|
581
|
+
hi: "हमारी कंपनी और हमारे मिशन के बारे में अधिक जानें",
|
|
714
582
|
fr: "En savoir plus sur notre société et notre mission",
|
|
715
583
|
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
716
584
|
}),
|
|
585
|
+
title: t({
|
|
586
|
+
hi: "हमारे बारे में",
|
|
587
|
+
fr: "À Propos",
|
|
588
|
+
es: "Acerca de Nosotros",
|
|
589
|
+
}),
|
|
717
590
|
},
|
|
718
591
|
};
|
|
719
592
|
|
|
720
|
-
export default
|
|
593
|
+
export default aboutPageContent;
|
|
721
594
|
```
|
|
722
595
|
|
|
723
|
-
```
|
|
596
|
+
```javascript fileName="pages/about-page.content.cjs" contentDeclarationFormat="commonjs"
|
|
724
597
|
const { t } = require("intlayer");
|
|
725
598
|
|
|
726
599
|
/** @type {import('intlayer').Dictionary} */
|
|
727
|
-
const
|
|
728
|
-
key: "about-
|
|
600
|
+
const aboutPageContent = {
|
|
601
|
+
key: "about-page",
|
|
729
602
|
content: {
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
en: "हमारे बारे में - मेरी कंपनी",
|
|
603
|
+
metaTitle: t({
|
|
604
|
+
hi: "हमारे बारे में - मेरी कंपनी",
|
|
733
605
|
fr: "À Propos - Ma Société",
|
|
734
606
|
es: "Acerca de Nosotros - Mi Empresa",
|
|
735
607
|
}),
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
en: "
|
|
608
|
+
metaDescription: t({
|
|
609
|
+
hi: "हमारी कंपनी और हमारे मिशन के बारे में अधिक जानें",
|
|
610
|
+
en: "Learn more about our company and our mission",
|
|
739
611
|
fr: "En savoir plus sur notre société et notre mission",
|
|
740
612
|
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
741
613
|
}),
|
|
614
|
+
title: t({
|
|
615
|
+
hi: "हमारे बारे में",
|
|
616
|
+
en: "About Us",
|
|
617
|
+
fr: "À Propos",
|
|
618
|
+
es: "Acerca de Nosotros",
|
|
619
|
+
}),
|
|
742
620
|
},
|
|
743
621
|
};
|
|
744
622
|
|
|
745
|
-
module.exports =
|
|
623
|
+
module.exports = aboutPageContent;
|
|
746
624
|
```
|
|
747
625
|
|
|
748
|
-
```json fileName="pages/about-
|
|
626
|
+
```json fileName="pages/about-page.content.json" contentDeclarationFormat="json"
|
|
749
627
|
{
|
|
750
|
-
"
|
|
628
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
629
|
+
"key": "about-page",
|
|
751
630
|
"content": {
|
|
752
|
-
"
|
|
631
|
+
"metaTitle": {
|
|
753
632
|
"nodeType": "translation",
|
|
754
|
-
"
|
|
755
|
-
"
|
|
756
|
-
"en": "
|
|
633
|
+
"translation": {
|
|
634
|
+
"hi": "हमारे बारे में - मेरी कंपनी",
|
|
635
|
+
"en": "About Us - My Company",
|
|
757
636
|
"fr": "À Propos - Ma Société",
|
|
758
637
|
"es": "Acerca de Nosotros - Mi Empresa"
|
|
759
638
|
}
|
|
760
639
|
},
|
|
761
|
-
"
|
|
640
|
+
"metaDescription": {
|
|
762
641
|
"nodeType": "translation",
|
|
763
|
-
"
|
|
764
|
-
"
|
|
765
|
-
"en": "Learn more about our company and our mission",
|
|
642
|
+
"translation": {
|
|
643
|
+
"hi": "हमारी कंपनी और हमारे मिशन के बारे में अधिक जानें",
|
|
766
644
|
"fr": "En savoir plus sur notre société et notre mission",
|
|
767
645
|
"es": "Conozca más sobre nuestra empresa y nuestra misión"
|
|
768
646
|
}
|
|
647
|
+
},
|
|
648
|
+
"title": {
|
|
649
|
+
"nodeType": "translation",
|
|
650
|
+
"translation": {
|
|
651
|
+
"hi": "हमारे बारे में",
|
|
652
|
+
"fr": "À Propos",
|
|
653
|
+
"es": "Acerca de Nosotros"
|
|
654
|
+
}
|
|
769
655
|
}
|
|
770
656
|
}
|
|
771
657
|
}
|
|
772
658
|
```
|
|
773
659
|
|
|
774
|
-
###
|
|
660
|
+
### TypeScript कॉन्फ़िगर करें
|
|
775
661
|
|
|
776
|
-
Intlayer
|
|
662
|
+
Intlayer TypeScript के लाभ प्राप्त करने और आपके कोडबेस को मजबूत बनाने के लिए module augmentation का उपयोग करता है।
|
|
777
663
|
|
|
778
|
-

|
|
779
665
|
|
|
780
666
|

|
|
781
667
|
|
|
782
|
-
सुनिश्चित करें कि आपकी
|
|
668
|
+
सुनिश्चित करें कि आपकी TypeScript कॉन्फ़िगरेशन में ऑटो-जनरेटेड टाइप्स शामिल हैं।
|
|
783
669
|
|
|
784
670
|
```json5 fileName="tsconfig.json"
|
|
785
671
|
{
|
|
786
|
-
// ...
|
|
672
|
+
// ... आपकी मौजूदा TypeScript कॉन्फ़िगरेशन
|
|
787
673
|
"include": [
|
|
788
|
-
// ...
|
|
789
|
-
".intlayer/**/*.ts", //
|
|
674
|
+
// ... आपकी मौजूदा TypeScript कॉन्फ़िगरेशन
|
|
675
|
+
".intlayer/**/*.ts", // ऑटो-जनरेटेड टाइप्स शामिल करें
|
|
790
676
|
],
|
|
791
677
|
}
|
|
792
678
|
```
|
|
793
679
|
|
|
794
680
|
### Git कॉन्फ़िगरेशन
|
|
795
681
|
|
|
796
|
-
|
|
682
|
+
यह अनुशंसित है कि Intlayer द्वारा जनरेट की गई फाइलों को अनदेखा किया जाए। इससे आप इन्हें अपनी Git रिपॉजिटरी में कमिट करने से बच सकते हैं।
|
|
797
683
|
|
|
798
|
-
इसके लिए, आप अपनी `.gitignore`
|
|
684
|
+
इसके लिए, आप अपनी `.gitignore` फाइल में निम्नलिखित निर्देश जोड़ सकते हैं:
|
|
799
685
|
|
|
800
686
|
```plaintext fileName=".gitignore"
|
|
801
|
-
# Intlayer द्वारा
|
|
687
|
+
# Intlayer द्वारा जनरेट की गई फाइलों को अनदेखा करें
|
|
802
688
|
.intlayer
|
|
803
689
|
```
|
|
804
690
|
|
|
805
|
-
### VS
|
|
691
|
+
### VS Code एक्सटेंशन
|
|
806
692
|
|
|
807
|
-
Intlayer के साथ अपने विकास अनुभव को बेहतर बनाने के लिए, आप आधिकारिक **Intlayer VS Code एक्सटेंशन**
|
|
693
|
+
Intlayer के साथ अपने विकास अनुभव को बेहतर बनाने के लिए, आप आधिकारिक **Intlayer VS Code एक्सटेंशन** स्थापित कर सकते हैं।
|
|
808
694
|
|
|
809
695
|
[VS Code मार्केटप्लेस से इंस्टॉल करें](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
810
696
|
|
|
811
697
|
यह एक्सटेंशन प्रदान करता है:
|
|
812
698
|
|
|
813
|
-
-
|
|
814
|
-
-
|
|
815
|
-
-
|
|
816
|
-
-
|
|
699
|
+
- अनुवाद कुंजियों के लिए **ऑटोकम्प्लीशन**।
|
|
700
|
+
- गायब अनुवादों के लिए **रीयल-टाइम त्रुटि पहचान**।
|
|
701
|
+
- अनुवादित सामग्री के **इनलाइन पूर्वावलोकन**।
|
|
702
|
+
- अनुवादों को आसानी से बनाने और अपडेट करने के लिए **त्वरित क्रियाएं**।
|
|
817
703
|
|
|
818
|
-
|
|
704
|
+
एक्सटेंशन का उपयोग कैसे करें, इसके लिए अधिक विवरण के लिए देखें [Intlayer VS Code एक्सटेंशन दस्तावेज़](https://intlayer.org/doc/vs-code-extension)।
|
|
819
705
|
|
|
820
706
|
---
|
|
821
707
|
|
|
822
708
|
### आगे बढ़ें
|
|
823
709
|
|
|
824
|
-
आगे बढ़ने के लिए, आप [
|
|
825
|
-
|
|
826
|
-
---
|
|
710
|
+
आगे बढ़ने के लिए, आप [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/intlayer_visual_editor.md) को लागू कर सकते हैं या अपने कंटेंट को [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/intlayer_CMS.md) का उपयोग करके बाहरी रूप से प्रबंधित कर सकते हैं।
|