@intlayer/docs 6.1.6-canary.0 → 6.1.6
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/en/next-i18next_vs_next-intl_vs_intlayer.md +71 -80
- package/dist/cjs/generated/docs.entry.cjs +16 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +16 -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_angular.md +2 -2
- package/docs/ar/intlayer_with_astro.md +246 -0
- package/docs/ar/intlayer_with_create_react_app.md +3 -2
- package/docs/ar/intlayer_with_express.md +2 -2
- package/docs/ar/intlayer_with_nestjs.md +2 -2
- package/docs/ar/intlayer_with_nextjs_14.md +2 -2
- package/docs/ar/intlayer_with_nextjs_15.md +2 -2
- package/docs/ar/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ar/intlayer_with_nuxt.md +2 -2
- package/docs/ar/intlayer_with_react_native+expo.md +11 -20
- package/docs/ar/intlayer_with_react_router_v7.md +195 -241
- package/docs/ar/intlayer_with_tanstack.md +198 -272
- package/docs/ar/intlayer_with_vite+preact.md +9 -9
- package/docs/ar/intlayer_with_vite+react.md +7 -7
- package/docs/ar/intlayer_with_vite+vue.md +9 -9
- package/docs/de/intlayer_with_angular.md +2 -2
- package/docs/de/intlayer_with_astro.md +246 -0
- package/docs/de/intlayer_with_create_react_app.md +2 -2
- package/docs/de/intlayer_with_express.md +2 -2
- package/docs/de/intlayer_with_nestjs.md +2 -2
- package/docs/de/intlayer_with_nextjs_14.md +2 -2
- package/docs/de/intlayer_with_nextjs_15.md +2 -2
- package/docs/de/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/de/intlayer_with_nuxt.md +2 -2
- package/docs/de/intlayer_with_react_native+expo.md +11 -20
- package/docs/de/intlayer_with_react_router_v7.md +193 -242
- package/docs/de/intlayer_with_tanstack.md +194 -266
- package/docs/de/intlayer_with_vite+preact.md +9 -9
- package/docs/de/intlayer_with_vite+react.md +9 -9
- package/docs/de/intlayer_with_vite+vue.md +11 -11
- package/docs/de/packages/vite-intlayer/index.md +3 -3
- package/docs/en/how_works_intlayer.md +1 -1
- package/docs/en/index.md +1 -1
- package/docs/en/intlayer_cli.md +1 -1
- package/docs/en/intlayer_with_angular.md +4 -4
- package/docs/en/intlayer_with_astro.md +246 -0
- package/docs/en/intlayer_with_create_react_app.md +4 -4
- package/docs/en/intlayer_with_express.md +3 -3
- package/docs/en/intlayer_with_lynx+react.md +1 -1
- package/docs/en/intlayer_with_nestjs.md +2 -2
- package/docs/en/intlayer_with_nextjs_14.md +13 -4
- package/docs/en/intlayer_with_nextjs_15.md +13 -4
- package/docs/en/intlayer_with_nextjs_page_router.md +5 -5
- package/docs/en/intlayer_with_nuxt.md +4 -4
- package/docs/en/intlayer_with_react_native+expo.md +46 -24
- package/docs/en/intlayer_with_react_router_v7.md +164 -211
- package/docs/en/intlayer_with_tanstack.md +166 -241
- package/docs/en/intlayer_with_vite+preact.md +12 -12
- package/docs/en/intlayer_with_vite+react.md +12 -12
- package/docs/en/intlayer_with_vite+solid.md +2 -2
- package/docs/en/intlayer_with_vite+svelte.md +2 -2
- package/docs/en/intlayer_with_vite+vue.md +12 -12
- package/docs/en/introduction.md +1 -1
- package/docs/en/packages/next-intlayer/useDictionary.md +1 -1
- package/docs/en/packages/next-intlayer/useIntlayer.md +1 -1
- package/docs/en/packages/react-intlayer/useDictionary.md +1 -1
- package/docs/en/packages/react-intlayer/useI18n.md +1 -1
- package/docs/en/packages/react-intlayer/useIntlayer.md +1 -1
- package/docs/en/releases/v6.md +1 -0
- package/docs/en/roadmap.md +1 -1
- package/docs/en-GB/intlayer_with_angular.md +3 -3
- package/docs/en-GB/intlayer_with_astro.md +246 -0
- package/docs/en-GB/intlayer_with_create_react_app.md +5 -4
- package/docs/en-GB/intlayer_with_express.md +2 -2
- package/docs/en-GB/intlayer_with_nestjs.md +2 -2
- package/docs/en-GB/intlayer_with_nextjs_14.md +4 -4
- package/docs/en-GB/intlayer_with_nextjs_15.md +2 -2
- package/docs/en-GB/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/en-GB/intlayer_with_nuxt.md +2 -2
- package/docs/en-GB/intlayer_with_react_native+expo.md +11 -20
- package/docs/en-GB/intlayer_with_react_router_v7.md +171 -220
- package/docs/en-GB/intlayer_with_tanstack.md +174 -248
- package/docs/en-GB/intlayer_with_vite+preact.md +9 -9
- package/docs/en-GB/intlayer_with_vite+react.md +9 -9
- package/docs/en-GB/intlayer_with_vite+vue.md +11 -11
- package/docs/en-GB/packages/next-intlayer/useIntlayer.md +1 -1
- package/docs/en-GB/packages/react-intlayer/useIntlayer.md +1 -1
- package/docs/es/intlayer_with_angular.md +2 -2
- package/docs/es/intlayer_with_astro.md +246 -0
- package/docs/es/intlayer_with_create_react_app.md +3 -2
- package/docs/es/intlayer_with_express.md +2 -2
- package/docs/es/intlayer_with_nextjs_14.md +2 -2
- package/docs/es/intlayer_with_nextjs_15.md +2 -2
- package/docs/es/intlayer_with_react_native+expo.md +11 -20
- package/docs/es/intlayer_with_react_router_v7.md +188 -232
- package/docs/es/intlayer_with_tanstack.md +203 -273
- package/docs/es/intlayer_with_vite+preact.md +7 -7
- package/docs/es/intlayer_with_vite+react.md +7 -7
- package/docs/es/intlayer_with_vite+vue.md +9 -9
- package/docs/fr/intlayer_with_angular.md +2 -2
- package/docs/fr/intlayer_with_astro.md +246 -0
- package/docs/fr/intlayer_with_create_react_app.md +3 -2
- package/docs/fr/intlayer_with_express.md +2 -2
- package/docs/fr/intlayer_with_nestjs.md +2 -2
- package/docs/fr/intlayer_with_nextjs_14.md +2 -2
- package/docs/fr/intlayer_with_react_native+expo.md +11 -20
- package/docs/fr/intlayer_with_react_router_v7.md +188 -248
- package/docs/fr/intlayer_with_tanstack.md +192 -265
- package/docs/fr/intlayer_with_vite+preact.md +7 -7
- package/docs/fr/intlayer_with_vite+react.md +7 -7
- package/docs/fr/intlayer_with_vite+vue.md +9 -9
- package/docs/hi/intlayer_cli.md +1 -4
- package/docs/hi/intlayer_with_angular.md +2 -2
- package/docs/hi/intlayer_with_astro.md +246 -0
- package/docs/hi/intlayer_with_create_react_app.md +2 -2
- package/docs/hi/intlayer_with_express.md +2 -2
- package/docs/hi/intlayer_with_nestjs.md +2 -2
- package/docs/hi/intlayer_with_nextjs_14.md +2 -2
- package/docs/hi/intlayer_with_nextjs_15.md +2 -2
- package/docs/hi/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/hi/intlayer_with_nuxt.md +2 -2
- package/docs/hi/intlayer_with_react_native+expo.md +11 -20
- package/docs/hi/intlayer_with_react_router_v7.md +199 -243
- package/docs/hi/intlayer_with_tanstack.md +210 -285
- package/docs/hi/intlayer_with_vite+preact.md +9 -9
- package/docs/hi/intlayer_with_vite+react.md +9 -9
- package/docs/hi/intlayer_with_vite+solid.md +1 -1
- package/docs/hi/intlayer_with_vite+vue.md +11 -11
- package/docs/it/intlayer_with_angular.md +2 -2
- package/docs/it/intlayer_with_astro.md +246 -0
- package/docs/it/intlayer_with_create_react_app.md +3 -2
- package/docs/it/intlayer_with_express.md +2 -2
- package/docs/it/intlayer_with_nestjs.md +2 -2
- package/docs/it/intlayer_with_nextjs_14.md +2 -2
- package/docs/it/intlayer_with_nextjs_15.md +2 -2
- package/docs/it/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/it/intlayer_with_nuxt.md +2 -2
- package/docs/it/intlayer_with_react_native+expo.md +11 -21
- package/docs/it/intlayer_with_react_router_v7.md +195 -242
- package/docs/it/intlayer_with_tanstack.md +203 -267
- package/docs/it/intlayer_with_vite+preact.md +9 -9
- package/docs/it/intlayer_with_vite+react.md +13 -11
- package/docs/it/intlayer_with_vite+vue.md +11 -11
- package/docs/ja/intlayer_with_angular.md +2 -2
- package/docs/ja/intlayer_with_astro.md +246 -0
- package/docs/ja/intlayer_with_create_react_app.md +3 -2
- package/docs/ja/intlayer_with_express.md +2 -2
- package/docs/ja/intlayer_with_nestjs.md +2 -2
- package/docs/ja/intlayer_with_nextjs_14.md +2 -2
- package/docs/ja/intlayer_with_nextjs_15.md +2 -2
- package/docs/ja/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ja/intlayer_with_nuxt.md +2 -2
- package/docs/ja/intlayer_with_react_native+expo.md +18 -29
- package/docs/ja/intlayer_with_react_router_v7.md +204 -250
- package/docs/ja/intlayer_with_tanstack.md +218 -286
- package/docs/ja/intlayer_with_vite+preact.md +9 -9
- package/docs/ja/intlayer_with_vite+react.md +11 -11
- package/docs/ja/intlayer_with_vite+vue.md +11 -11
- package/docs/ko/intlayer_with_angular.md +2 -2
- package/docs/ko/intlayer_with_astro.md +246 -0
- package/docs/ko/intlayer_with_create_react_app.md +3 -2
- package/docs/ko/intlayer_with_express.md +2 -2
- package/docs/ko/intlayer_with_nestjs.md +2 -2
- package/docs/ko/intlayer_with_nextjs_14.md +2 -2
- package/docs/ko/intlayer_with_nextjs_15.md +2 -2
- package/docs/ko/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ko/intlayer_with_nuxt.md +2 -2
- package/docs/ko/intlayer_with_react_native+expo.md +19 -28
- package/docs/ko/intlayer_with_react_router_v7.md +190 -244
- package/docs/ko/intlayer_with_tanstack.md +200 -270
- package/docs/ko/intlayer_with_vite+preact.md +9 -9
- package/docs/ko/intlayer_with_vite+react.md +9 -9
- package/docs/ko/intlayer_with_vite+vue.md +11 -11
- package/docs/pt/intlayer_with_angular.md +2 -2
- package/docs/pt/intlayer_with_astro.md +246 -0
- package/docs/pt/intlayer_with_create_react_app.md +3 -2
- package/docs/pt/intlayer_with_express.md +2 -2
- package/docs/pt/intlayer_with_nestjs.md +2 -2
- package/docs/pt/intlayer_with_nextjs_14.md +2 -2
- package/docs/pt/intlayer_with_nextjs_15.md +2 -2
- package/docs/pt/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/pt/intlayer_with_nuxt.md +2 -2
- package/docs/pt/intlayer_with_react_native+expo.md +11 -20
- package/docs/pt/intlayer_with_react_router_v7.md +7 -13
- package/docs/pt/intlayer_with_tanstack.md +183 -258
- package/docs/pt/intlayer_with_vite+preact.md +9 -9
- package/docs/pt/intlayer_with_vite+react.md +9 -9
- package/docs/pt/intlayer_with_vite+vue.md +9 -9
- package/docs/ru/intlayer_with_angular.md +2 -2
- package/docs/ru/intlayer_with_astro.md +246 -0
- package/docs/ru/intlayer_with_create_react_app.md +3 -2
- package/docs/ru/intlayer_with_express.md +2 -2
- package/docs/ru/intlayer_with_nestjs.md +2 -2
- package/docs/ru/intlayer_with_nextjs_14.md +2 -2
- package/docs/ru/intlayer_with_nextjs_15.md +2 -2
- package/docs/ru/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ru/intlayer_with_nuxt.md +2 -2
- package/docs/ru/intlayer_with_react_native+expo.md +11 -20
- package/docs/ru/intlayer_with_react_router_v7.md +192 -238
- package/docs/ru/intlayer_with_tanstack.md +197 -269
- package/docs/ru/intlayer_with_vite+preact.md +9 -9
- package/docs/ru/intlayer_with_vite+react.md +9 -9
- package/docs/ru/intlayer_with_vite+vue.md +11 -11
- package/docs/tr/how_works_intlayer.md +1 -1
- package/docs/tr/index.md +1 -1
- package/docs/tr/intlayer_cli.md +1 -1
- package/docs/tr/intlayer_with_angular.md +4 -4
- package/docs/tr/intlayer_with_astro.md +246 -0
- package/docs/tr/intlayer_with_create_react_app.md +4 -4
- package/docs/tr/intlayer_with_express.md +3 -3
- package/docs/tr/intlayer_with_lynx+react.md +1 -1
- package/docs/tr/intlayer_with_nestjs.md +2 -2
- package/docs/tr/intlayer_with_nextjs_14.md +2 -2
- package/docs/tr/intlayer_with_nextjs_15.md +4 -4
- package/docs/tr/intlayer_with_nextjs_page_router.md +5 -5
- package/docs/tr/intlayer_with_nuxt.md +4 -4
- package/docs/tr/intlayer_with_react_native+expo.md +12 -21
- package/docs/tr/intlayer_with_react_router_v7.md +222 -267
- package/docs/tr/intlayer_with_tanstack.md +400 -303
- package/docs/tr/intlayer_with_vite+preact.md +12 -12
- package/docs/tr/intlayer_with_vite+react.md +12 -12
- package/docs/tr/intlayer_with_vite+solid.md +2 -2
- package/docs/tr/intlayer_with_vite+svelte.md +2 -2
- package/docs/tr/intlayer_with_vite+vue.md +12 -12
- package/docs/tr/introduction.md +1 -1
- package/docs/tr/packages/react-intlayer/useDictionary.md +1 -1
- package/docs/tr/packages/react-intlayer/useI18n.md +1 -1
- package/docs/tr/roadmap.md +1 -1
- package/docs/zh/intlayer_with_angular.md +2 -2
- package/docs/zh/intlayer_with_astro.md +246 -0
- package/docs/zh/intlayer_with_create_react_app.md +3 -2
- package/docs/zh/intlayer_with_express.md +2 -2
- package/docs/zh/intlayer_with_nestjs.md +2 -2
- package/docs/zh/intlayer_with_nextjs_14.md +2 -2
- package/docs/zh/intlayer_with_nextjs_15.md +2 -2
- package/docs/zh/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/zh/intlayer_with_nuxt.md +2 -2
- package/docs/zh/intlayer_with_react_native+expo.md +19 -28
- package/docs/zh/intlayer_with_react_router_v7.md +200 -248
- package/docs/zh/intlayer_with_tanstack.md +208 -283
- package/docs/zh/intlayer_with_vite+preact.md +9 -9
- package/docs/zh/intlayer_with_vite+react.md +9 -9
- package/docs/zh/intlayer_with_vite+vue.md +9 -9
- package/package.json +11 -11
- package/src/generated/docs.entry.ts +16 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-09-04
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-10-03
|
|
4
4
|
title: React Router v7 में Intlayer के साथ शुरुआत करना
|
|
5
|
-
description: जानें कि कैसे Intlayer का उपयोग करके अपने React Router v7 एप्लिकेशन में अंतरराष्ट्रीयकरण (i18n) जोड़ें। इस व्यापक गाइड का पालन करें ताकि आपका ऐप बहुभाषी और locale
|
|
5
|
+
description: जानें कि कैसे Intlayer का उपयोग करके अपने React Router v7 एप्लिकेशन में अंतरराष्ट्रीयकरण (i18n) जोड़ें। इस व्यापक गाइड का पालन करें ताकि आपका ऐप बहुभाषी और locale-aware रूटिंग के साथ हो।
|
|
6
6
|
keywords:
|
|
7
7
|
- अंतरराष्ट्रीयकरण
|
|
8
8
|
- दस्तावेज़ीकरण
|
|
@@ -17,13 +17,12 @@ slugs:
|
|
|
17
17
|
- environment
|
|
18
18
|
- vite-and-react
|
|
19
19
|
- react-router-v7
|
|
20
|
-
applicationTemplate: https://github.com/
|
|
21
|
-
author: AydinTheFirst
|
|
20
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-react-router-v7-template
|
|
22
21
|
---
|
|
23
22
|
|
|
24
23
|
# Intlayer और React Router v7 के साथ अंतरराष्ट्रीयकरण (i18n) शुरू करना
|
|
25
24
|
|
|
26
|
-
यह गाइड दिखाता है कि कैसे **Intlayer** को React Router v7 प्रोजेक्ट्स में seamless अंतरराष्ट्रीयकरण के लिए locale
|
|
25
|
+
यह गाइड दिखाता है कि कैसे **Intlayer** को React Router v7 प्रोजेक्ट्स में seamless अंतरराष्ट्रीयकरण के लिए एकीकृत किया जाए, जिसमें locale-aware रूटिंग, TypeScript समर्थन, और आधुनिक विकास प्रथाएँ शामिल हैं।
|
|
27
26
|
|
|
28
27
|
## Intlayer क्या है?
|
|
29
28
|
|
|
@@ -31,11 +30,11 @@ author: AydinTheFirst
|
|
|
31
30
|
|
|
32
31
|
Intlayer के साथ, आप कर सकते हैं:
|
|
33
32
|
|
|
34
|
-
- **घोषणात्मक शब्दकोशों का उपयोग करके अनुवादों का आसानी से प्रबंधन करें** जो
|
|
33
|
+
- **घोषणात्मक शब्दकोशों का उपयोग करके अनुवादों का आसानी से प्रबंधन करें** जो कंपोनेंट स्तर पर होते हैं।
|
|
35
34
|
- **मेटाडेटा, रूट्स, और सामग्री को गतिशील रूप से स्थानीयकृत करें**।
|
|
36
|
-
-
|
|
35
|
+
- **TypeScript समर्थन सुनिश्चित करें** autogenerated टाइप्स के साथ, जो ऑटोकम्प्लीशन और त्रुटि पहचान में सुधार करता है।
|
|
37
36
|
- **उन्नत सुविधाओं का लाभ उठाएं**, जैसे गतिशील locale पहचान और स्विचिंग।
|
|
38
|
-
- **React Router v7 के कॉन्फ़िगरेशन-आधारित रूटिंग सिस्टम के साथ locale
|
|
37
|
+
- **React Router v7 के कॉन्फ़िगरेशन-आधारित रूटिंग सिस्टम के साथ locale-aware रूटिंग सक्षम करें**।
|
|
39
38
|
|
|
40
39
|
---
|
|
41
40
|
|
|
@@ -57,14 +56,13 @@ pnpm add vite-intlayer --save-dev
|
|
|
57
56
|
|
|
58
57
|
- **intlayer**
|
|
59
58
|
|
|
60
|
-
- **intlayer**
|
|
61
|
-
|
|
59
|
+
- **intlayer**
|
|
62
60
|
मुख्य पैकेज जो कॉन्फ़िगरेशन प्रबंधन, अनुवाद, [सामग्री घोषणा](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/dictionary/get_started.md), ट्रांसपाइलेशन, और [CLI कमांड्स](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/intlayer_cli.md) के लिए अंतरराष्ट्रीयकरण उपकरण प्रदान करता है।
|
|
63
61
|
|
|
64
|
-
- **react-intlayer**
|
|
62
|
+
- **react-intlayer**
|
|
65
63
|
वह पैकेज जो Intlayer को React एप्लिकेशन के साथ एकीकृत करता है। यह React अंतरराष्ट्रीयकरण के लिए संदर्भ प्रदाता और हुक्स प्रदान करता है।
|
|
66
64
|
|
|
67
|
-
- **vite-intlayer**
|
|
65
|
+
- **vite-intlayer**
|
|
68
66
|
इसमें Vite प्लगइन शामिल है जो Intlayer को [Vite बंडलर](https://vite.dev/guide/why.html#why-bundle-for-production) के साथ एकीकृत करता है, साथ ही उपयोगकर्ता की पसंदीदा भाषा का पता लगाने, कुकीज़ प्रबंधित करने, और URL पुनर्निर्देशन को संभालने के लिए मिडलवेयर भी शामिल है।
|
|
69
67
|
|
|
70
68
|
### चरण 2: अपने प्रोजेक्ट का कॉन्फ़िगरेशन
|
|
@@ -77,10 +75,7 @@ import { type IntlayerConfig, Locales } from "intlayer";
|
|
|
77
75
|
const config: IntlayerConfig = {
|
|
78
76
|
internationalization: {
|
|
79
77
|
defaultLocale: Locales.ENGLISH,
|
|
80
|
-
locales: [Locales.ENGLISH, Locales.
|
|
81
|
-
},
|
|
82
|
-
middleware: {
|
|
83
|
-
prefixDefault: true, // URLs में हमेशा डिफ़ॉल्ट भाषा को प्रीफिक्स करें
|
|
78
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
84
79
|
},
|
|
85
80
|
};
|
|
86
81
|
|
|
@@ -94,10 +89,7 @@ import { Locales } from "intlayer";
|
|
|
94
89
|
const config = {
|
|
95
90
|
internationalization: {
|
|
96
91
|
defaultLocale: Locales.ENGLISH,
|
|
97
|
-
locales: [Locales.ENGLISH, Locales.
|
|
98
|
-
},
|
|
99
|
-
middleware: {
|
|
100
|
-
prefixDefault: true,
|
|
92
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
101
93
|
},
|
|
102
94
|
};
|
|
103
95
|
|
|
@@ -111,70 +103,65 @@ const { Locales } = require("intlayer");
|
|
|
111
103
|
const config = {
|
|
112
104
|
internationalization: {
|
|
113
105
|
defaultLocale: Locales.ENGLISH,
|
|
114
|
-
locales: [Locales.ENGLISH, Locales.
|
|
115
|
-
},
|
|
116
|
-
middleware: {
|
|
117
|
-
prefixDefault: true, // URLs में हमेशा डिफ़ॉल्ट भाषा को प्रीफिक्स करें
|
|
106
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
118
107
|
},
|
|
119
108
|
};
|
|
120
109
|
|
|
121
110
|
module.exports = config;
|
|
122
111
|
```
|
|
123
112
|
|
|
124
|
-
> इस कॉन्फ़िगरेशन फ़ाइल के माध्यम से, आप स्थानीयकृत URL, मिडलवेयर
|
|
125
|
-
|
|
126
|
-
### चरण 3: React Router v7 रूट्स कॉन्फ़िगर करें
|
|
113
|
+
> इस कॉन्फ़िगरेशन फ़ाइल के माध्यम से, आप स्थानीयकृत URL, मिडलवेयर पुनर्निर्देशन, कुकी नाम, आपकी सामग्री घोषणाओं का स्थान और एक्सटेंशन, कंसोल में Intlayer लॉग को अक्षम करना, और भी बहुत कुछ सेट कर सकते हैं। उपलब्ध सभी पैरामीटर की पूरी सूची के लिए, [कॉन्फ़िगरेशन दस्तावेज़](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/configuration.md) देखें।
|
|
127
114
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
```typescript fileName="app/routes.ts" codeFormat="typescript"
|
|
131
|
-
import { layout, route, type RouteConfig } from "@react-router/dev/routes";
|
|
132
|
-
|
|
133
|
-
export default [
|
|
134
|
-
layout("routes/layout.tsx", [
|
|
135
|
-
route("/", "routes/page.tsx"), // रूट पेज - लोकल पर रीडायरेक्ट करता है
|
|
136
|
-
route("/:lang", "routes/[lang]/page.tsx"), // स्थानीयकृत होम पेज
|
|
137
|
-
route("/:lang/about", "routes/[lang]/about/page.tsx"), // स्थानीयकृत अबाउट पेज
|
|
138
|
-
]),
|
|
139
|
-
] satisfies RouteConfig;
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### चरण 4: अपने Vite कॉन्फ़िगरेशन में Intlayer को एकीकृत करें
|
|
115
|
+
### चरण 3: अपने Vite कॉन्फ़िगरेशन में Intlayer को एकीकृत करें
|
|
143
116
|
|
|
144
117
|
अपने कॉन्फ़िगरेशन में intlayer प्लगइन जोड़ें:
|
|
145
118
|
|
|
146
|
-
```typescript fileName="vite.config.ts"
|
|
119
|
+
```typescript fileName="vite.config.ts"
|
|
147
120
|
import { reactRouter } from "@react-router/dev/vite";
|
|
148
121
|
import { defineConfig } from "vite";
|
|
149
|
-
import {
|
|
122
|
+
import { intlayer } from "vite-intlayer";
|
|
150
123
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
151
124
|
|
|
152
125
|
export default defineConfig({
|
|
153
|
-
plugins: [
|
|
154
|
-
reactRouter(),
|
|
155
|
-
tsconfigPaths(),
|
|
156
|
-
intlayer(),
|
|
157
|
-
intlayerMiddlewarePlugin(),
|
|
158
|
-
],
|
|
126
|
+
plugins: [reactRouter(), tsconfigPaths(), intlayer()],
|
|
159
127
|
});
|
|
160
128
|
```
|
|
161
129
|
|
|
162
|
-
> `intlayer()` Vite प्लगइन का उपयोग Intlayer को Vite के साथ एकीकृत करने के लिए किया जाता है। यह
|
|
130
|
+
> `intlayer()` Vite प्लगइन का उपयोग Intlayer को Vite के साथ एकीकृत करने के लिए किया जाता है। यह सामग्री घोषणा फ़ाइलों के निर्माण को सुनिश्चित करता है और विकास मोड में उनकी निगरानी करता है। यह Vite एप्लिकेशन के भीतर Intlayer पर्यावरण चर को परिभाषित करता है। इसके अतिरिक्त, यह प्रदर्शन को अनुकूलित करने के लिए उपनाम प्रदान करता है।
|
|
131
|
+
|
|
132
|
+
### चरण 4: React Router v7 रूट्स कॉन्फ़िगर करें
|
|
133
|
+
|
|
134
|
+
अपने रूटिंग कॉन्फ़िगरेशन को स्थानीय-जानकारी वाले रूट्स के साथ सेट करें:
|
|
135
|
+
|
|
136
|
+
```typescript fileName="app/routes.ts"
|
|
137
|
+
typescript;
|
|
138
|
+
import { layout, route, type RouteConfig } from "@react-router/dev/routes";
|
|
139
|
+
|
|
140
|
+
export default [
|
|
141
|
+
layout("routes/layout.tsx", [
|
|
142
|
+
route("/:lang?", "routes/page.tsx"), // स्थानीयकृत होम पेज
|
|
143
|
+
route("/:lang?/about", "routes/about/page.tsx"), // स्थानीयकृत अबाउट पेज
|
|
144
|
+
]),
|
|
145
|
+
] satisfies RouteConfig;
|
|
146
|
+
```
|
|
163
147
|
|
|
164
|
-
### चरण 5: लेआउट
|
|
148
|
+
### चरण 5: लेआउट कंपोनेंट बनाएं
|
|
165
149
|
|
|
166
150
|
अपने रूट लेआउट और स्थानीय-विशिष्ट लेआउट सेट करें:
|
|
167
151
|
|
|
168
152
|
#### रूट लेआउट
|
|
169
153
|
|
|
170
|
-
```tsx fileName="app/routes/layout.tsx"
|
|
171
|
-
// app/routes/layout.tsx
|
|
172
|
-
import { Outlet } from "react-router";
|
|
154
|
+
```tsx fileName="app/routes/layout.tsx"
|
|
173
155
|
import { IntlayerProvider } from "react-intlayer";
|
|
156
|
+
import { Outlet } from "react-router";
|
|
157
|
+
|
|
158
|
+
import type { Route } from "./+types/layout";
|
|
159
|
+
|
|
160
|
+
export default function RootLayout({ params }: Route.ComponentProps) {
|
|
161
|
+
const { locale } = params;
|
|
174
162
|
|
|
175
|
-
export default function RootLayout() {
|
|
176
163
|
return (
|
|
177
|
-
<IntlayerProvider>
|
|
164
|
+
<IntlayerProvider locale={locale}>
|
|
178
165
|
<Outlet />
|
|
179
166
|
</IntlayerProvider>
|
|
180
167
|
);
|
|
@@ -183,9 +170,9 @@ export default function RootLayout() {
|
|
|
183
170
|
|
|
184
171
|
### चरण 6: अपनी सामग्री घोषित करें
|
|
185
172
|
|
|
186
|
-
|
|
173
|
+
अपनी अनुवादों को संग्रहीत करने के लिए अपनी सामग्री घोषणाएँ बनाएं और प्रबंधित करें:
|
|
187
174
|
|
|
188
|
-
```tsx fileName="app/routes/[lang]/page.content.ts"
|
|
175
|
+
```tsx fileName="app/routes/[lang]/page.content.ts"
|
|
189
176
|
import { t, type Dictionary } from "intlayer";
|
|
190
177
|
|
|
191
178
|
const pageContent = {
|
|
@@ -193,19 +180,23 @@ const pageContent = {
|
|
|
193
180
|
content: {
|
|
194
181
|
title: t({
|
|
195
182
|
en: "Welcome to React Router v7 + Intlayer",
|
|
196
|
-
|
|
183
|
+
es: "Bienvenido a React Router v7 + Intlayer",
|
|
184
|
+
fr: "Bienvenue sur React Router v7 + Intlayer",
|
|
197
185
|
}),
|
|
198
186
|
description: t({
|
|
199
187
|
en: "Build multilingual applications with ease using React Router v7 and Intlayer.",
|
|
200
|
-
|
|
188
|
+
es: "Cree aplicaciones multilingües fácilmente usando React Router v7 y Intlayer.",
|
|
189
|
+
fr: "Créez des applications multilingues facilement avec React Router v7 et Intlayer.",
|
|
201
190
|
}),
|
|
202
191
|
aboutLink: t({
|
|
203
192
|
en: "हमारे बारे में जानें",
|
|
204
|
-
|
|
193
|
+
es: "Aprender Sobre Nosotros",
|
|
194
|
+
fr: "En savoir plus sur nous",
|
|
205
195
|
}),
|
|
206
196
|
homeLink: t({
|
|
207
197
|
en: "होम",
|
|
208
|
-
|
|
198
|
+
es: "Inicio",
|
|
199
|
+
fr: "Accueil",
|
|
209
200
|
}),
|
|
210
201
|
},
|
|
211
202
|
} satisfies Dictionary;
|
|
@@ -217,159 +208,162 @@ export default pageContent;
|
|
|
217
208
|
|
|
218
209
|
> अधिक विवरण के लिए, [सामग्री घोषणा प्रलेखन](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/dictionary/get_started.md) देखें।
|
|
219
210
|
|
|
220
|
-
### चरण 7:
|
|
211
|
+
### चरण 7: स्थानीय-जानकारी वाले घटक बनाएँ
|
|
221
212
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
```tsx fileName="app/components/localized-link.tsx" codeFormat="typescript"
|
|
225
|
-
// app/components/localized-link.tsx
|
|
226
|
-
import { getLocalizedUrl } from "intlayer";
|
|
227
|
-
import { useLocale } from "react-intlayer";
|
|
228
|
-
import React from "react";
|
|
229
|
-
import { Link, useLocation } from "react-router";
|
|
213
|
+
स्थानीय-जानकारी वाले नेविगेशन के लिए `LocalizedLink` घटक बनाएँ:
|
|
230
214
|
|
|
231
|
-
|
|
215
|
+
```tsx fileName="app/components/localized-link.tsx"
|
|
216
|
+
import type { FC } from "react";
|
|
232
217
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
218
|
+
import { getLocalizedUrl, type LocalesValues } from "intlayer";
|
|
219
|
+
import { useLocale } from "react-intlayer";
|
|
220
|
+
import { Link, type LinkProps, type To } from "react-router";
|
|
236
221
|
|
|
237
|
-
|
|
238
|
-
|
|
222
|
+
// यह फ़ंक्शन जांचता है कि लिंक बाहरी है या नहीं
|
|
223
|
+
const isExternalLink = (to: string) => /^(https?:)?\/\//.test(to);
|
|
239
224
|
|
|
225
|
+
// यह फ़ंक्शन दिए गए पते को स्थानीयकृत URL में परिवर्तित करता है
|
|
226
|
+
export const locacalizeTo = (to: To, locale: LocalesValues): To => {
|
|
240
227
|
if (typeof to === "string") {
|
|
241
|
-
if (
|
|
242
|
-
return
|
|
228
|
+
if (isExternalLink(to)) {
|
|
229
|
+
return to;
|
|
243
230
|
}
|
|
244
|
-
|
|
231
|
+
|
|
232
|
+
return getLocalizedUrl(to, locale);
|
|
245
233
|
}
|
|
246
234
|
|
|
247
|
-
if (to
|
|
248
|
-
|
|
249
|
-
if (pathname && pathname.startsWith("/") && !isExternal(pathname)) {
|
|
250
|
-
return (
|
|
251
|
-
<Link
|
|
252
|
-
to={{ ...to, pathname: getLocalizedUrl(pathname, locale) }}
|
|
253
|
-
{...props}
|
|
254
|
-
/>
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
return <Link to={to} {...props} />;
|
|
235
|
+
if (isExternalLink(to.pathname ?? "")) {
|
|
236
|
+
return to;
|
|
258
237
|
}
|
|
259
238
|
|
|
260
|
-
return
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
```
|
|
239
|
+
return {
|
|
240
|
+
...to,
|
|
241
|
+
pathname: getLocalizedUrl(to.pathname ?? "", locale),
|
|
242
|
+
};
|
|
243
|
+
};
|
|
268
244
|
|
|
269
|
-
|
|
245
|
+
// यह स्थानीयकृत लिंक के लिए एक React functional component है
|
|
246
|
+
export const LocalizedLink: FC<LinkProps> = (props) => {
|
|
247
|
+
const { locale } = useLocale();
|
|
270
248
|
|
|
271
|
-
|
|
249
|
+
return <Link {...props} to={locacalizeTo(props.to, locale)} />;
|
|
250
|
+
};
|
|
251
|
+
```
|
|
272
252
|
|
|
273
|
-
|
|
253
|
+
यदि आप स्थानीयकृत मार्गों पर नेविगेट करना चाहते हैं, तो आप `useLocalizedNavigate` हुक का उपयोग कर सकते हैं:
|
|
274
254
|
|
|
275
|
-
```tsx fileName="app/
|
|
276
|
-
|
|
277
|
-
import {
|
|
278
|
-
import { Navigate } from "react-router";
|
|
255
|
+
```tsx fileName="app/hooks/useLocalizedNavigate.ts"
|
|
256
|
+
import { useLocale } from "intlayer";
|
|
257
|
+
import { type NavigateOptions, type To, useNavigate } from "react-router";
|
|
279
258
|
|
|
280
|
-
|
|
259
|
+
import { locacalizeTo } from "~/components/localized-link";
|
|
260
|
+
|
|
261
|
+
export const useLocalizedNavigate = () => {
|
|
262
|
+
const navigate = useNavigate();
|
|
281
263
|
const { locale } = useLocale();
|
|
282
264
|
|
|
283
|
-
|
|
284
|
-
|
|
265
|
+
const localizedNavigate = (to: To, options?: NavigateOptions) => {
|
|
266
|
+
const localedTo = locacalizeTo(to, locale);
|
|
267
|
+
|
|
268
|
+
navigate(localedTo, options);
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
return localizedNavigate;
|
|
272
|
+
};
|
|
285
273
|
```
|
|
286
274
|
|
|
275
|
+
### चरण 8: अपने पृष्ठों में Intlayer का उपयोग करें
|
|
276
|
+
|
|
277
|
+
अपने एप्लिकेशन में अपने कंटेंट डिक्शनरीज़ तक पहुँचें:
|
|
278
|
+
|
|
287
279
|
#### स्थानीयकृत होम पेज
|
|
288
280
|
|
|
289
|
-
```tsx fileName="app/routes/[lang]/page.tsx"
|
|
290
|
-
import { useIntlayer } from "react
|
|
291
|
-
import LocalizedLink from "~/components/localized-link";
|
|
281
|
+
```tsx fileName="app/routes/[lang]/page.tsx"
|
|
282
|
+
import { useIntlayer } from "react-intlayer";
|
|
283
|
+
import { LocalizedLink } from "~/components/localized-link";
|
|
292
284
|
|
|
293
285
|
export default function Page() {
|
|
294
|
-
const
|
|
286
|
+
const { title, description, aboutLink } = useIntlayer("page");
|
|
295
287
|
|
|
296
288
|
return (
|
|
297
|
-
<div
|
|
298
|
-
<h1>{
|
|
299
|
-
<p>{
|
|
300
|
-
<nav
|
|
301
|
-
<LocalizedLink
|
|
302
|
-
to="/about"
|
|
303
|
-
style={{
|
|
304
|
-
display: "inline-block",
|
|
305
|
-
padding: "0.5rem 1rem",
|
|
306
|
-
backgroundColor: "#007bff",
|
|
307
|
-
color: "white",
|
|
308
|
-
textDecoration: "none",
|
|
309
|
-
borderRadius: "4px",
|
|
310
|
-
}}
|
|
311
|
-
>
|
|
312
|
-
{content.aboutLink}
|
|
313
|
-
</LocalizedLink>
|
|
289
|
+
<div>
|
|
290
|
+
<h1>{title}</h1>
|
|
291
|
+
<p>{description}</p>
|
|
292
|
+
<nav>
|
|
293
|
+
<LocalizedLink to="/about">{aboutLink}</LocalizedLink>
|
|
314
294
|
</nav>
|
|
315
295
|
</div>
|
|
316
296
|
);
|
|
317
297
|
}
|
|
318
298
|
```
|
|
319
299
|
|
|
320
|
-
> `useIntlayer` हुक के बारे में अधिक जानने के लिए, [
|
|
300
|
+
> `useIntlayer` हुक के बारे में अधिक जानने के लिए, [डॉक्यूमेंटेशन](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/packages/react-intlayer/useIntlayer.md) देखें।
|
|
321
301
|
|
|
322
|
-
### चरण 9: एक लोकल स्विचर
|
|
302
|
+
### चरण 9: एक लोकल स्विचर कंपोनेंट बनाएं
|
|
323
303
|
|
|
324
304
|
उपयोगकर्ताओं को भाषाएँ बदलने की अनुमति देने के लिए एक कॉम्पोनेंट बनाएं:
|
|
325
305
|
|
|
326
|
-
```tsx fileName="app/components/locale-switcher.tsx"
|
|
327
|
-
import {
|
|
328
|
-
import { useLocale } from "react-intlayer";
|
|
329
|
-
import { useLocation, useNavigate } from "react-router";
|
|
306
|
+
```tsx fileName="app/components/locale-switcher.tsx"
|
|
307
|
+
import type { FC } from "react";
|
|
330
308
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
309
|
+
import {
|
|
310
|
+
getHTMLTextDir,
|
|
311
|
+
getLocaleName,
|
|
312
|
+
getLocalizedUrl,
|
|
313
|
+
getPathWithoutLocale,
|
|
314
|
+
} from "intlayer";
|
|
315
|
+
import { setLocaleCookie, useIntlayer, useLocale } from "react-intlayer";
|
|
316
|
+
import { Link, useLocation } from "react-router";
|
|
335
317
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
};
|
|
318
|
+
export const LocaleSwitcher: FC = () => {
|
|
319
|
+
const { localeSwitcherLabel } = useIntlayer("locale-switcher");
|
|
320
|
+
const { pathname } = useLocation();
|
|
321
|
+
|
|
322
|
+
const { availableLocales, locale } = useLocale();
|
|
323
|
+
|
|
324
|
+
const pathWithoutLocale = getPathWithoutLocale(pathname);
|
|
344
325
|
|
|
345
326
|
return (
|
|
346
|
-
<
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
327
|
+
<ol>
|
|
328
|
+
{availableLocales.map((localeItem) => (
|
|
329
|
+
<li key={localeItem}>
|
|
330
|
+
<Link
|
|
331
|
+
aria-current={localeItem === locale ? "page" : undefined}
|
|
332
|
+
aria-label={`${localeSwitcherLabel.value} ${getLocaleName(localeItem)}`}
|
|
333
|
+
onClick={() => setLocaleCookie(localeItem)}
|
|
334
|
+
to={getLocalizedUrl(pathWithoutLocale, localeItem)}
|
|
335
|
+
>
|
|
336
|
+
<span>
|
|
337
|
+
{/* लोकल - उदाहरण के लिए FR */}
|
|
338
|
+
{localeItem}
|
|
339
|
+
</span>
|
|
340
|
+
<span>
|
|
341
|
+
{/* अपनी लोकल में भाषा - उदाहरण के लिए Français */}
|
|
342
|
+
{getLocaleName(localeItem, locale)}
|
|
343
|
+
</span>
|
|
344
|
+
<span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
|
|
345
|
+
{/* वर्तमान लोकल में भाषा - उदाहरण के लिए Francés जब वर्तमान लोकल Locales.SPANISH सेट हो */}
|
|
346
|
+
{getLocaleName(localeItem)}
|
|
347
|
+
</span>
|
|
348
|
+
<span dir="ltr" lang={Locales.ENGLISH}>
|
|
349
|
+
{/* अंग्रेज़ी में भाषा - उदाहरण के लिए French */}
|
|
350
|
+
{getLocaleName(localeItem, Locales.ENGLISH)}
|
|
351
|
+
</span>
|
|
352
|
+
</Link>
|
|
353
|
+
</li>
|
|
354
|
+
))}
|
|
355
|
+
</ol>
|
|
361
356
|
);
|
|
362
|
-
}
|
|
357
|
+
};
|
|
363
358
|
```
|
|
364
359
|
|
|
365
|
-
> `useLocale` हुक के बारे में अधिक जानने के लिए, [दस्तावेज़](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/packages/react-intlayer/useLocale.md) देखें।
|
|
360
|
+
> `useLocale` हुक के बारे में अधिक जानने के लिए, कृपया [दस्तावेज़](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/packages/react-intlayer/useLocale.md) देखें।
|
|
366
361
|
|
|
367
362
|
### चरण 10: HTML एट्रिब्यूट्स प्रबंधन जोड़ें (वैकल्पिक)
|
|
368
363
|
|
|
369
364
|
HTML lang और dir एट्रिब्यूट्स को प्रबंधित करने के लिए एक हुक बनाएं:
|
|
370
365
|
|
|
371
|
-
```tsx fileName="app/hooks/useI18nHTMLAttributes.tsx"
|
|
372
|
-
// app/hooks/useI18nHTMLAttributes.tsx
|
|
366
|
+
```tsx fileName="app/hooks/useI18nHTMLAttributes.tsx"
|
|
373
367
|
import { getHTMLTextDir } from "intlayer";
|
|
374
368
|
import { useEffect } from "react";
|
|
375
369
|
import { useLocale } from "react-intlayer";
|
|
@@ -386,8 +380,7 @@ export const useI18nHTMLAttributes = () => {
|
|
|
386
380
|
|
|
387
381
|
फिर इसे अपने रूट कॉम्पोनेंट में उपयोग करें:
|
|
388
382
|
|
|
389
|
-
```tsx fileName="app/
|
|
390
|
-
// app/routes/layout.tsx
|
|
383
|
+
```tsx fileName="app/routes/layout.tsx"
|
|
391
384
|
import { Outlet } from "react-router";
|
|
392
385
|
import { IntlayerProvider } from "react-intlayer";
|
|
393
386
|
|
|
@@ -404,94 +397,56 @@ export default function RootLayout() {
|
|
|
404
397
|
}
|
|
405
398
|
```
|
|
406
399
|
|
|
407
|
-
### चरण 11:
|
|
408
|
-
|
|
409
|
-
सामग्री शब्दकोश बनाएं और अपने एप्लिकेशन को चलाएं:
|
|
400
|
+
### चरण 11: मिडलवेयर जोड़ें (वैकल्पिक)
|
|
410
401
|
|
|
411
|
-
|
|
412
|
-
# Intlayer शब्दकोश बनाएं
|
|
413
|
-
npm run intlayer:build
|
|
402
|
+
आप अपने एप्लिकेशन में सर्वर-साइड रूटिंग जोड़ने के लिए `intlayerMiddleware` का भी उपयोग कर सकते हैं। यह प्लगइन URL के आधार पर वर्तमान लोकल का स्वचालित रूप से पता लगाएगा और उपयुक्त लोकल कुकी सेट करेगा। यदि कोई लोकल निर्दिष्ट नहीं है, तो प्लगइन उपयोगकर्ता के ब्राउज़र भाषा प्राथमिकताओं के आधार पर सबसे उपयुक्त लोकल निर्धारित करेगा। यदि कोई लोकल पता नहीं चलता है, तो यह डिफ़ॉल्ट लोकल पर पुनः निर्देशित करेगा।
|
|
414
403
|
|
|
415
|
-
|
|
416
|
-
npm run dev
|
|
417
|
-
```
|
|
404
|
+
> ध्यान दें कि उत्पादन में `intlayerMiddleware` का उपयोग करने के लिए, आपको `vite-intlayer` पैकेज को `devDependencies` से `dependencies` में स्विच करना होगा।
|
|
418
405
|
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
|
|
406
|
+
```typescript {3,7} fileName="vite.config.ts"
|
|
407
|
+
import { defineConfig } from "vite";
|
|
408
|
+
import react from "@vitejs/plugin-react-swc";
|
|
409
|
+
import { intlayer, intlayerMiddleware } from "vite-intlayer";
|
|
422
410
|
|
|
423
|
-
|
|
424
|
-
|
|
411
|
+
// https://vitejs.dev/config/
|
|
412
|
+
export default defineConfig({
|
|
413
|
+
plugins: [react(), intlayer(), intlayerMiddleware()],
|
|
414
|
+
});
|
|
425
415
|
```
|
|
426
416
|
|
|
427
|
-
|
|
428
|
-
# Intlayer शब्दकोश बनाएं
|
|
429
|
-
yarn intlayer:build
|
|
430
|
-
|
|
431
|
-
# विकास सर्वर शुरू करें
|
|
432
|
-
yarn dev
|
|
433
|
-
```
|
|
417
|
+
---
|
|
434
418
|
|
|
435
|
-
|
|
419
|
+
## टाइपस्क्रिप्ट कॉन्फ़िगर करें
|
|
436
420
|
|
|
437
|
-
Intlayer
|
|
421
|
+
Intlayer टाइपस्क्रिप्ट के लाभ प्राप्त करने और आपके कोडबेस को मजबूत बनाने के लिए मॉड्यूल ऑगमेंटेशन का उपयोग करता है।
|
|
438
422
|
|
|
439
|
-
सुनिश्चित करें कि आपकी
|
|
423
|
+
सुनिश्चित करें कि आपकी टाइपस्क्रिप्ट कॉन्फ़िगरेशन में स्वचालित रूप से उत्पन्न प्रकार शामिल हैं:
|
|
440
424
|
|
|
441
425
|
```json5 fileName="tsconfig.json"
|
|
442
426
|
{
|
|
443
|
-
|
|
444
|
-
// ... आपकी मौजूदा TypeScript कॉन्फ़िगरेशन
|
|
445
|
-
},
|
|
427
|
+
// ... आपके मौजूदा कॉन्फ़िगरेशन
|
|
446
428
|
include: [
|
|
447
|
-
// ...
|
|
448
|
-
".intlayer/**/*.ts", //
|
|
429
|
+
// ... आपके मौजूदा शामिल
|
|
430
|
+
".intlayer/**/*.ts", // स्वचालित रूप से उत्पन्न प्रकार शामिल करें
|
|
449
431
|
],
|
|
450
432
|
}
|
|
451
433
|
```
|
|
452
434
|
|
|
453
|
-
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## गिट कॉन्फ़िगरेशन
|
|
454
438
|
|
|
455
|
-
यह अनुशंसित है कि Intlayer द्वारा
|
|
439
|
+
यह अनुशंसित है कि Intlayer द्वारा उत्पन्न फ़ाइलों को अनदेखा किया जाए। इससे आप उन्हें अपने गिट रिपॉजिटरी में कमिट करने से बच सकते हैं।
|
|
456
440
|
|
|
457
|
-
|
|
441
|
+
ऐसा करने के लिए, आप अपनी `.gitignore` फ़ाइल में निम्नलिखित निर्देश जोड़ सकते हैं:
|
|
458
442
|
|
|
459
443
|
```plaintext fileName=".gitignore"
|
|
460
|
-
# Intlayer द्वारा
|
|
444
|
+
# Intlayer द्वारा उत्पन्न फ़ाइलों को अनदेखा करें
|
|
461
445
|
.intlayer
|
|
462
446
|
```
|
|
463
447
|
|
|
464
448
|
---
|
|
465
449
|
|
|
466
|
-
## प्रोडक्शन डिप्लॉयमेंट
|
|
467
|
-
|
|
468
|
-
जब आप अपना एप्लिकेशन डिप्लॉय करें:
|
|
469
|
-
|
|
470
|
-
1. **अपना एप्लिकेशन बनाएं:**
|
|
471
|
-
|
|
472
|
-
```bash
|
|
473
|
-
npm run build
|
|
474
|
-
```
|
|
475
|
-
|
|
476
|
-
2. **Intlayer शब्दकोश बनाएं:**
|
|
477
|
-
|
|
478
|
-
```bash
|
|
479
|
-
npm run intlayer:build
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
3. **यदि प्रोडक्शन में मिडलवेयर का उपयोग कर रहे हैं तो `vite-intlayer` को dependencies में जोड़ें:**
|
|
483
|
-
```bash
|
|
484
|
-
npm install vite-intlayer --save
|
|
485
|
-
```
|
|
486
|
-
|
|
487
|
-
आपका एप्लिकेशन अब निम्नलिखित का समर्थन करेगा:
|
|
488
|
-
|
|
489
|
-
- **URL संरचना**: `/en`, `/en/about`, `/tr`, `/tr/about`
|
|
490
|
-
- ब्राउज़र प्राथमिकताओं के आधार पर **स्वचालित लोकल डिटेक्शन**
|
|
491
|
-
- React Router v7 के साथ **लोकल-अवेयर राउटिंग**
|
|
492
|
-
- ऑटो-जनरेटेड टाइप्स के साथ **TypeScript समर्थन**
|
|
493
|
-
- उचित लोकल हैंडलिंग के साथ **सर्वर-साइड रेंडरिंग**
|
|
494
|
-
|
|
495
450
|
## VS कोड एक्सटेंशन
|
|
496
451
|
|
|
497
452
|
Intlayer के साथ अपने विकास अनुभव को बेहतर बनाने के लिए, आप आधिकारिक **Intlayer VS कोड एक्सटेंशन** इंस्टॉल कर सकते हैं।
|
|
@@ -500,18 +455,18 @@ Intlayer के साथ अपने विकास अनुभव को
|
|
|
500
455
|
|
|
501
456
|
यह एक्सटेंशन प्रदान करता है:
|
|
502
457
|
|
|
503
|
-
- अनुवाद कुंजियों के लिए
|
|
504
|
-
- गायब अनुवादों के लिए
|
|
505
|
-
- अनुवादित सामग्री के **इनलाइन
|
|
506
|
-
-
|
|
458
|
+
- अनुवाद कुंजियों के लिए **ऑटोकंप्लीशन**।
|
|
459
|
+
- गायब अनुवादों के लिए **रीयल-टाइम त्रुटि पहचान**।
|
|
460
|
+
- अनुवादित सामग्री के **इनलाइन पूर्वावलोकन**।
|
|
461
|
+
- अनुवादों को आसानी से बनाने और अपडेट करने के लिए **त्वरित क्रियाएँ**।
|
|
507
462
|
|
|
508
|
-
एक्सटेंशन का उपयोग कैसे करें, इसके लिए अधिक
|
|
463
|
+
एक्सटेंशन का उपयोग कैसे करें, इसके लिए अधिक विवरण के लिए देखें [Intlayer VS कोड एक्सटेंशन दस्तावेज़](https://intlayer.org/doc/vs-code-extension)।
|
|
509
464
|
|
|
510
465
|
---
|
|
511
466
|
|
|
512
467
|
## आगे बढ़ें
|
|
513
468
|
|
|
514
|
-
आगे बढ़ने के लिए, आप [विज़ुअल एडिटर](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) का उपयोग करके बाहरी कर सकते हैं।
|
|
469
|
+
आगे बढ़ने के लिए, आप [विज़ुअल एडिटर](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) का उपयोग करके बाहरी रूप से प्रबंधित कर सकते हैं।
|
|
515
470
|
|
|
516
471
|
---
|
|
517
472
|
|
|
@@ -520,14 +475,15 @@ Intlayer के साथ अपने विकास अनुभव को
|
|
|
520
475
|
- [Intlayer दस्तावेज़](https://intlayer.org)
|
|
521
476
|
- [React Router v7 दस्तावेज़](https://reactrouter.com/)
|
|
522
477
|
- [useIntlayer हुक](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/packages/react-intlayer/useIntlayer.md)
|
|
523
|
-
- [useLocale
|
|
478
|
+
- [useLocale हुक](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/packages/react-intlayer/useLocale.md)
|
|
524
479
|
- [सामग्री घोषणा](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/dictionary/get_started.md)
|
|
525
480
|
- [कॉन्फ़िगरेशन](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/configuration.md)
|
|
526
481
|
|
|
527
|
-
यह व्यापक मार्गदर्शिका आपको Intlayer को React Router v7 के साथ पूरी तरह से अंतरराष्ट्रीयकृत एप्लिकेशन के लिए एकीकृत करने
|
|
482
|
+
यह व्यापक मार्गदर्शिका आपको Intlayer को React Router v7 के साथ पूरी तरह से अंतरराष्ट्रीयकृत एप्लिकेशन के लिए एकीकृत करने के लिए आवश्यक सभी जानकारी प्रदान करती है, जिसमें स्थानीय-जानकारी वाले रूटिंग और TypeScript समर्थन शामिल हैं।
|
|
528
483
|
|
|
529
484
|
## दस्तावेज़ इतिहास
|
|
530
485
|
|
|
531
|
-
| संस्करण | तिथि
|
|
532
|
-
| ------- |
|
|
533
|
-
|
|
|
486
|
+
| संस्करण | तिथि | परिवर्तन |
|
|
487
|
+
| ------- | ---------- | ---------------------------- |
|
|
488
|
+
| 6.1.5 | 2025-10-03 | दस्तावेज़ अपडेट किया गया |
|
|
489
|
+
| 5.8.2 | 2025-09-04 | React Router v7 के लिए जोड़ा |
|