@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
|
@@ -15,10 +15,8 @@ keywords:
|
|
|
15
15
|
slugs:
|
|
16
16
|
- doc
|
|
17
17
|
- environment
|
|
18
|
-
- vite-and-react
|
|
19
18
|
- tanstack-start
|
|
20
|
-
applicationTemplate: https://github.com/
|
|
21
|
-
author: AydinTheFirst
|
|
19
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-tanstack-start-template
|
|
22
20
|
---
|
|
23
21
|
|
|
24
22
|
# Getting Started Internationalising (i18n) with Intlayer and Tanstack Start
|
|
@@ -43,7 +41,7 @@ With Intlayer, you can:
|
|
|
43
41
|
|
|
44
42
|
### Step 1: Create Project
|
|
45
43
|
|
|
46
|
-
Start by creating a new TanStack Start project by following the [Start new project](https://tanstack.com/start/latest/docs/framework/react/quick-start) guide on the
|
|
44
|
+
Start by creating a new TanStack Start project by following the [Start new project](https://tanstack.com/start/latest/docs/framework/react/quick-start) guide on the Tanstack Start website.
|
|
47
45
|
|
|
48
46
|
### Step 2: Install Intlayer Packages
|
|
49
47
|
|
|
@@ -61,7 +59,7 @@ pnpm add vite-intlayer --save-dev
|
|
|
61
59
|
|
|
62
60
|
- **intlayer**
|
|
63
61
|
|
|
64
|
-
The core package that provides internationalisation tools for configuration management, translation, [content declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md), transpilation, and [CLI commands](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_cli.md).
|
|
62
|
+
The core package that provides internationalisation tools for configuration management, translation, [content declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/dictionary/get_started.md), transpilation, and [CLI commands](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/intlayer_cli.md).
|
|
65
63
|
|
|
66
64
|
- **react-intlayer**
|
|
67
65
|
The package that integrates Intlayer with React applications. It provides context providers and hooks for React internationalisation.
|
|
@@ -73,7 +71,7 @@ pnpm add vite-intlayer --save-dev
|
|
|
73
71
|
|
|
74
72
|
Create a config file to configure the languages of your application:
|
|
75
73
|
|
|
76
|
-
```typescript fileName="intlayer.config.ts"
|
|
74
|
+
```typescript fileName="intlayer.config.ts"
|
|
77
75
|
import type { IntlayerConfig } from "intlayer";
|
|
78
76
|
|
|
79
77
|
import { Locales } from "intlayer";
|
|
@@ -81,75 +79,27 @@ import { Locales } from "intlayer";
|
|
|
81
79
|
const config: IntlayerConfig = {
|
|
82
80
|
internationalization: {
|
|
83
81
|
defaultLocale: Locales.ENGLISH,
|
|
84
|
-
locales: [
|
|
85
|
-
Locales.ENGLISH,
|
|
86
|
-
Locales.FRENCH,
|
|
87
|
-
Locales.SPANISH,
|
|
88
|
-
// Your other locales
|
|
89
|
-
],
|
|
82
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
90
83
|
},
|
|
91
84
|
};
|
|
92
85
|
|
|
93
86
|
export default config;
|
|
94
87
|
```
|
|
95
88
|
|
|
96
|
-
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
97
|
-
import { Locales } from "intlayer";
|
|
98
|
-
|
|
99
|
-
/** @type {import('intlayer').IntlayerConfig} */
|
|
100
|
-
const config = {
|
|
101
|
-
internationalization: {
|
|
102
|
-
defaultLocale: Locales.ENGLISH,
|
|
103
|
-
locales: [
|
|
104
|
-
Locales.ENGLISH,
|
|
105
|
-
Locales.FRENCH,
|
|
106
|
-
Locales.SPANISH,
|
|
107
|
-
// Your other locales
|
|
108
|
-
],
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export default config;
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
116
|
-
const { Locales } = require("intlayer");
|
|
117
|
-
|
|
118
|
-
/** @type {import('intlayer').IntlayerConfig} */
|
|
119
|
-
const config = {
|
|
120
|
-
internationalization: {
|
|
121
|
-
defaultLocale: Locales.ENGLISH,
|
|
122
|
-
locales: [
|
|
123
|
-
Locales.ENGLISH,
|
|
124
|
-
Locales.FRENCH,
|
|
125
|
-
Locales.SPANISH,
|
|
126
|
-
// Your other locales
|
|
127
|
-
],
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
module.exports = config;
|
|
132
|
-
```
|
|
133
|
-
|
|
134
89
|
> Through this configuration file, you can set up localised URLs, middleware redirection, cookie names, the location and extension of your content declarations, disable Intlayer logs in the console, and more. For a complete list of available parameters, refer to the [configuration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/configuration.md).
|
|
135
90
|
|
|
136
91
|
### Step 4: Integrate Intlayer in Your Vite Configuration
|
|
137
92
|
|
|
138
93
|
Add the intlayer plugin into your configuration:
|
|
139
94
|
|
|
140
|
-
```typescript fileName="vite.config.ts"
|
|
95
|
+
```typescript fileName="vite.config.ts"
|
|
141
96
|
import { reactRouter } from "@react-router/dev/vite";
|
|
142
97
|
import { defineConfig } from "vite";
|
|
143
|
-
import {
|
|
98
|
+
import { intlayer } from "vite-intlayer";
|
|
144
99
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
145
100
|
|
|
146
101
|
export default defineConfig({
|
|
147
|
-
plugins: [
|
|
148
|
-
reactRouter(),
|
|
149
|
-
tsconfigPaths(),
|
|
150
|
-
intlayer(),
|
|
151
|
-
intlayerMiddlewarePlugin(),
|
|
152
|
-
],
|
|
102
|
+
plugins: [reactRouter(), tsconfigPaths(), intlayer()],
|
|
153
103
|
});
|
|
154
104
|
```
|
|
155
105
|
|
|
@@ -161,10 +111,8 @@ Set up your root layout and locale-specific layouts:
|
|
|
161
111
|
|
|
162
112
|
#### Root Layout
|
|
163
113
|
|
|
164
|
-
```tsx fileName="src/routes/{-$locale}/route.tsx"
|
|
165
|
-
// src/routes/{-$locale}/route.tsx
|
|
114
|
+
```tsx fileName="src/routes/{-$locale}/route.tsx"
|
|
166
115
|
import { createFileRoute, Navigate, Outlet } from "@tanstack/react-router";
|
|
167
|
-
import { configuration } from "intlayer";
|
|
168
116
|
import { IntlayerProvider, useLocale } from "react-intlayer";
|
|
169
117
|
|
|
170
118
|
import { useI18nHTMLAttributes } from "@/hooks/useI18nHTMLAttributes";
|
|
@@ -174,10 +122,11 @@ export const Route = createFileRoute("/{-$locale}")({
|
|
|
174
122
|
});
|
|
175
123
|
|
|
176
124
|
function LayoutComponent() {
|
|
125
|
+
const { defaultLocale } = useLocale();
|
|
177
126
|
const { locale } = Route.useParams();
|
|
178
127
|
|
|
179
128
|
return (
|
|
180
|
-
<IntlayerProvider locale={
|
|
129
|
+
<IntlayerProvider locale={defaultLocale}>
|
|
181
130
|
<Outlet />
|
|
182
131
|
</IntlayerProvider>
|
|
183
132
|
);
|
|
@@ -188,7 +137,7 @@ function LayoutComponent() {
|
|
|
188
137
|
|
|
189
138
|
Create and manage your content declarations to store translations:
|
|
190
139
|
|
|
191
|
-
```tsx fileName="src/contents/page.content.ts"
|
|
140
|
+
```tsx fileName="src/contents/page.content.ts"
|
|
192
141
|
import type { Dictionary } from "intlayer";
|
|
193
142
|
|
|
194
143
|
import { t } from "intlayer";
|
|
@@ -197,6 +146,7 @@ const appContent = {
|
|
|
197
146
|
content: {
|
|
198
147
|
links: {
|
|
199
148
|
about: t({
|
|
149
|
+
"en-GB": "About",
|
|
200
150
|
en: "About",
|
|
201
151
|
es: "Acerca de",
|
|
202
152
|
fr: "À propos",
|
|
@@ -235,61 +185,101 @@ export default appContent;
|
|
|
235
185
|
|
|
236
186
|
### Step 7: Create Locale-Aware Components and Hooks
|
|
237
187
|
|
|
238
|
-
Create a `
|
|
188
|
+
Create a `LocalisedLink` component for locale-aware navigation:
|
|
239
189
|
|
|
240
|
-
```tsx fileName="src/components/localized-link.tsx"
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
import { Link, type
|
|
244
|
-
import { getLocalizedUrl } from "intlayer";
|
|
190
|
+
```tsx fileName="src/components/localized-link.tsx"
|
|
191
|
+
import type { FC } from "react";
|
|
192
|
+
|
|
193
|
+
import { Link, type LinkComponentProps } from "@tanstack/react-router";
|
|
245
194
|
import { useLocale } from "react-intlayer";
|
|
246
195
|
|
|
196
|
+
export const LOCALE_ROUTE = "{-$locale}" as const;
|
|
197
|
+
|
|
198
|
+
// Main utility
|
|
199
|
+
export type RemoveLocaleParam<T> = T extends string
|
|
200
|
+
? RemoveLocaleFromString<T>
|
|
201
|
+
: T;
|
|
202
|
+
|
|
203
|
+
export type To = RemoveLocaleParam<LinkComponentProps["to"]>;
|
|
204
|
+
|
|
205
|
+
type CollapseDoubleSlashes<S extends string> =
|
|
206
|
+
S extends `${infer H}//${infer T}` ? CollapseDoubleSlashes<`${H}/${T}`> : S;
|
|
207
|
+
|
|
247
208
|
type LocalizedLinkProps = {
|
|
248
|
-
to
|
|
249
|
-
} & Omit<
|
|
209
|
+
to?: To;
|
|
210
|
+
} & Omit<LinkComponentProps, "to">;
|
|
250
211
|
|
|
251
|
-
|
|
252
|
-
|
|
212
|
+
// Helpers
|
|
213
|
+
type RemoveAll<
|
|
214
|
+
S extends string,
|
|
215
|
+
Sub extends string,
|
|
216
|
+
> = S extends `${infer H}${Sub}${infer T}` ? RemoveAll<`${H}${T}`, Sub> : S;
|
|
253
217
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
218
|
+
type RemoveLocaleFromString<S extends string> = CollapseDoubleSlashes<
|
|
219
|
+
RemoveAll<S, typeof LOCALE_ROUTE>
|
|
220
|
+
>;
|
|
257
221
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
: getLocalizedUrl(props.to, locale);
|
|
222
|
+
export const LocalizedLink: FC<LocalizedLinkProps> = (props) => {
|
|
223
|
+
const { locale } = useLocale();
|
|
261
224
|
|
|
262
|
-
return
|
|
263
|
-
|
|
225
|
+
return (
|
|
226
|
+
<Link
|
|
227
|
+
{...props}
|
|
228
|
+
params={{
|
|
229
|
+
locale,
|
|
230
|
+
...(typeof props?.params === "object" ? props?.params : {}),
|
|
231
|
+
}}
|
|
232
|
+
to={`/${LOCALE_ROUTE}${props.to}` as LinkComponentProps["to"]}
|
|
233
|
+
/>
|
|
234
|
+
);
|
|
235
|
+
};
|
|
264
236
|
```
|
|
265
237
|
|
|
266
|
-
|
|
238
|
+
This component has two purposes:
|
|
267
239
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
// eslint-disable-next-line no-restricted-imports
|
|
271
|
-
import { NavigateOptions, useNavigate } from "@tanstack/react-router";
|
|
272
|
-
import { getLocalizedUrl } from "intlayer";
|
|
273
|
-
import { useLocale } from "react-intlayer";
|
|
240
|
+
- Remove the unnecessary `{-$locale}` prefix from the URL.
|
|
241
|
+
- Inject the locale parameter into the URL to ensure the user is directly redirected to the localised route.
|
|
274
242
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
243
|
+
Then we can create a `useLocalizedNavigate` hook for programmatic navigation:
|
|
244
|
+
|
|
245
|
+
```tsx fileName="src/hooks/useLocalizedNavigate.tsx"
|
|
246
|
+
import { useLocale } from "react-intlayer";
|
|
247
|
+
import { useNavigate } from "@tanstack/react-router";
|
|
248
|
+
import { LOCALE_ROUTE } from "@/components/localized-link";
|
|
249
|
+
import type { FileRouteTypes } from "@/routeTree.gen";
|
|
278
250
|
|
|
279
251
|
export const useLocalizedNavigate = () => {
|
|
280
252
|
const navigate = useNavigate();
|
|
253
|
+
|
|
281
254
|
const { locale } = useLocale();
|
|
282
255
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
256
|
+
type StripLocalePrefix<T extends string> = T extends
|
|
257
|
+
| `/${typeof LOCALE_ROUTE}`
|
|
258
|
+
| `/${typeof LOCALE_ROUTE}/`
|
|
259
|
+
? "/"
|
|
260
|
+
: T extends `/${typeof LOCALE_ROUTE}/${infer Rest}`
|
|
261
|
+
? `/${Rest}`
|
|
262
|
+
: never;
|
|
263
|
+
|
|
264
|
+
type LocalizedTo = StripLocalePrefix<FileRouteTypes["to"]>;
|
|
265
|
+
|
|
266
|
+
interface LocalizedNavigate {
|
|
267
|
+
(to: LocalizedTo): ReturnType<typeof navigate>;
|
|
268
|
+
(
|
|
269
|
+
opts: { to: LocalizedTo } & Record<string, unknown>
|
|
270
|
+
): ReturnType<typeof navigate>;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const localizedNavigate: LocalizedNavigate = (args: any) => {
|
|
274
|
+
if (typeof args === "string") {
|
|
275
|
+
return navigate({ to: `/${LOCALE_ROUTE}${args}`, params: { locale } });
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const { to, ...rest } = args;
|
|
286
279
|
|
|
287
|
-
|
|
288
|
-
const to = isExternal(options.to)
|
|
289
|
-
? options.to
|
|
290
|
-
: getLocalizedUrl(options.to, locale);
|
|
280
|
+
const localedTo = `/${LOCALE_ROUTE}${to}` as any;
|
|
291
281
|
|
|
292
|
-
navigate({
|
|
282
|
+
return navigate({ to: localedTo, params: { locale, ...rest } as any });
|
|
293
283
|
};
|
|
294
284
|
|
|
295
285
|
return localizedNavigate;
|
|
@@ -300,23 +290,9 @@ export const useLocalizedNavigate = () => {
|
|
|
300
290
|
|
|
301
291
|
Access your content dictionaries throughout your application:
|
|
302
292
|
|
|
303
|
-
#### Root Redirect Page
|
|
304
|
-
|
|
305
|
-
```tsx fileName="src/routes/page.tsx" codeFormat="typescript"
|
|
306
|
-
// src/routes/page.tsx
|
|
307
|
-
import { useLocale } from "react-intlayer";
|
|
308
|
-
import { Navigate } from "react-router";
|
|
309
|
-
|
|
310
|
-
export default function Page() {
|
|
311
|
-
const { locale } = useLocale();
|
|
312
|
-
|
|
313
|
-
return <Navigate replace to={locale} />;
|
|
314
|
-
}
|
|
315
|
-
```
|
|
316
|
-
|
|
317
293
|
#### Localised Home Page
|
|
318
294
|
|
|
319
|
-
```tsx fileName="src/routes/{-$locale}/index.tsx"
|
|
295
|
+
```tsx fileName="src/routes/{-$locale}/index.tsx"
|
|
320
296
|
import { createFileRoute } from "@tanstack/react-router";
|
|
321
297
|
import { getIntlayer } from "intlayer";
|
|
322
298
|
import { useIntlayer } from "react-intlayer";
|
|
@@ -345,16 +321,15 @@ function RouteComponent() {
|
|
|
345
321
|
const navigate = useLocalizedNavigate();
|
|
346
322
|
|
|
347
323
|
return (
|
|
348
|
-
<div
|
|
349
|
-
<div
|
|
324
|
+
<div>
|
|
325
|
+
<div>
|
|
350
326
|
{content.title}
|
|
351
327
|
<LocaleSwitcher />
|
|
352
|
-
<div
|
|
353
|
-
<a href="/">Index</a>
|
|
328
|
+
<div>
|
|
354
329
|
<LocalizedLink to="/">{content.links.home}</LocalizedLink>
|
|
355
330
|
<LocalizedLink to="/about">{content.links.about}</LocalizedLink>
|
|
356
331
|
</div>
|
|
357
|
-
<div
|
|
332
|
+
<div>
|
|
358
333
|
<button onClick={() => navigate({ to: "/" })}>
|
|
359
334
|
{content.links.home}
|
|
360
335
|
</button>
|
|
@@ -374,48 +349,56 @@ function RouteComponent() {
|
|
|
374
349
|
|
|
375
350
|
Create a component to allow users to change languages:
|
|
376
351
|
|
|
377
|
-
```tsx fileName="src/components/locale-switcher.tsx"
|
|
352
|
+
```tsx fileName="src/components/locale-switcher.tsx"
|
|
353
|
+
import type { FC } from "react";
|
|
354
|
+
|
|
378
355
|
import { useLocation } from "@tanstack/react-router";
|
|
379
|
-
import {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
const {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
const { availableLocales, locale, setLocale } = useLocale({
|
|
392
|
-
onLocaleChange: (newLocale) => {
|
|
393
|
-
const pathWithLocale = getLocalizedUrl(pathname + searchStr, newLocale);
|
|
394
|
-
location.replace(pathWithLocale);
|
|
395
|
-
},
|
|
396
|
-
});
|
|
356
|
+
import { getHTMLTextDir, getLocaleName, getPathWithoutLocale } from "intlayer";
|
|
357
|
+
import { setLocaleCookie, useIntlayer, useLocale } from "react-intlayer";
|
|
358
|
+
|
|
359
|
+
import { LocalizedLink, To } from "./localized-link";
|
|
360
|
+
|
|
361
|
+
export const LocaleSwitcher: FC = () => {
|
|
362
|
+
const { localeSwitcherLabel } = useIntlayer("locale-switcher");
|
|
363
|
+
const { pathname } = useLocation();
|
|
364
|
+
|
|
365
|
+
const { availableLocales, locale } = useLocale();
|
|
366
|
+
|
|
367
|
+
const pathWithoutLocale = getPathWithoutLocale(pathname);
|
|
397
368
|
|
|
398
369
|
return (
|
|
399
|
-
<
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
370
|
+
<ol>
|
|
371
|
+
{availableLocales.map((localeEl) => (
|
|
372
|
+
<li key={localeEl}>
|
|
373
|
+
<LocalizedLink
|
|
374
|
+
aria-current={localeEl === locale ? "page" : undefined}
|
|
375
|
+
aria-label={`${localeSwitcherLabel.value} ${getLocaleName(localeEl)}`}
|
|
376
|
+
onClick={() => setLocaleCookie(localeEl)}
|
|
377
|
+
params={{ locale: localeEl }}
|
|
378
|
+
to={pathWithoutLocale as To}
|
|
379
|
+
>
|
|
380
|
+
<span>
|
|
381
|
+
{/* Locale - e.g. FR */}
|
|
382
|
+
{localeItem}
|
|
383
|
+
</span>
|
|
384
|
+
<span>
|
|
385
|
+
{/* Language in its own Locale - e.g. Français */}
|
|
386
|
+
{getLocaleName(localeItem, locale)}
|
|
387
|
+
</span>
|
|
388
|
+
<span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
|
|
389
|
+
{/* Language in current Locale - e.g. Francés with current locale set to Locales.SPANISH */}
|
|
390
|
+
{getLocaleName(localeItem)}
|
|
391
|
+
</span>
|
|
392
|
+
<span dir="ltr" lang={Locales.ENGLISH}>
|
|
393
|
+
{/* Language in English - e.g. French */}
|
|
394
|
+
{getLocaleName(localeItem, Locales.ENGLISH)}
|
|
395
|
+
</span>
|
|
396
|
+
</LocalizedLink>
|
|
397
|
+
</li>
|
|
415
398
|
))}
|
|
416
|
-
</
|
|
399
|
+
</ol>
|
|
417
400
|
);
|
|
418
|
-
}
|
|
401
|
+
};
|
|
419
402
|
```
|
|
420
403
|
|
|
421
404
|
> To learn more about the `useLocale` hook, refer to the [documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/react-intlayer/useLocale.md).
|
|
@@ -424,7 +407,7 @@ export default function LocaleSwitcher() {
|
|
|
424
407
|
|
|
425
408
|
Create a hook to manage HTML lang and dir attributes:
|
|
426
409
|
|
|
427
|
-
```tsx fileName="src/hooks/useI18nHTMLAttributes.tsx"
|
|
410
|
+
```tsx fileName="src/hooks/useI18nHTMLAttributes.tsx"
|
|
428
411
|
// src/hooks/useI18nHTMLAttributes.tsx
|
|
429
412
|
import { getHTMLTextDir } from "intlayer";
|
|
430
413
|
import { useEffect } from "react";
|
|
@@ -442,9 +425,8 @@ export const useI18nHTMLAttributes = () => {
|
|
|
442
425
|
|
|
443
426
|
Then use it in your root component:
|
|
444
427
|
|
|
445
|
-
```tsx fileName="src/routes/{-$locale}/index.tsx"
|
|
428
|
+
```tsx fileName="src/routes/{-$locale}/index.tsx"
|
|
446
429
|
import { createFileRoute, Navigate, Outlet } from "@tanstack/react-router";
|
|
447
|
-
import { configuration } from "intlayer";
|
|
448
430
|
import { IntlayerProvider, useLocale } from "react-intlayer";
|
|
449
431
|
|
|
450
432
|
import { useI18nHTMLAttributes } from "@/hooks/useI18nHTMLAttributes"; // import the hook
|
|
@@ -456,55 +438,54 @@ export const Route = createFileRoute("/{-$locale}")({
|
|
|
456
438
|
function LayoutComponent() {
|
|
457
439
|
useI18nHTMLAttributes(); // add this line
|
|
458
440
|
|
|
441
|
+
const { defaultLocale } = useLocale();
|
|
459
442
|
const { locale } = Route.useParams();
|
|
460
443
|
|
|
461
444
|
return (
|
|
462
|
-
<IntlayerProvider locale={locale}>
|
|
445
|
+
<IntlayerProvider locale={locale ?? defaultLocale}>
|
|
463
446
|
<Outlet />
|
|
464
447
|
</IntlayerProvider>
|
|
465
448
|
);
|
|
466
449
|
}
|
|
467
450
|
```
|
|
468
451
|
|
|
469
|
-
|
|
452
|
+
---
|
|
470
453
|
|
|
471
|
-
|
|
454
|
+
### Step 11: Add middleware (Optional)
|
|
472
455
|
|
|
473
|
-
|
|
474
|
-
# Build Intlayer dictionaries
|
|
475
|
-
npm run intlayer:build
|
|
456
|
+
You can also use the `intlayerMiddleware` to add server-side routing to your application. This plugin will automatically detect the current locale based on the URL and set the appropriate locale cookie. If no locale is specified, the plugin will determine the most appropriate locale based on the user's browser language preferences. If no locale is detected, it will redirect to the default locale.
|
|
476
457
|
|
|
477
|
-
|
|
478
|
-
npm run dev
|
|
479
|
-
```
|
|
458
|
+
> Note that to use the `intlayerMiddleware` in production, you need to switch the `vite-intlayer` package from `devDependencies` to `dependencies`.
|
|
480
459
|
|
|
481
|
-
```
|
|
482
|
-
|
|
483
|
-
|
|
460
|
+
```typescript {3,7} fileName="vite.config.ts"
|
|
461
|
+
import { reactRouter } from "@react-router/dev/vite";
|
|
462
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
463
|
+
import { defineConfig } from "vite";
|
|
464
|
+
import { intlayer, intlayerMiddleware } from "vite-intlayer";
|
|
465
|
+
import tsconfigPaths from "vite-tsconfig-paths";
|
|
484
466
|
|
|
485
|
-
|
|
486
|
-
|
|
467
|
+
export default defineConfig({
|
|
468
|
+
plugins: [
|
|
469
|
+
tailwindcss(),
|
|
470
|
+
reactRouter(),
|
|
471
|
+
tsconfigPaths(),
|
|
472
|
+
intlayer(),
|
|
473
|
+
intlayerMiddleware(),
|
|
474
|
+
],
|
|
475
|
+
});
|
|
487
476
|
```
|
|
488
477
|
|
|
489
|
-
|
|
490
|
-
# Build Intlayer dictionaries
|
|
491
|
-
yarn intlayer:build
|
|
492
|
-
|
|
493
|
-
# Start development server
|
|
494
|
-
yarn dev
|
|
495
|
-
```
|
|
478
|
+
---
|
|
496
479
|
|
|
497
480
|
### Step 12: Configure TypeScript (Optional)
|
|
498
481
|
|
|
499
|
-
Intlayer uses module augmentation to
|
|
482
|
+
Intlayer uses module augmentation to benefit from TypeScript and strengthen your codebase.
|
|
500
483
|
|
|
501
484
|
Ensure your TypeScript configuration includes the autogenerated types:
|
|
502
485
|
|
|
503
486
|
```json5 fileName="tsconfig.json"
|
|
504
487
|
{
|
|
505
|
-
|
|
506
|
-
// ... your existing TypeScript configurations
|
|
507
|
-
},
|
|
488
|
+
// ... your existing configurations
|
|
508
489
|
include: [
|
|
509
490
|
// ... your existing includes
|
|
510
491
|
".intlayer/**/*.ts", // Include the auto-generated types
|
|
@@ -512,6 +493,8 @@ Ensure your TypeScript configuration includes the autogenerated types:
|
|
|
512
493
|
}
|
|
513
494
|
```
|
|
514
495
|
|
|
496
|
+
---
|
|
497
|
+
|
|
515
498
|
### Git Configuration
|
|
516
499
|
|
|
517
500
|
It is recommended to ignore the files generated by Intlayer. This prevents you from committing them to your Git repository.
|
|
@@ -525,67 +508,9 @@ To do this, you can add the following instructions to your `.gitignore` file:
|
|
|
525
508
|
|
|
526
509
|
---
|
|
527
510
|
|
|
528
|
-
### Step 13: Create Redirection (Optional)
|
|
529
|
-
|
|
530
|
-
```typescript fileName="src/routes/{-$locale}/rotue.tsx" codeFormat="typescript"
|
|
531
|
-
function LayoutComponent() {
|
|
532
|
-
useI18nHTMLAttributes();
|
|
533
|
-
|
|
534
|
-
const { locale } = Route.useParams();
|
|
535
|
-
const { locale: selectedLocale } = useLocale();
|
|
536
|
-
const { defaultLocale } = configuration.internationalization;
|
|
537
|
-
const { prefixDefault } = configuration.middleware;
|
|
538
|
-
|
|
539
|
-
// Redirect to the default locale if no locale is present in the URL when prefixDefault is true
|
|
540
|
-
if (selectedLocale === defaultLocale && !locale && prefixDefault) {
|
|
541
|
-
return <Navigate replace to={defaultLocale} />;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
// Redirect to the selected locale if the locale in the URL does not match the selected locale
|
|
545
|
-
if (selectedLocale !== defaultLocale && !locale) {
|
|
546
|
-
return <Navigate replace to={selectedLocale} />;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
return (
|
|
550
|
-
<IntlayerProvider locale={locale}>
|
|
551
|
-
<Outlet />
|
|
552
|
-
</IntlayerProvider>
|
|
553
|
-
);
|
|
554
|
-
}
|
|
555
|
-
```
|
|
556
|
-
|
|
557
|
-
## Production Deployment
|
|
558
|
-
|
|
559
|
-
When deploying your application:
|
|
560
|
-
|
|
561
|
-
1. **Build your application:**
|
|
562
|
-
|
|
563
|
-
```bash
|
|
564
|
-
npm run build
|
|
565
|
-
```
|
|
566
|
-
|
|
567
|
-
2. **Build Intlayer dictionaries:**
|
|
568
|
-
|
|
569
|
-
```bash
|
|
570
|
-
npm run intlayer:build
|
|
571
|
-
```
|
|
572
|
-
|
|
573
|
-
3. **Move `vite-intlayer` to dependencies** if using middleware in production:
|
|
574
|
-
```bash
|
|
575
|
-
npm install vite-intlayer --save
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
Your application will now support:
|
|
579
|
-
|
|
580
|
-
- **URL Structure**: `/en`, `/en/about`, `/tr`, `/tr/about`
|
|
581
|
-
- **Automatic locale detection** based on browser preferences
|
|
582
|
-
- **Locale-aware routing** with Tanstack Start
|
|
583
|
-
- **TypeScript support** with auto-generated types
|
|
584
|
-
- **Server-side rendering** with proper locale handling
|
|
585
|
-
|
|
586
511
|
## VS Code Extension
|
|
587
512
|
|
|
588
|
-
To
|
|
513
|
+
To enhance your development experience with Intlayer, you can install the official **Intlayer VS Code Extension**.
|
|
589
514
|
|
|
590
515
|
[Install from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
591
516
|
|
|
@@ -602,7 +527,7 @@ For more details on how to use the extension, refer to the [Intlayer VS Code Ext
|
|
|
602
527
|
|
|
603
528
|
## Go Further
|
|
604
529
|
|
|
605
|
-
To go further, you can implement the [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
530
|
+
To go further, you can implement the [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/{{locale}}/intlayer_visual_editor.md) or externalise your content using the [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/{{locale}}/intlayer_CMS.md).
|
|
606
531
|
|
|
607
532
|
---
|
|
608
533
|
|
|
@@ -610,10 +535,10 @@ To go further, you can implement the [visual editor](https://github.com/aymericz
|
|
|
610
535
|
|
|
611
536
|
- [Intlayer Documentation](https://intlayer.org)
|
|
612
537
|
- [Tanstack Start Documentation](https://reactrouter.com/)
|
|
613
|
-
- [useIntlayer hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
614
|
-
- [useLocale hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
615
|
-
- [Content Declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
616
|
-
- [Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
538
|
+
- [useIntlayer hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/{{locale}}/packages/react-intlayer/useIntlayer.md)
|
|
539
|
+
- [useLocale hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/{{locale}}/packages/react-intlayer/useLocale.md)
|
|
540
|
+
- [Content Declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/{{locale}}/dictionary/get_started.md)
|
|
541
|
+
- [Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/{{locale}}/configuration.md)
|
|
617
542
|
|
|
618
543
|
This comprehensive guide provides everything you need to integrate Intlayer with Tanstack Start for a fully internationalised application with locale-aware routing and TypeScript support.
|
|
619
544
|
|
|
@@ -621,4 +546,5 @@ This comprehensive guide provides everything you need to integrate Intlayer with
|
|
|
621
546
|
|
|
622
547
|
| Version | Date | Changes |
|
|
623
548
|
| ------- | ---------- | ------------------------ |
|
|
549
|
+
| 6.5.2 | 2025-10-03 | Update doc |
|
|
624
550
|
| 5.8.1 | 2025-09-09 | Added for Tanstack Start |
|