@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.
Files changed (90) hide show
  1. package/dist/cjs/generated/docs.entry.cjs +19 -0
  2. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  3. package/dist/esm/generated/docs.entry.mjs +19 -0
  4. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  5. package/dist/types/generated/docs.entry.d.ts +1 -0
  6. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  7. package/docs/ar/intlayer_with_nuxt.md +305 -421
  8. package/docs/ar/intlayer_with_react_router_v7.md +33 -4
  9. package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +516 -0
  10. package/docs/ar/intlayer_with_tanstack.md +2 -12
  11. package/docs/ar/intlayer_with_vite+vue.md +1 -0
  12. package/docs/de/intlayer_with_nuxt.md +296 -394
  13. package/docs/de/intlayer_with_react_router_v7.md +33 -4
  14. package/docs/de/intlayer_with_react_router_v7_fs_routes.md +573 -0
  15. package/docs/de/intlayer_with_tanstack.md +1 -0
  16. package/docs/de/intlayer_with_vite+vue.md +1 -0
  17. package/docs/en/intlayer_with_nuxt.md +242 -321
  18. package/docs/en/intlayer_with_react_router_v7.md +24 -0
  19. package/docs/en/intlayer_with_react_router_v7_fs_routes.md +570 -0
  20. package/docs/en/intlayer_with_tanstack.md +2 -12
  21. package/docs/en/intlayer_with_vite+vue.md +49 -48
  22. package/docs/en-GB/intlayer_with_nuxt.md +262 -358
  23. package/docs/en-GB/intlayer_with_react_router_v7.md +33 -4
  24. package/docs/en-GB/intlayer_with_react_router_v7_fs_routes.md +513 -0
  25. package/docs/en-GB/intlayer_with_tanstack.md +2 -12
  26. package/docs/en-GB/intlayer_with_vite+vue.md +1 -0
  27. package/docs/es/intlayer_with_nuxt.md +284 -375
  28. package/docs/es/intlayer_with_react_router_v7.md +33 -4
  29. package/docs/es/intlayer_with_react_router_v7_fs_routes.md +575 -0
  30. package/docs/es/intlayer_with_tanstack.md +1 -0
  31. package/docs/es/intlayer_with_vite+vue.md +1 -2
  32. package/docs/fr/intlayer_with_nuxt.md +288 -387
  33. package/docs/fr/intlayer_with_react_router_v7.md +34 -5
  34. package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +574 -0
  35. package/docs/fr/intlayer_with_tanstack.md +1 -0
  36. package/docs/fr/intlayer_with_vite+vue.md +1 -0
  37. package/docs/hi/intlayer_with_nuxt.md +318 -434
  38. package/docs/hi/intlayer_with_react_router_v7.md +33 -4
  39. package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +518 -0
  40. package/docs/hi/intlayer_with_tanstack.md +2 -12
  41. package/docs/hi/intlayer_with_vite+vue.md +1 -0
  42. package/docs/id/intlayer_with_nuxt.md +275 -376
  43. package/docs/id/intlayer_with_react_router_v7.md +29 -4
  44. package/docs/id/intlayer_with_react_router_v7_fs_routes.md +521 -0
  45. package/docs/id/intlayer_with_tanstack.md +2 -12
  46. package/docs/id/intlayer_with_vite+vue.md +1 -0
  47. package/docs/it/intlayer_with_nuxt.md +312 -408
  48. package/docs/it/intlayer_with_react_router_v7.md +33 -4
  49. package/docs/it/intlayer_with_react_router_v7_fs_routes.md +574 -0
  50. package/docs/it/intlayer_with_tanstack.md +1 -0
  51. package/docs/ja/intlayer_with_nuxt.md +319 -414
  52. package/docs/ja/intlayer_with_react_router_v7.md +33 -4
  53. package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +574 -0
  54. package/docs/ja/intlayer_with_tanstack.md +2 -12
  55. package/docs/ja/intlayer_with_vite+vue.md +1 -0
  56. package/docs/ko/intlayer_with_nuxt.md +307 -406
  57. package/docs/ko/intlayer_with_react_router_v7.md +33 -4
  58. package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +515 -0
  59. package/docs/ko/intlayer_with_tanstack.md +2 -12
  60. package/docs/ko/intlayer_with_vite+vue.md +1 -0
  61. package/docs/pl/intlayer_with_nuxt.md +282 -457
  62. package/docs/pl/intlayer_with_react_router_v7.md +32 -5
  63. package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +615 -0
  64. package/docs/pl/intlayer_with_tanstack.md +2 -12
  65. package/docs/pl/intlayer_with_vite+vue.md +1 -0
  66. package/docs/pt/intlayer_with_nuxt.md +288 -403
  67. package/docs/pt/intlayer_with_react_router_v7.md +28 -0
  68. package/docs/pt/intlayer_with_tanstack.md +1 -0
  69. package/docs/ru/intlayer_with_nuxt.md +300 -410
  70. package/docs/ru/intlayer_with_react_router_v7.md +33 -4
  71. package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +574 -0
  72. package/docs/ru/intlayer_with_tanstack.md +1 -0
  73. package/docs/ru/intlayer_with_vite+vue.md +1 -0
  74. package/docs/tr/intlayer_with_nuxt.md +327 -392
  75. package/docs/tr/intlayer_with_react_router_v7.md +33 -4
  76. package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +572 -0
  77. package/docs/tr/intlayer_with_tanstack.md +2 -12
  78. package/docs/tr/intlayer_with_vite+vue.md +1 -0
  79. package/docs/vi/intlayer_with_nuxt.md +282 -399
  80. package/docs/vi/intlayer_with_react_router_v7.md +29 -4
  81. package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +523 -0
  82. package/docs/vi/intlayer_with_tanstack.md +2 -12
  83. package/docs/vi/intlayer_with_vite+vue.md +1 -0
  84. package/docs/zh/intlayer_with_nuxt.md +311 -444
  85. package/docs/zh/intlayer_with_react_router_v7.md +33 -4
  86. package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +516 -0
  87. package/docs/zh/intlayer_with_tanstack.md +2 -12
  88. package/docs/zh/intlayer_with_vite+vue.md +1 -0
  89. package/package.json +6 -6
  90. package/src/generated/docs.entry.ts +19 -0
@@ -18,6 +18,7 @@ slugs:
18
18
  - vite-and-react
19
19
  - react-router-v7
20
20
  applicationTemplate: https://github.com/aymericzip/intlayer-react-router-v7-template
21
+ youtubeVideo: https://www.youtube.com/watch?v=dS9L7uJeak4
21
22
  history:
22
23
  - version: 6.1.5
23
24
  date: 2025-10-03
@@ -31,6 +32,10 @@ history:
31
32
 
32
33
  यह गाइड दिखाता है कि कैसे **Intlayer** को React Router v7 प्रोजेक्ट्स में seamless अंतरराष्ट्रीयकरण के लिए एकीकृत किया जाए, जिसमें locale-aware रूटिंग, TypeScript समर्थन, और आधुनिक विकास प्रथाएँ शामिल हैं।
33
34
 
35
+ ## Table of Contents
36
+
37
+ <TOC/>
38
+
34
39
  ## Intlayer क्या है?
35
40
 
36
41
  **Intlayer** एक अभिनव, ओपन-सोर्स अंतरराष्ट्रीयकरण (i18n) लाइब्रेरी है जिसे आधुनिक वेब एप्लिकेशन में बहुभाषी समर्थन को सरल बनाने के लिए डिज़ाइन किया गया है।
@@ -74,6 +79,29 @@ pnpm add vite-intlayer --save-dev
74
79
 
75
80
  ### चरण 2: अपने प्रोजेक्ट का कॉन्फ़िगरेशन
76
81
 
82
+ ## फ़ाइल-सिस्टम आधारित रूट्स के साथ React Router v7 एप्लिकेशन में Intlayer सेटअप करने के लिए चरण-दर-चरण मार्गदर्शिका
83
+
84
+ <Tab defaultTab="video">
85
+ <TabItem label="Video" value="video">
86
+
87
+ <iframe title="How to translate your React Router v7 app using 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/dS9L7uJeak4?autoplay=0&amp;origin=http://intlayer.org&amp;controls=0&amp;rel=1"/>
88
+
89
+ </TabItem>
90
+ <TabItem label="Code" value="code">
91
+
92
+ <iframe
93
+ src="https://stackblitz.com/github/aymericzip/intlayer-react-router-v7-template?embed=1&ctl=1&file=intlayer.config.ts"
94
+ className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
95
+ title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
96
+ sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
97
+ loading="lazy"
98
+ />
99
+
100
+ </TabItem>
101
+ </Tab>
102
+
103
+ See [Application Template](https://github.com/aymericzip/intlayer-react-router-v7-template) on GitHub.
104
+
77
105
  अपने एप्लिकेशन की भाषाओं को कॉन्फ़िगर करने के लिए एक कॉन्फ़िग फ़ाइल बनाएं:
78
106
 
79
107
  ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
@@ -260,7 +288,7 @@ export const LocalizedLink: FC<LinkProps> = (props) => {
260
288
  यदि आप स्थानीयकृत मार्गों पर नेविगेट करना चाहते हैं, तो आप `useLocalizedNavigate` हुक का उपयोग कर सकते हैं:
261
289
 
262
290
  ```tsx fileName="app/hooks/useLocalizedNavigate.ts"
263
- import { useLocale } from "intlayer";
291
+ import { useLocale } from "react-intlayer";
264
292
  import { type NavigateOptions, type To, useNavigate } from "react-router";
265
293
 
266
294
  import { locacalizeTo } from "~/components/localized-link";
@@ -318,6 +346,7 @@ import {
318
346
  getLocaleName,
319
347
  getLocalizedUrl,
320
348
  getPathWithoutLocale,
349
+ Locales,
321
350
  } from "intlayer";
322
351
  import { setLocaleInStorage, useIntlayer, useLocale } from "react-intlayer";
323
352
  import { Link, useLocation } from "react-router";
@@ -411,13 +440,13 @@ export default function RootLayout() {
411
440
  > ध्यान दें कि उत्पादन में `intlayerProxy` का उपयोग करने के लिए, आपको `vite-intlayer` पैकेज को `devDependencies` से `dependencies` में स्विच करना होगा।
412
441
 
413
442
  ```typescript {3,7} fileName="vite.config.ts"
443
+ import { reactRouter } from "@react-router/dev/vite";
414
444
  import { defineConfig } from "vite";
415
- import react from "@vitejs/plugin-react-swc";
416
445
  import { intlayer, intlayerProxy } from "vite-intlayer";
446
+ import tsconfigPaths from "vite-tsconfig-paths";
417
447
 
418
- // https://vitejs.dev/config/
419
448
  export default defineConfig({
420
- plugins: [react(), intlayer(), intlayerProxy()],
449
+ plugins: [reactRouter(), tsconfigPaths(), intlayer(), intlayerProxy()],
421
450
  });
422
451
  ```
423
452
 
@@ -0,0 +1,518 @@
1
+ ---
2
+ createdAt: 2025-09-04
3
+ updatedAt: 2025-10-03
4
+ title: अपना React Router v7 ऐप कैसे अनुवाद करें – i18n गाइड 2025
5
+ description: जानें कि कैसे Intlayer का उपयोग करके अपने React Router v7 एप्लिकेशन में अंतरराष्ट्रीयकरण (i18n) जोड़ें। इस व्यापक गाइड का पालन करें ताकि आपका ऐप बहुभाषी और locale-aware रूटिंग के साथ हो।
6
+ keywords:
7
+ - अंतरराष्ट्रीयकरण
8
+ - दस्तावेज़ीकरण
9
+ - Intlayer
10
+ - React Router v7
11
+ - React
12
+ - i18n
13
+ - TypeScript
14
+ - Locale रूटिंग
15
+ slugs:
16
+ - doc
17
+ - environment
18
+ - vite-and-react
19
+ - react-router-v7-fs-routes
20
+ applicationTemplate: https://github.com/aymericzip/intlayer-react-router-v7-template
21
+ youtubeVideo: https://www.youtube.com/watch?v=dS9L7uJeak4
22
+ history:
23
+ - version: 6.1.5
24
+ date: 2025-10-03
25
+ changes: दस्तावेज़ अपडेट किया गया
26
+ - version: 5.8.2
27
+ date: 2025-09-04
28
+ changes: React Router v7 के लिए जोड़ा
29
+ ---
30
+
31
+ # Intlayer के साथ अपना React Router v7 अनुवाद करें | अंतर्राष्ट्रीयकरण (i18n)
32
+
33
+ यह गाइड दिखाता है कि कैसे **Intlayer** को React Router v7 प्रोजेक्ट्स में seamless अंतरराष्ट्रीयकरण के लिए एकीकृत किया जाए, जिसमें locale-aware रूटिंग, TypeScript समर्थन, और आधुनिक विकास प्रथाएँ शामिल हैं।
34
+
35
+ ## Table of Contents
36
+
37
+ <TOC/>
38
+
39
+ ## Intlayer क्या है?
40
+
41
+ **Intlayer** एक अभिनव, ओपन-सोर्स अंतरराष्ट्रीयकरण (i18n) लाइब्रेरी है जिसे आधुनिक वेब एप्लिकेशन में बहुभाषी समर्थन को सरल बनाने के लिए डिज़ाइन किया गया है।
42
+
43
+ Intlayer के साथ, आप कर सकते हैं:
44
+
45
+ - **घोषणात्मक शब्दकोशों का उपयोग करके अनुवादों का आसानी से प्रबंधन करें** जो कंपोनेंट स्तर पर होते हैं।
46
+ - **मेटाडेटा, रूट्स, और सामग्री को गतिशील रूप से स्थानीयकृत करें**।
47
+ - **TypeScript समर्थन सुनिश्चित करें** autogenerated टाइप्स के साथ, जो ऑटोकम्प्लीशन और त्रुटि पहचान में सुधार करता है।
48
+ - **उन्नत सुविधाओं का लाभ उठाएं**, जैसे गतिशील locale पहचान और स्विचिंग।
49
+ - **React Router v7 के कॉन्फ़िगरेशन-आधारित रूटिंग सिस्टम के साथ locale-aware रूटिंग सक्षम करें**।
50
+
51
+ ---
52
+
53
+ ## React Router v7 एप्लिकेशन में Intlayer सेटअप करने के लिए चरण-दर-चरण मार्गदर्शिका
54
+
55
+ ### चरण 1: निर्भरताएँ स्थापित करें
56
+
57
+ अपनी पसंदीदा पैकेज मैनेजर का उपयोग करके आवश्यक पैकेज स्थापित करें:
58
+
59
+ ```bash packageManager="npm"
60
+ npm install intlayer react-intlayer
61
+ npm install vite-intlayer --save-dev
62
+ ```
63
+
64
+ ```bash packageManager="pnpm"
65
+ pnpm add intlayer react-intlayer
66
+ pnpm add vite-intlayer --save-dev
67
+ ```
68
+
69
+ - **intlayer**
70
+
71
+ - **intlayer**
72
+ मुख्य पैकेज जो कॉन्फ़िगरेशन प्रबंधन, अनुवाद, [सामग्री घोषणा](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) के लिए अंतरराष्ट्रीयकरण उपकरण प्रदान करता है।
73
+
74
+ - **react-intlayer**
75
+ वह पैकेज जो Intlayer को React एप्लिकेशन के साथ एकीकृत करता है। यह React अंतरराष्ट्रीयकरण के लिए संदर्भ प्रदाता और हुक्स प्रदान करता है।
76
+
77
+ - **vite-intlayer**
78
+ इसमें Vite प्लगइन शामिल है जो Intlayer को [Vite बंडलर](https://vite.dev/guide/why.html#why-bundle-for-production) के साथ एकीकृत करता है, साथ ही उपयोगकर्ता की पसंदीदा भाषा का पता लगाने, कुकीज़ प्रबंधित करने, और URL पुनर्निर्देशन को संभालने के लिए मिडलवेयर भी शामिल है।
79
+
80
+ ### चरण 2: अपने प्रोजेक्ट का कॉन्फ़िगरेशन
81
+
82
+ ## फ़ाइल-सिस्टम आधारित रूट्स के साथ React Router v7 एप्लिकेशन में Intlayer सेटअप करने के लिए चरण-दर-चरण मार्गदर्शिका
83
+
84
+ <Tab defaultTab="video">
85
+ <TabItem label="Video" value="video">
86
+
87
+ <iframe title="How to translate your React Router v7 (File-System Routes) app using 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/dS9L7uJeak4?autoplay=0&amp;origin=http://intlayer.org&amp;controls=0&amp;rel=1"/>
88
+
89
+ </TabItem>
90
+ <TabItem label="Code" value="code">
91
+
92
+ <iframe
93
+ src="https://stackblitz.com/github/aymericzip/intlayer-react-router-v7-template?embed=1&ctl=1&file=intlayer.config.ts"
94
+ className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
95
+ title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
96
+ sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
97
+ loading="lazy"
98
+ />
99
+
100
+ </TabItem>
101
+ </Tab>
102
+
103
+ See [Application Template](https://github.com/aymericzip/intlayer-react-router-v7-template) on GitHub.
104
+
105
+ अपने एप्लिकेशन की भाषाओं को कॉन्फ़िगर करने के लिए एक कॉन्फ़िग फ़ाइल बनाएं:
106
+
107
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
108
+ import { type IntlayerConfig, Locales } from "intlayer";
109
+
110
+ const config: IntlayerConfig = {
111
+ internationalization: {
112
+ defaultLocale: Locales.ENGLISH,
113
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
114
+ },
115
+ };
116
+
117
+ export default config;
118
+ ```
119
+
120
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
121
+ import { Locales } from "intlayer";
122
+
123
+ /** @type {import('intlayer').IntlayerConfig} */
124
+ const config = {
125
+ internationalization: {
126
+ defaultLocale: Locales.ENGLISH,
127
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
128
+ },
129
+ };
130
+
131
+ export default config;
132
+ ```
133
+
134
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
135
+ const { Locales } = require("intlayer");
136
+
137
+ /** @type {import('intlayer').IntlayerConfig} */
138
+ const config = {
139
+ internationalization: {
140
+ defaultLocale: Locales.ENGLISH,
141
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
142
+ },
143
+ };
144
+
145
+ module.exports = config;
146
+ ```
147
+
148
+ > इस कॉन्फ़िगरेशन फ़ाइल के माध्यम से, आप स्थानीयकृत URL, मिडलवेयर पुनर्निर्देशन, कुकी नाम, आपकी सामग्री घोषणाओं का स्थान और एक्सटेंशन, कंसोल में Intlayer लॉग को अक्षम करना, और भी बहुत कुछ सेट कर सकते हैं। उपलब्ध सभी पैरामीटर की पूरी सूची के लिए, [कॉन्फ़िगरेशन दस्तावेज़](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/configuration.md) देखें।
149
+
150
+ ### चरण 3: अपने Vite कॉन्फ़िगरेशन में Intlayer को एकीकृत करें
151
+
152
+ अपने कॉन्फ़िगरेशन में intlayer प्लगइन जोड़ें:
153
+
154
+ ```typescript fileName="vite.config.ts"
155
+ import { reactRouter } from "@react-router/dev/vite";
156
+ import { defineConfig } from "vite";
157
+ import { intlayer } from "vite-intlayer";
158
+ import tsconfigPaths from "vite-tsconfig-paths";
159
+
160
+ export default defineConfig({
161
+ plugins: [reactRouter(), tsconfigPaths(), intlayer()],
162
+ });
163
+ ```
164
+
165
+ > `intlayer()` Vite प्लगइन का उपयोग Intlayer को Vite के साथ एकीकृत करने के लिए किया जाता है। यह सामग्री घोषणा फ़ाइलों के निर्माण को सुनिश्चित करता है और विकास मोड में उनकी निगरानी करता है। यह Vite एप्लिकेशन के भीतर Intlayer पर्यावरण चर को परिभाषित करता है। इसके अतिरिक्त, यह प्रदर्शन को अनुकूलित करने के लिए उपनाम प्रदान करता है।
166
+
167
+ ### चरण 4: React Router v7 रूट्स कॉन्फ़िगर करें
168
+
169
+ अपने रूटिंग कॉन्फ़िगरेशन को स्थानीय-जानकारी वाले रूट्स के साथ सेट करें:
170
+
171
+ ```typescript fileName="app/routes.ts"
172
+ typescript;
173
+ import { layout, route, type RouteConfig } from "@react-router/dev/routes";
174
+
175
+ export default [
176
+ layout("routes/layout.tsx", [
177
+ route("/:lang?", "routes/page.tsx"), // स्थानीयकृत होम पेज
178
+ route("/:lang?/about", "routes/about/page.tsx"), // स्थानीयकृत अबाउट पेज
179
+ ]),
180
+ ] satisfies RouteConfig;
181
+ ```
182
+
183
+ ### चरण 5: लेआउट कंपोनेंट बनाएं
184
+
185
+ अपने रूट लेआउट और स्थानीय-विशिष्ट लेआउट सेट करें:
186
+
187
+ #### रूट लेआउट
188
+
189
+ ```tsx fileName="app/routes/layout.tsx"
190
+ import { IntlayerProvider } from "react-intlayer";
191
+ import { Outlet } from "react-router";
192
+
193
+ import type { Route } from "./+types/layout";
194
+
195
+ export default function RootLayout({ params }: Route.ComponentProps) {
196
+ const { locale } = params;
197
+
198
+ return (
199
+ <IntlayerProvider locale={locale}>
200
+ <Outlet />
201
+ </IntlayerProvider>
202
+ );
203
+ }
204
+ ```
205
+
206
+ ### चरण 6: अपनी सामग्री घोषित करें
207
+
208
+ अपनी अनुवादों को संग्रहीत करने के लिए अपनी सामग्री घोषणाएँ बनाएं और प्रबंधित करें:
209
+
210
+ ```tsx fileName="app/routes/[lang]/page.content.ts"
211
+ import { t, type Dictionary } from "intlayer";
212
+
213
+ const pageContent = {
214
+ key: "page",
215
+ content: {
216
+ title: t({
217
+ en: "Welcome to React Router v7 + Intlayer",
218
+ es: "Bienvenido a React Router v7 + Intlayer",
219
+ fr: "Bienvenue sur React Router v7 + Intlayer",
220
+ }),
221
+ description: t({
222
+ en: "Build multilingual applications with ease using React Router v7 and Intlayer.",
223
+ es: "Cree aplicaciones multilingües fácilmente usando React Router v7 y Intlayer.",
224
+ fr: "Créez des applications multilingues facilement avec React Router v7 et Intlayer.",
225
+ }),
226
+ aboutLink: t({
227
+ en: "हमारे बारे में जानें",
228
+ es: "Aprender Sobre Nosotros",
229
+ fr: "En savoir plus sur nous",
230
+ }),
231
+ homeLink: t({
232
+ en: "होम",
233
+ es: "Inicio",
234
+ fr: "Accueil",
235
+ }),
236
+ },
237
+ } satisfies Dictionary;
238
+
239
+ export default pageContent;
240
+ ```
241
+
242
+ > आपकी सामग्री घोषणाएँ आपकी एप्लिकेशन में कहीं भी परिभाषित की जा सकती हैं जब तक कि वे `contentDir` निर्देशिका (डिफ़ॉल्ट रूप से, `./app`) में शामिल हों। और सामग्री घोषणा फ़ाइल एक्सटेंशन से मेल खाती हों (डिफ़ॉल्ट रूप से, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)।
243
+
244
+ > अधिक विवरण के लिए, [सामग्री घोषणा प्रलेखन](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/dictionary/get_started.md) देखें।
245
+
246
+ ### चरण 7: स्थानीय-जानकारी वाले घटक बनाएँ
247
+
248
+ स्थानीय-जानकारी वाले नेविगेशन के लिए `LocalizedLink` घटक बनाएँ:
249
+
250
+ ```tsx fileName="app/components/localized-link.tsx"
251
+ import type { FC } from "react";
252
+
253
+ import { getLocalizedUrl, type LocalesValues } from "intlayer";
254
+ import { useLocale } from "react-intlayer";
255
+ import { Link, type LinkProps, type To } from "react-router";
256
+
257
+ // यह फ़ंक्शन जांचता है कि लिंक बाहरी है या नहीं
258
+ const isExternalLink = (to: string) => /^(https?:)?\/\//.test(to);
259
+
260
+ // यह फ़ंक्शन दिए गए पते को स्थानीयकृत URL में परिवर्तित करता है
261
+ export const locacalizeTo = (to: To, locale: LocalesValues): To => {
262
+ if (typeof to === "string") {
263
+ if (isExternalLink(to)) {
264
+ return to;
265
+ }
266
+
267
+ return getLocalizedUrl(to, locale);
268
+ }
269
+
270
+ if (isExternalLink(to.pathname ?? "")) {
271
+ return to;
272
+ }
273
+
274
+ return {
275
+ ...to,
276
+ pathname: getLocalizedUrl(to.pathname ?? "", locale),
277
+ };
278
+ };
279
+
280
+ // यह स्थानीयकृत लिंक के लिए एक React functional component है
281
+ export const LocalizedLink: FC<LinkProps> = (props) => {
282
+ const { locale } = useLocale();
283
+
284
+ return <Link {...props} to={locacalizeTo(props.to, locale)} />;
285
+ };
286
+ ```
287
+
288
+ यदि आप स्थानीयकृत मार्गों पर नेविगेट करना चाहते हैं, तो आप `useLocalizedNavigate` हुक का उपयोग कर सकते हैं:
289
+
290
+ ```tsx fileName="app/hooks/useLocalizedNavigate.ts"
291
+ import { useLocale } from "react-intlayer";
292
+ import { type NavigateOptions, type To, useNavigate } from "react-router";
293
+
294
+ import { locacalizeTo } from "~/components/localized-link";
295
+
296
+ export const useLocalizedNavigate = () => {
297
+ const navigate = useNavigate();
298
+ const { locale } = useLocale();
299
+
300
+ const localizedNavigate = (to: To, options?: NavigateOptions) => {
301
+ const localedTo = locacalizeTo(to, locale);
302
+
303
+ navigate(localedTo, options);
304
+ };
305
+
306
+ return localizedNavigate;
307
+ };
308
+ ```
309
+
310
+ ### चरण 8: अपने पृष्ठों में Intlayer का उपयोग करें
311
+
312
+ अपने एप्लिकेशन में अपने कंटेंट डिक्शनरीज़ तक पहुँचें:
313
+
314
+ #### स्थानीयकृत होम पेज
315
+
316
+ ```tsx fileName="app/routes/[lang]/page.tsx"
317
+ import { useIntlayer } from "react-intlayer";
318
+ import { LocalizedLink } from "~/components/localized-link";
319
+
320
+ export default function Page() {
321
+ const { title, description, aboutLink } = useIntlayer("page");
322
+
323
+ return (
324
+ <div>
325
+ <h1>{title}</h1>
326
+ <p>{description}</p>
327
+ <nav>
328
+ <LocalizedLink to="/about">{aboutLink}</LocalizedLink>
329
+ </nav>
330
+ </div>
331
+ );
332
+ }
333
+ ```
334
+
335
+ > `useIntlayer` हुक के बारे में अधिक जानने के लिए, [डॉक्यूमेंटेशन](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/packages/react-intlayer/useIntlayer.md) देखें।
336
+
337
+ ### चरण 9: एक लोकल स्विचर कंपोनेंट बनाएं
338
+
339
+ उपयोगकर्ताओं को भाषाएँ बदलने की अनुमति देने के लिए एक कॉम्पोनेंट बनाएं:
340
+
341
+ ```tsx fileName="app/components/locale-switcher.tsx"
342
+ import type { FC } from "react";
343
+
344
+ import {
345
+ getHTMLTextDir,
346
+ getLocaleName,
347
+ getLocalizedUrl,
348
+ getPathWithoutLocale,
349
+ Locales,
350
+ } from "intlayer";
351
+ import { setLocaleInStorage, useIntlayer, useLocale } from "react-intlayer";
352
+ import { Link, useLocation } from "react-router";
353
+
354
+ export const LocaleSwitcher: FC = () => {
355
+ const { localeSwitcherLabel } = useIntlayer("locale-switcher");
356
+ const { pathname } = useLocation();
357
+
358
+ const { availableLocales, locale } = useLocale();
359
+
360
+ const pathWithoutLocale = getPathWithoutLocale(pathname);
361
+
362
+ return (
363
+ <ol>
364
+ {availableLocales.map((localeItem) => (
365
+ <li key={localeItem}>
366
+ <Link
367
+ aria-current={localeItem === locale ? "page" : undefined}
368
+ aria-label={`${localeSwitcherLabel.value} ${getLocaleName(localeItem)}`}
369
+ onClick={() => setLocale(localeItem)}
370
+ to={getLocalizedUrl(pathWithoutLocale, localeItem)}
371
+ >
372
+ <span>
373
+ {/* लोकल - उदाहरण के लिए FR */}
374
+ {localeItem}
375
+ </span>
376
+ <span>
377
+ {/* अपनी लोकल में भाषा - उदाहरण के लिए Français */}
378
+ {getLocaleName(localeItem, locale)}
379
+ </span>
380
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
381
+ {/* वर्तमान लोकल में भाषा - उदाहरण के लिए Francés जब वर्तमान लोकल Locales.SPANISH सेट हो */}
382
+ {getLocaleName(localeItem)}
383
+ </span>
384
+ <span dir="ltr" lang={Locales.ENGLISH}>
385
+ {/* अंग्रेज़ी में भाषा - उदाहरण के लिए French */}
386
+ {getLocaleName(localeItem, Locales.ENGLISH)}
387
+ </span>
388
+ </Link>
389
+ </li>
390
+ ))}
391
+ </ol>
392
+ );
393
+ };
394
+ ```
395
+
396
+ > `useLocale` हुक के बारे में अधिक जानने के लिए, कृपया [दस्तावेज़](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/packages/react-intlayer/useLocale.md) देखें।
397
+
398
+ ### चरण 10: HTML एट्रिब्यूट्स प्रबंधन जोड़ें (वैकल्पिक)
399
+
400
+ HTML lang और dir एट्रिब्यूट्स को प्रबंधित करने के लिए एक हुक बनाएं:
401
+
402
+ ```tsx fileName="app/hooks/useI18nHTMLAttributes.tsx"
403
+ import { getHTMLTextDir } from "intlayer";
404
+ import { useEffect } from "react";
405
+ import { useLocale } from "react-intlayer";
406
+
407
+ export const useI18nHTMLAttributes = () => {
408
+ const { locale } = useLocale();
409
+
410
+ useEffect(() => {
411
+ document.documentElement.lang = locale;
412
+ document.documentElement.dir = getHTMLTextDir(locale);
413
+ }, [locale]);
414
+ };
415
+ ```
416
+
417
+ फिर इसे अपने रूट कॉम्पोनेंट में उपयोग करें:
418
+
419
+ ```tsx fileName="app/routes/layout.tsx"
420
+ import { Outlet } from "react-router";
421
+ import { IntlayerProvider } from "react-intlayer";
422
+
423
+ import { useI18nHTMLAttributes } from "app/hooks/useI18nHTMLAttributes"; // हुक को इम्पोर्ट करें
424
+
425
+ export default function RootLayout() {
426
+ useI18nHTMLAttributes(); // हुक को कॉल करें
427
+
428
+ return (
429
+ <IntlayerProvider>
430
+ <Outlet />
431
+ </IntlayerProvider>
432
+ );
433
+ }
434
+ ```
435
+
436
+ ### चरण 11: मिडलवेयर जोड़ें (वैकल्पिक)
437
+
438
+ आप अपने एप्लिकेशन में सर्वर-साइड रूटिंग जोड़ने के लिए `intlayerProxy` का भी उपयोग कर सकते हैं। यह प्लगइन URL के आधार पर वर्तमान लोकल का स्वचालित रूप से पता लगाएगा और उपयुक्त लोकल कुकी सेट करेगा। यदि कोई लोकल निर्दिष्ट नहीं है, तो प्लगइन उपयोगकर्ता के ब्राउज़र भाषा प्राथमिकताओं के आधार पर सबसे उपयुक्त लोकल निर्धारित करेगा। यदि कोई लोकल पता नहीं चलता है, तो यह डिफ़ॉल्ट लोकल पर पुनः निर्देशित करेगा।
439
+
440
+ > ध्यान दें कि उत्पादन में `intlayerProxy` का उपयोग करने के लिए, आपको `vite-intlayer` पैकेज को `devDependencies` से `dependencies` में स्विच करना होगा।
441
+
442
+ ```typescript {3,7} fileName="vite.config.ts"
443
+ import { reactRouter } from "@react-router/dev/vite";
444
+ import { defineConfig } from "vite";
445
+ import { intlayer, intlayerProxy } from "vite-intlayer";
446
+ import tsconfigPaths from "vite-tsconfig-paths";
447
+
448
+ export default defineConfig({
449
+ plugins: [reactRouter(), tsconfigPaths(), intlayer(), intlayerProxy()],
450
+ });
451
+ ```
452
+
453
+ ---
454
+
455
+ ## टाइपस्क्रिप्ट कॉन्फ़िगर करें
456
+
457
+ Intlayer टाइपस्क्रिप्ट के लाभ प्राप्त करने और आपके कोडबेस को मजबूत बनाने के लिए मॉड्यूल ऑगमेंटेशन का उपयोग करता है।
458
+
459
+ सुनिश्चित करें कि आपकी टाइपस्क्रिप्ट कॉन्फ़िगरेशन में स्वचालित रूप से उत्पन्न प्रकार शामिल हैं:
460
+
461
+ ```json5 fileName="tsconfig.json"
462
+ {
463
+ // ... आपके मौजूदा कॉन्फ़िगरेशन
464
+ include: [
465
+ // ... आपके मौजूदा शामिल
466
+ ".intlayer/**/*.ts", // स्वचालित रूप से उत्पन्न प्रकार शामिल करें
467
+ ],
468
+ }
469
+ ```
470
+
471
+ ---
472
+
473
+ ## गिट कॉन्फ़िगरेशन
474
+
475
+ यह अनुशंसित है कि Intlayer द्वारा उत्पन्न फ़ाइलों को अनदेखा किया जाए। इससे आप उन्हें अपने गिट रिपॉजिटरी में कमिट करने से बच सकते हैं।
476
+
477
+ ऐसा करने के लिए, आप अपनी `.gitignore` फ़ाइल में निम्नलिखित निर्देश जोड़ सकते हैं:
478
+
479
+ ```plaintext fileName=".gitignore"
480
+ # Intlayer द्वारा उत्पन्न फ़ाइलों को अनदेखा करें
481
+ .intlayer
482
+ ```
483
+
484
+ ---
485
+
486
+ ## VS कोड एक्सटेंशन
487
+
488
+ Intlayer के साथ अपने विकास अनुभव को बेहतर बनाने के लिए, आप आधिकारिक **Intlayer VS कोड एक्सटेंशन** इंस्टॉल कर सकते हैं।
489
+
490
+ [VS कोड मार्केटप्लेस से इंस्टॉल करें](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
491
+
492
+ यह एक्सटेंशन प्रदान करता है:
493
+
494
+ - अनुवाद कुंजियों के लिए **ऑटोकंप्लीशन**।
495
+ - गायब अनुवादों के लिए **रीयल-टाइम त्रुटि पहचान**।
496
+ - अनुवादित सामग्री के **इनलाइन पूर्वावलोकन**।
497
+ - अनुवादों को आसानी से बनाने और अपडेट करने के लिए **त्वरित क्रियाएँ**।
498
+
499
+ एक्सटेंशन का उपयोग कैसे करें, इसके लिए अधिक विवरण के लिए देखें [Intlayer VS कोड एक्सटेंशन दस्तावेज़](https://intlayer.org/doc/vs-code-extension)।
500
+
501
+ ---
502
+
503
+ ## आगे बढ़ें
504
+
505
+ आगे बढ़ने के लिए, आप [विज़ुअल एडिटर](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) का उपयोग करके बाहरी रूप से प्रबंधित कर सकते हैं।
506
+
507
+ ---
508
+
509
+ ## दस्तावेज़ संदर्भ
510
+
511
+ - [Intlayer दस्तावेज़](https://intlayer.org)
512
+ - [React Router v7 दस्तावेज़](https://reactrouter.com/)
513
+ - [useIntlayer हुक](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/packages/react-intlayer/useIntlayer.md)
514
+ - [useLocale हुक](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/packages/react-intlayer/useLocale.md)
515
+ - [सामग्री घोषणा](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/dictionary/get_started.md)
516
+ - [कॉन्फ़िगरेशन](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/configuration.md)
517
+
518
+ यह व्यापक मार्गदर्शिका आपको Intlayer को React Router v7 के साथ पूरी तरह से अंतरराष्ट्रीयकृत एप्लिकेशन के लिए एकीकृत करने के लिए आवश्यक सभी जानकारी प्रदान करती है, जिसमें स्थानीय-जानकारी वाले रूटिंग और TypeScript समर्थन शामिल हैं।
@@ -17,6 +17,7 @@ slugs:
17
17
  - environment
18
18
  - tanstack-start
19
19
  applicationTemplate: https://github.com/aymericzip/intlayer-tanstack-start-template
20
+ youtubeVideo: https://www.youtube.com/watch?v=_XTdKVWaeqg
20
21
  history:
21
22
  - version: 7.3.9
22
23
  date: 2025-12-05
@@ -576,19 +577,8 @@ export const getLocaleServer = createServerFn().handler(async () => {
576
577
  return getCookie(name, cookieString);
577
578
  },
578
579
  // Get the header from the request (default: 'x-intlayer-locale')
579
- getHeader: (name) => getRequestHeader(name),
580
580
  // Fallback using Accept-Language negotiation
581
- getAllHeaders: async () => {
582
- const headers = getRequestHeaders();
583
- const result: Record<string, string> = {};
584
-
585
- // Convert the TypedHeaders into a plain Record<string, string>
586
- for (const [key, value] of headers.entries()) {
587
- result[key] = value;
588
- }
589
-
590
- return result;
591
- },
581
+ getHeader: (name) => getRequestHeader(name),
592
582
  });
593
583
 
594
584
  // Retrieve some content using getIntlayer()
@@ -15,6 +15,7 @@ slugs:
15
15
  - environment
16
16
  - vite-and-vue
17
17
  applicationTemplate: https://github.com/aymericzip/intlayer-vite-vue-template
18
+ youtubeVideo: https://www.youtube.com/watch?v=IE3XWkZ6a5U
18
19
  history:
19
20
  - version: 5.5.10
20
21
  date: 2025-06-29