@intlayer/docs 6.1.5 → 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/ar/next-i18next_vs_next-intl_vs_intlayer.md +404 -173
- package/blog/de/next-i18next_vs_next-intl_vs_intlayer.md +262 -113
- package/blog/en/intlayer_with_next-i18next.mdx +431 -0
- package/blog/en/intlayer_with_next-intl.mdx +335 -0
- package/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +463 -209
- package/blog/en-GB/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
- package/blog/es/next-i18next_vs_next-intl_vs_intlayer.md +185 -71
- package/blog/fr/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
- package/blog/it/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
- package/blog/ja/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
- package/blog/ko/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
- package/blog/pt/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
- package/blog/ru/next-i18next_vs_next-intl_vs_intlayer.md +36 -28
- package/blog/tr/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
- package/blog/zh/next-i18next_vs_next-intl_vs_intlayer.md +38 -28
- package/dist/cjs/generated/docs.entry.cjs +32 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +32 -0
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +2 -0
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/docs/ar/component_i18n.md +186 -0
- 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/ar/vs_code_extension.md +48 -109
- package/docs/de/component_i18n.md +186 -0
- 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/de/vs_code_extension.md +46 -107
- package/docs/en/component_i18n.md +186 -0
- 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 +31 -5
- package/docs/en/intlayer_with_nextjs_15.md +31 -5
- 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/vs_code_extension.md +24 -114
- package/docs/en-GB/component_i18n.md +186 -0
- 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/en-GB/vs_code_extension.md +42 -103
- package/docs/es/component_i18n.md +182 -0
- 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/es/vs_code_extension.md +53 -114
- package/docs/fr/component_i18n.md +186 -0
- 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/fr/vs_code_extension.md +50 -111
- package/docs/hi/component_i18n.md +186 -0
- 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/hi/vs_code_extension.md +49 -110
- package/docs/it/component_i18n.md +186 -0
- 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/it/vs_code_extension.md +50 -111
- package/docs/ja/component_i18n.md +186 -0
- 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/ja/vs_code_extension.md +50 -111
- package/docs/ko/component_i18n.md +186 -0
- 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/ko/vs_code_extension.md +48 -109
- package/docs/pt/component_i18n.md +186 -0
- 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/pt/vs_code_extension.md +46 -107
- package/docs/ru/component_i18n.md +186 -0
- 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/ru/vs_code_extension.md +48 -109
- package/docs/tr/component_i18n.md +186 -0
- 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/tr/vs_code_extension.md +54 -115
- package/docs/zh/component_i18n.md +186 -0
- 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/docs/zh/vs_code_extension.md +51 -105
- package/package.json +10 -10
- package/src/generated/docs.entry.ts +32 -0
|
@@ -19,6 +19,8 @@ slugs:
|
|
|
19
19
|
|
|
20
20
|
# next-i18next VS next-intl VS intlayer | Next.js Uluslararasılaştırma (i18n)
|
|
21
21
|
|
|
22
|
+

|
|
23
|
+
|
|
22
24
|
Bu rehber, **Next.js** için yaygın olarak kullanılan üç i18n seçeneğini karşılaştırır: **next-intl**, **next-i18next** ve **Intlayer**.
|
|
23
25
|
**Next.js 13+ App Router**'a (React Server Components ile) odaklanıyoruz ve şunları değerlendiriyoruz:
|
|
24
26
|
|
|
@@ -19,6 +19,8 @@ slugs:
|
|
|
19
19
|
|
|
20
20
|
# next-i18next VS next-intl VS intlayer | Next.js 国际化 (i18n)
|
|
21
21
|
|
|
22
|
+

|
|
23
|
+
|
|
22
24
|
让我们来看看 Next.js 的三种 i18n 方案:next-i18next、next-intl 和 Intlayer 之间的相似点和差异。
|
|
23
25
|
|
|
24
26
|
这不是一个完整的教程,而是一个帮助你选择的比较。
|
|
@@ -173,9 +175,9 @@ Next.js 为你内置了国际化路由支持(例如区域段)。但该功能
|
|
|
173
175
|
|
|
174
176
|
下面是使用 `intlayer` 在 vite + react 应用中进行包大小优化的影响示例:
|
|
175
177
|
|
|
176
|
-
| 优化后的包
|
|
177
|
-
|
|
|
178
|
-
|  |  |
|
|
178
|
+
| 优化后的包 | 未优化的包 |
|
|
179
|
+
| ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
180
|
+
|  |  |
|
|
179
181
|
|
|
180
182
|
---
|
|
181
183
|
|
|
@@ -348,25 +350,25 @@ Next.js 为你内置了国际化路由支持(例如区域段)。但该功能
|
|
|
348
350
|
|
|
349
351
|
```bash
|
|
350
352
|
.
|
|
351
|
-
├──
|
|
352
|
-
│ └── locales
|
|
353
|
-
│ ├── en
|
|
354
|
-
│ │ ├── home.json
|
|
355
|
-
│ │ └── navbar.json
|
|
356
|
-
│ ├── fr
|
|
357
|
-
│ │ ├── home.json
|
|
358
|
-
│ │ └── navbar.json
|
|
359
|
-
│ └── es
|
|
360
|
-
│ ├── home.json
|
|
361
|
-
│ └── navbar.json
|
|
362
|
-
├── next-i18next.config.js
|
|
353
|
+
├── i18n.config.ts
|
|
363
354
|
└── src
|
|
364
|
-
├──
|
|
355
|
+
├── locales
|
|
356
|
+
│ ├── en
|
|
357
|
+
│ │ ├── common.json
|
|
358
|
+
│ │ └── about.json
|
|
359
|
+
│ └── fr
|
|
360
|
+
│ ├── common.json
|
|
361
|
+
│ └── about.json
|
|
365
362
|
├── app
|
|
366
|
-
│
|
|
363
|
+
│ ├── i18n
|
|
364
|
+
│ │ └── server.ts
|
|
365
|
+
│ └── [locale]
|
|
366
|
+
│ ├── layout.tsx
|
|
367
|
+
│ └── about.tsx
|
|
367
368
|
└── components
|
|
368
|
-
|
|
369
|
-
|
|
369
|
+
├── I18nProvider.tsx
|
|
370
|
+
├── ClientComponent.tsx
|
|
371
|
+
└── ServerComponent.tsx
|
|
370
372
|
```
|
|
371
373
|
|
|
372
374
|
</TabItem>
|
|
@@ -374,6 +376,7 @@ Next.js 为你内置了国际化路由支持(例如区域段)。但该功能
|
|
|
374
376
|
|
|
375
377
|
```bash
|
|
376
378
|
.
|
|
379
|
+
├── i18n.ts
|
|
377
380
|
├── locales
|
|
378
381
|
│ ├── en
|
|
379
382
|
│ │ ├── home.json
|
|
@@ -384,11 +387,13 @@ Next.js 为你内置了国际化路由支持(例如区域段)。但该功能
|
|
|
384
387
|
│ └── es
|
|
385
388
|
│ ├── home.json
|
|
386
389
|
│ └── navbar.json
|
|
387
|
-
├── i18n.ts
|
|
388
390
|
└── src
|
|
389
391
|
├── middleware.ts
|
|
390
392
|
├── app
|
|
391
|
-
│
|
|
393
|
+
│ ├── i18n
|
|
394
|
+
│ │ └── server.ts
|
|
395
|
+
│ └── [locale]
|
|
396
|
+
│ └── home.tsx
|
|
392
397
|
└── components
|
|
393
398
|
└── Navbar
|
|
394
399
|
└── index.tsx
|
|
@@ -403,9 +408,11 @@ Next.js 为你内置了国际化路由支持(例如区域段)。但该功能
|
|
|
403
408
|
└── src
|
|
404
409
|
├── middleware.ts
|
|
405
410
|
├── app
|
|
406
|
-
│ └──
|
|
407
|
-
│
|
|
408
|
-
│ └──
|
|
411
|
+
│ └── [locale]
|
|
412
|
+
│ ├── layout.tsx
|
|
413
|
+
│ └── home
|
|
414
|
+
│ ├── index.tsx
|
|
415
|
+
│ └── index.content.ts
|
|
409
416
|
└── components
|
|
410
417
|
└── Navbar
|
|
411
418
|
├── index.tsx
|
|
@@ -533,8 +540,10 @@ export default async function LocaleLayout({
|
|
|
533
540
|
const messages = await getMessages();
|
|
534
541
|
const clientMessages = pick(messages, ["common", "about"]);
|
|
535
542
|
|
|
543
|
+
const rtlLocales = ["ar", "he", "fa", "ur"];
|
|
544
|
+
|
|
536
545
|
return (
|
|
537
|
-
<html lang={locale}>
|
|
546
|
+
<html lang={locale} dir={rtlLocales.includes(locale) ? "rtl" : "ltr"}>
|
|
538
547
|
<body>
|
|
539
548
|
<NextIntlClientProvider locale={locale} messages={clientMessages}>
|
|
540
549
|
{children}
|
|
@@ -851,10 +860,11 @@ const ServerComponent = ({ count }: ServerComponentProps) => {
|
|
|
851
860
|
type ServerComponentProps = {
|
|
852
861
|
count: number;
|
|
853
862
|
t: (key: string) => string;
|
|
863
|
+
formatter: Intl.NumberFormat;
|
|
854
864
|
};
|
|
855
865
|
|
|
856
|
-
const ServerComponent = ({ t, count }: ServerComponentProps) => {
|
|
857
|
-
const formatted =
|
|
866
|
+
const ServerComponent = ({ t, count, formatter }: ServerComponentProps) => {
|
|
867
|
+
const formatted = formatter.format(count);
|
|
858
868
|
|
|
859
869
|
return (
|
|
860
870
|
<div>
|
|
@@ -868,7 +878,7 @@ const ServerComponent = ({ t, count }: ServerComponentProps) => {
|
|
|
868
878
|
> 由于服务器组件不能是异步的,因此需要将翻译函数和格式化函数作为属性传递。
|
|
869
879
|
>
|
|
870
880
|
> - `const t = await getTranslations("about.counter");`
|
|
871
|
-
> - `const
|
|
881
|
+
> - `const formatter = await getFormatter().then((formatter) => formatter.number());`
|
|
872
882
|
|
|
873
883
|
</TabItem>
|
|
874
884
|
<TabItem label="intlayer" value="intlayer">
|
|
@@ -75,6 +75,22 @@ const docsEntry = {
|
|
|
75
75
|
hi: readLocale("autoFill.md", "hi"),
|
|
76
76
|
tr: readLocale("autoFill.md", "tr")
|
|
77
77
|
},
|
|
78
|
+
"./docs/en/component_i18n.md": {
|
|
79
|
+
en: readLocale("component_i18n.md", "en"),
|
|
80
|
+
fr: readLocale("component_i18n.md", "fr"),
|
|
81
|
+
ru: readLocale("component_i18n.md", "ru"),
|
|
82
|
+
ja: readLocale("component_i18n.md", "ja"),
|
|
83
|
+
ko: readLocale("component_i18n.md", "ko"),
|
|
84
|
+
zh: readLocale("component_i18n.md", "zh"),
|
|
85
|
+
es: readLocale("component_i18n.md", "es"),
|
|
86
|
+
de: readLocale("component_i18n.md", "de"),
|
|
87
|
+
ar: readLocale("component_i18n.md", "ar"),
|
|
88
|
+
pt: readLocale("component_i18n.md", "pt"),
|
|
89
|
+
"en-GB": readLocale("component_i18n.md", "en-GB"),
|
|
90
|
+
it: readLocale("component_i18n.md", "it"),
|
|
91
|
+
hi: readLocale("component_i18n.md", "hi"),
|
|
92
|
+
tr: readLocale("component_i18n.md", "tr")
|
|
93
|
+
},
|
|
78
94
|
"./docs/en/configuration.md": {
|
|
79
95
|
en: readLocale("configuration.md", "en"),
|
|
80
96
|
fr: readLocale("configuration.md", "fr"),
|
|
@@ -379,6 +395,22 @@ const docsEntry = {
|
|
|
379
395
|
hi: readLocale("intlayer_with_angular.md", "hi"),
|
|
380
396
|
tr: readLocale("intlayer_with_angular.md", "tr")
|
|
381
397
|
},
|
|
398
|
+
"./docs/en/intlayer_with_astro.md": {
|
|
399
|
+
en: readLocale("intlayer_with_astro.md", "en"),
|
|
400
|
+
fr: readLocale("intlayer_with_astro.md", "fr"),
|
|
401
|
+
ru: readLocale("intlayer_with_astro.md", "ru"),
|
|
402
|
+
ja: readLocale("intlayer_with_astro.md", "ja"),
|
|
403
|
+
ko: readLocale("intlayer_with_astro.md", "ko"),
|
|
404
|
+
zh: readLocale("intlayer_with_astro.md", "zh"),
|
|
405
|
+
es: readLocale("intlayer_with_astro.md", "es"),
|
|
406
|
+
de: readLocale("intlayer_with_astro.md", "de"),
|
|
407
|
+
ar: readLocale("intlayer_with_astro.md", "ar"),
|
|
408
|
+
pt: readLocale("intlayer_with_astro.md", "pt"),
|
|
409
|
+
"en-GB": readLocale("intlayer_with_astro.md", "en-GB"),
|
|
410
|
+
it: readLocale("intlayer_with_astro.md", "it"),
|
|
411
|
+
hi: readLocale("intlayer_with_astro.md", "hi"),
|
|
412
|
+
tr: readLocale("intlayer_with_astro.md", "tr")
|
|
413
|
+
},
|
|
382
414
|
"./docs/en/intlayer_with_create_react_app.md": {
|
|
383
415
|
en: readLocale("intlayer_with_create_react_app.md", "en"),
|
|
384
416
|
fr: readLocale("intlayer_with_create_react_app.md", "fr"),
|