@intlayer/docs 9.1.3 → 9.2.0
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/rag_powered_documentation_assistant.md +7 -0
- package/blog/de/rag_powered_documentation_assistant.md +6 -0
- package/blog/en-GB/rag_powered_documentation_assistant.md +6 -0
- package/blog/es/rag_powered_documentation_assistant.md +7 -0
- package/blog/fr/i18n_meaning.md +7 -1
- package/blog/fr/list_i18n_technologies/frameworks/angular.md +5 -1
- package/blog/fr/rag_powered_documentation_assistant.md +6 -0
- package/blog/hi/next-i18next_vs_next-intl_vs_intlayer.md +119 -42
- package/blog/hi/rag_powered_documentation_assistant.md +7 -0
- package/blog/id/rag_powered_documentation_assistant.md +6 -0
- package/blog/it/rag_powered_documentation_assistant.md +6 -0
- package/blog/ja/rag_powered_documentation_assistant.md +7 -0
- package/blog/ko/list_i18n_technologies/frameworks/react.md +7 -7
- package/blog/ko/rag_powered_documentation_assistant.md +6 -0
- package/blog/pl/rag_powered_documentation_assistant.md +6 -0
- package/blog/pt/rag_powered_documentation_assistant.md +6 -0
- package/blog/ru/rag_powered_documentation_assistant.md +7 -0
- package/blog/tr/intlayer_with_react-intl.md +3 -1
- package/blog/tr/next-i18next_vs_next-intl_vs_intlayer.md +175 -42
- package/blog/tr/rag_powered_documentation_assistant.md +6 -0
- package/blog/uk/rag_powered_documentation_assistant.md +6 -0
- package/blog/vi/rag_powered_documentation_assistant.md +6 -0
- package/blog/zh/intlayer_with_i18next.md +87 -28
- package/blog/zh/intlayer_with_next-i18next.md +86 -29
- package/blog/zh/intlayer_with_next-intl.md +88 -28
- package/blog/zh/intlayer_with_react-i18next.md +87 -28
- package/blog/zh/intlayer_with_react-intl.md +88 -27
- package/blog/zh/intlayer_with_vue-i18n.md +117 -8
- package/blog/zh/rag_powered_documentation_assistant.md +6 -0
- package/dist/cjs/generated/blog.entry.cjs +27 -27
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +234 -214
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +17 -17
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +2 -2
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +27 -27
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +234 -214
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/esm/generated/frequentQuestions.entry.mjs +17 -17
- package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
- package/dist/esm/generated/legal.entry.mjs +2 -2
- package/dist/esm/generated/legal.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/analytics.md +222 -0
- package/docs/ar/autoFill.md +28 -9
- package/docs/ar/configuration.md +25 -8
- package/docs/ar/dictionary/file.md +3 -1
- package/docs/ar/dictionary/nesting.md +47 -30
- package/docs/ar/formatters.md +148 -193
- package/docs/ar/intlayer_CMS.md +152 -0
- package/docs/ar/intlayer_with_angular_21.md +9 -9
- package/docs/ar/intlayer_with_nextjs_14.md +1 -28
- package/docs/ar/intlayer_with_nextjs_15.md +1 -33
- package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +40 -83
- package/docs/ar/intlayer_with_solid_start.md +1078 -0
- package/docs/ar/intlayer_with_vite+vue.md +1 -3
- package/docs/ar/packages/intlayer/getLocalizedUrl.md +26 -24
- package/docs/ar/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/ar/packages/react-intlayer/useDictionary.md +4 -21
- package/docs/ar/packages/react-intlayer/useIntlayer.md +2 -2
- package/docs/ar/packages/vite-intlayer/exports.md +15 -0
- package/docs/ar/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/ar/packages/vite-intlayer/intlayerPrune.md +70 -3
- package/docs/ar/releases/v9.md +0 -37
- package/docs/ar/self_hosting.md +46 -49
- package/docs/bn/configuration.md +25 -8
- package/docs/bn/intlayer_with_angular_21.md +9 -9
- package/docs/cs/configuration.md +25 -8
- package/docs/cs/intlayer_with_angular_21.md +9 -9
- package/docs/de/analytics.md +222 -0
- package/docs/de/autoFill.md +28 -9
- package/docs/de/configuration.md +25 -8
- package/docs/de/dictionary/file.md +3 -1
- package/docs/de/dictionary/nesting.md +47 -31
- package/docs/de/formatters.md +208 -334
- package/docs/de/intlayer_CMS.md +66 -15
- package/docs/de/intlayer_with_angular_21.md +9 -9
- package/docs/de/intlayer_with_nestjs.md +11 -7
- package/docs/de/intlayer_with_nextjs_14.md +1 -28
- package/docs/de/intlayer_with_nextjs_15.md +1 -33
- package/docs/de/intlayer_with_solid_start.md +1078 -0
- package/docs/de/intlayer_with_vite+vue.md +1 -3
- package/docs/de/packages/intlayer/getLocalizedUrl.md +33 -25
- package/docs/de/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/de/packages/react-intlayer/useDictionary.md +2 -5
- package/docs/de/packages/vite-intlayer/exports.md +15 -0
- package/docs/de/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/de/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/de/releases/v9.md +0 -15
- package/docs/de/self_hosting.md +46 -50
- package/docs/en/cli/doc-review.md +13 -2
- package/docs/en/configuration.md +24 -15
- package/docs/en/intlayer_with_angular_21.md +9 -9
- package/docs/en/intlayer_with_solid_start.md +1091 -0
- package/docs/en/intlayer_with_vite+solid.md +12 -0
- package/docs/en-GB/analytics.md +222 -0
- package/docs/en-GB/autoFill.md +26 -7
- package/docs/en-GB/configuration.md +25 -8
- package/docs/en-GB/dictionary/file.md +2 -0
- package/docs/en-GB/dictionary/nesting.md +64 -205
- package/docs/en-GB/formatters.md +146 -181
- package/docs/en-GB/intlayer_CMS.md +152 -0
- package/docs/en-GB/intlayer_with_angular_21.md +9 -9
- package/docs/en-GB/intlayer_with_nestjs.md +6 -2
- package/docs/en-GB/intlayer_with_nextjs_14.md +0 -27
- package/docs/en-GB/intlayer_with_nextjs_15.md +1 -33
- package/docs/en-GB/intlayer_with_react_router_v7_fs_routes.md +40 -82
- package/docs/en-GB/intlayer_with_solid_start.md +1078 -0
- package/docs/en-GB/intlayer_with_vite+vue.md +1 -3
- package/docs/en-GB/packages/intlayer/getLocalizedUrl.md +30 -22
- package/docs/en-GB/packages/intlayer/getMultilingualUrls.md +16 -48
- package/docs/en-GB/packages/vite-intlayer/exports.md +15 -0
- package/docs/en-GB/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/en-GB/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/en-GB/self_hosting.md +60 -49
- package/docs/es/analytics.md +222 -0
- package/docs/es/autoFill.md +28 -9
- package/docs/es/configuration.md +24 -7
- package/docs/es/dictionary/file.md +3 -1
- package/docs/es/dictionary/nesting.md +47 -30
- package/docs/es/formatters.md +114 -168
- package/docs/es/intlayer_CMS.md +35 -10
- package/docs/es/intlayer_with_angular_21.md +9 -9
- package/docs/es/intlayer_with_nextjs_14.md +1 -28
- package/docs/es/intlayer_with_nextjs_15.md +1 -33
- package/docs/es/intlayer_with_solid_start.md +1078 -0
- package/docs/es/packages/intlayer/getLocalizedUrl.md +31 -23
- package/docs/es/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/es/packages/vite-intlayer/exports.md +15 -0
- package/docs/es/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/es/packages/vite-intlayer/intlayerPrune.md +69 -2
- package/docs/es/releases/v9.md +0 -15
- package/docs/es/self_hosting.md +46 -49
- package/docs/fr/analytics.md +222 -0
- package/docs/fr/autoFill.md +27 -8
- package/docs/fr/configuration.md +25 -8
- package/docs/fr/dictionary/file.md +2 -0
- package/docs/fr/dictionary/nesting.md +37 -184
- package/docs/fr/formatters.md +95 -236
- package/docs/fr/intlayer_CMS.md +66 -15
- package/docs/fr/intlayer_with_angular_21.md +9 -9
- package/docs/fr/intlayer_with_nextjs_14.md +1 -28
- package/docs/fr/intlayer_with_nextjs_15.md +1 -33
- package/docs/fr/intlayer_with_solid_start.md +1078 -0
- package/docs/fr/packages/intlayer/getLocalizedUrl.md +37 -27
- package/docs/fr/packages/intlayer/getMultilingualUrls.md +18 -20
- package/docs/fr/packages/vite-intlayer/exports.md +15 -0
- package/docs/fr/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/fr/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/fr/releases/v9.md +0 -15
- package/docs/fr/self_hosting.md +46 -49
- package/docs/hi/analytics.md +222 -0
- package/docs/hi/autoFill.md +28 -9
- package/docs/hi/configuration.md +25 -8
- package/docs/hi/dictionary/file.md +3 -1
- package/docs/hi/dictionary/nesting.md +47 -30
- package/docs/hi/formatters.md +233 -334
- package/docs/hi/how_works_intlayer.md +3 -1
- package/docs/hi/intlayer_CMS.md +152 -0
- package/docs/hi/intlayer_with_angular_21.md +9 -9
- package/docs/hi/intlayer_with_nestjs.md +11 -7
- package/docs/hi/intlayer_with_nextjs_14.md +1 -28
- package/docs/hi/intlayer_with_nextjs_15.md +1 -33
- package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +40 -83
- package/docs/hi/intlayer_with_solid_start.md +1077 -0
- package/docs/hi/intlayer_with_vite+preact.md +56 -49
- package/docs/hi/intlayer_with_vite+react.md +48 -41
- package/docs/hi/intlayer_with_vite+solid.md +32 -41
- package/docs/hi/intlayer_with_vite+vue.md +49 -44
- package/docs/hi/packages/intlayer/getLocalizedUrl.md +26 -24
- package/docs/hi/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/hi/packages/next-intlayer/t.md +33 -1
- package/docs/hi/packages/react-intlayer/useDictionary.md +4 -21
- package/docs/hi/packages/vite-intlayer/exports.md +15 -0
- package/docs/hi/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/hi/packages/vite-intlayer/intlayerPrune.md +78 -5
- package/docs/hi/plugins/sync-json.md +9 -9
- package/docs/hi/releases/v9.md +0 -15
- package/docs/hi/self_hosting.md +38 -51
- package/docs/id/analytics.md +223 -0
- package/docs/id/configuration.md +25 -8
- package/docs/id/dictionary/nesting.md +37 -184
- package/docs/id/formatters.md +208 -305
- package/docs/id/intlayer_CMS.md +164 -0
- package/docs/id/intlayer_with_angular_21.md +9 -9
- package/docs/id/intlayer_with_nextjs_14.md +1 -26
- package/docs/id/intlayer_with_react_router_v7_fs_routes.md +70 -63
- package/docs/id/intlayer_with_solid_start.md +1078 -0
- package/docs/id/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/id/packages/react-intlayer/useIntlayer.md +2 -2
- package/docs/id/packages/vite-intlayer/exports.md +15 -0
- package/docs/id/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/id/packages/vite-intlayer/intlayerPrune.md +78 -5
- package/docs/id/releases/v9.md +12 -0
- package/docs/id/self_hosting.md +61 -50
- package/docs/it/analytics.md +222 -0
- package/docs/it/autoFill.md +27 -8
- package/docs/it/configuration.md +25 -8
- package/docs/it/dictionary/file.md +3 -1
- package/docs/it/dictionary/nesting.md +47 -30
- package/docs/it/formatters.md +114 -168
- package/docs/it/intlayer_CMS.md +66 -15
- package/docs/it/intlayer_with_angular_21.md +9 -9
- package/docs/it/intlayer_with_nestjs.md +11 -7
- package/docs/it/intlayer_with_nextjs_14.md +1 -28
- package/docs/it/intlayer_with_nextjs_15.md +1 -33
- package/docs/it/intlayer_with_solid_start.md +1078 -0
- package/docs/it/intlayer_with_vite+vue.md +1 -3
- package/docs/it/packages/intlayer/getLocalizedUrl.md +34 -26
- package/docs/it/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/it/packages/react-intlayer/useDictionary.md +4 -21
- package/docs/it/packages/vite-intlayer/exports.md +15 -0
- package/docs/it/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/it/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/it/releases/v9.md +0 -15
- package/docs/it/self_hosting.md +60 -49
- package/docs/ja/analytics.md +222 -0
- package/docs/ja/autoFill.md +28 -9
- package/docs/ja/configuration.md +25 -8
- package/docs/ja/dictionary/content_file.md +15 -7
- package/docs/ja/dictionary/file.md +3 -1
- package/docs/ja/dictionary/nesting.md +47 -30
- package/docs/ja/formatters.md +133 -187
- package/docs/ja/intlayer_visual_editor.md +3 -1
- package/docs/ja/intlayer_with_angular_21.md +6 -6
- package/docs/ja/intlayer_with_nestjs.md +2 -12
- package/docs/ja/intlayer_with_nextjs_14.md +1 -28
- package/docs/ja/intlayer_with_nextjs_15.md +1 -33
- package/docs/ja/intlayer_with_react_router_v7.md +456 -20
- package/docs/ja/intlayer_with_solid_start.md +1078 -0
- package/docs/ja/intlayer_with_vite+preact.md +73 -41
- package/docs/ja/intlayer_with_vite+vue.md +1 -3
- package/docs/ja/mcp_server.md +3 -9
- package/docs/ja/packages/intlayer/getLocalizedUrl.md +26 -24
- package/docs/ja/packages/intlayer/getMultilingualUrls.md +3 -17
- package/docs/ja/packages/vite-intlayer/exports.md +15 -0
- package/docs/ja/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/ja/packages/vite-intlayer/intlayerPrune.md +79 -6
- package/docs/ja/releases/v9.md +12 -0
- package/docs/ja/self_hosting.md +46 -50
- package/docs/ko/analytics.md +222 -0
- package/docs/ko/autoFill.md +28 -9
- package/docs/ko/configuration.md +25 -8
- package/docs/ko/dictionary/file.md +3 -1
- package/docs/ko/dictionary/nesting.md +47 -30
- package/docs/ko/formatters.md +133 -187
- package/docs/ko/intlayer_with_angular_21.md +9 -9
- package/docs/ko/intlayer_with_lynx+react.md +133 -39
- package/docs/ko/intlayer_with_nextjs_14.md +1 -28
- package/docs/ko/intlayer_with_nextjs_15.md +1 -33
- package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +40 -188
- package/docs/ko/intlayer_with_solid_start.md +1078 -0
- package/docs/ko/intlayer_with_vite+preact.md +57 -23
- package/docs/ko/intlayer_with_vite+vue.md +1 -3
- package/docs/ko/packages/intlayer/getLocalizedUrl.md +26 -24
- package/docs/ko/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/ko/packages/vite-intlayer/exports.md +15 -0
- package/docs/ko/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/ko/packages/vite-intlayer/intlayerPrune.md +79 -6
- package/docs/ko/releases/v9.md +12 -0
- package/docs/ko/self_hosting.md +60 -49
- package/docs/nl/configuration.md +25 -8
- package/docs/nl/intlayer_with_angular_21.md +9 -9
- package/docs/pl/analytics.md +220 -0
- package/docs/pl/configuration.md +25 -8
- package/docs/pl/dictionary/nesting.md +47 -30
- package/docs/pl/formatters.md +208 -305
- package/docs/pl/intlayer_CMS.md +152 -0
- package/docs/pl/intlayer_with_angular_21.md +9 -9
- package/docs/pl/intlayer_with_nextjs_14.md +1 -26
- package/docs/pl/intlayer_with_solid_start.md +1078 -0
- package/docs/pl/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/pl/packages/react-intlayer/useDictionary.md +2 -19
- package/docs/pl/packages/vite-intlayer/exports.md +15 -0
- package/docs/pl/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/pl/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/pl/releases/v9.md +0 -15
- package/docs/pl/self_hosting.md +60 -49
- package/docs/pt/analytics.md +222 -0
- package/docs/pt/configuration.md +25 -8
- package/docs/pt/dictionary/file.md +3 -1
- package/docs/pt/dictionary/nesting.md +47 -30
- package/docs/pt/formatters.md +112 -168
- package/docs/pt/intlayer_CMS.md +66 -15
- package/docs/pt/intlayer_with_angular_21.md +9 -9
- package/docs/pt/intlayer_with_astro_lit.md +26 -1
- package/docs/pt/intlayer_with_nextjs_14.md +1 -28
- package/docs/pt/intlayer_with_nextjs_15.md +1 -33
- package/docs/pt/intlayer_with_solid_start.md +1078 -0
- package/docs/pt/intlayer_with_vite+vue.md +1 -3
- package/docs/pt/packages/intlayer/getLocalizedUrl.md +34 -26
- package/docs/pt/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/pt/packages/vite-intlayer/exports.md +15 -0
- package/docs/pt/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/pt/packages/vite-intlayer/intlayerPrune.md +78 -6
- package/docs/pt/releases/v9.md +0 -15
- package/docs/pt/self_hosting.md +60 -49
- package/docs/ru/analytics.md +222 -0
- package/docs/ru/autoFill.md +27 -8
- package/docs/ru/configuration.md +25 -8
- package/docs/ru/dictionary/file.md +3 -1
- package/docs/ru/dictionary/nesting.md +64 -205
- package/docs/ru/formatters.md +108 -128
- package/docs/ru/intlayer_with_angular_21.md +9 -9
- package/docs/ru/intlayer_with_nextjs_14.md +1 -28
- package/docs/ru/intlayer_with_nextjs_15.md +1 -33
- package/docs/ru/intlayer_with_solid_start.md +1078 -0
- package/docs/ru/intlayer_with_vite+vue.md +1 -3
- package/docs/ru/packages/intlayer/getLocalizedUrl.md +34 -26
- package/docs/ru/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/ru/packages/react-intlayer/useDictionary.md +4 -21
- package/docs/ru/packages/vite-intlayer/exports.md +15 -0
- package/docs/ru/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/ru/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/ru/releases/v9.md +0 -15
- package/docs/ru/self_hosting.md +60 -49
- package/docs/tr/analytics.md +222 -0
- package/docs/tr/autoFill.md +28 -9
- package/docs/tr/configuration.md +25 -8
- package/docs/tr/dictionary/file.md +2 -0
- package/docs/tr/dictionary/nesting.md +47 -30
- package/docs/tr/formatters.md +144 -190
- package/docs/tr/intlayer_CMS.md +152 -0
- package/docs/tr/intlayer_with_angular_21.md +9 -9
- package/docs/tr/intlayer_with_nestjs.md +2 -12
- package/docs/tr/intlayer_with_nextjs_15.md +1 -33
- package/docs/tr/intlayer_with_solid_start.md +1078 -0
- package/docs/tr/intlayer_with_vite+vue.md +1 -3
- package/docs/tr/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/tr/packages/vite-intlayer/exports.md +15 -0
- package/docs/tr/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/tr/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/tr/self_hosting.md +47 -50
- package/docs/uk/analytics.md +222 -0
- package/docs/uk/configuration.md +25 -8
- package/docs/uk/dictionary/nesting.md +47 -30
- package/docs/uk/formatters.md +128 -185
- package/docs/uk/intlayer_CMS.md +152 -0
- package/docs/uk/intlayer_with_angular_21.md +9 -9
- package/docs/uk/intlayer_with_nextjs_14.md +1 -26
- package/docs/uk/intlayer_with_solid_start.md +1078 -0
- package/docs/uk/packages/react-intlayer/useDictionary.md +2 -19
- package/docs/uk/packages/vite-intlayer/exports.md +15 -0
- package/docs/uk/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/uk/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/uk/releases/v9.md +0 -15
- package/docs/uk/self_hosting.md +60 -50
- package/docs/ur/configuration.md +25 -8
- package/docs/ur/intlayer_with_angular_21.md +9 -9
- package/docs/vi/analytics.md +222 -0
- package/docs/vi/configuration.md +24 -8
- package/docs/vi/dictionary/nesting.md +37 -184
- package/docs/vi/formatters.md +208 -309
- package/docs/vi/intlayer_CMS.md +164 -0
- package/docs/vi/intlayer_with_angular_21.md +9 -9
- package/docs/vi/intlayer_with_nextjs_14.md +0 -25
- package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +70 -63
- package/docs/vi/intlayer_with_solid_start.md +1078 -0
- package/docs/vi/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/vi/packages/react-intlayer/useIntlayer.md +2 -2
- package/docs/vi/packages/vite-intlayer/exports.md +15 -0
- package/docs/vi/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/vi/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/vi/plugins/sync-json.md +6 -6
- package/docs/vi/releases/v9.md +12 -0
- package/docs/vi/self_hosting.md +61 -50
- package/docs/zh/CI_CD.md +4 -0
- package/docs/zh/analytics.md +222 -0
- package/docs/zh/autoFill.md +28 -9
- package/docs/zh/configuration.md +24 -8
- package/docs/zh/dictionary/file.md +2 -0
- package/docs/zh/dictionary/nesting.md +47 -30
- package/docs/zh/formatters.md +140 -188
- package/docs/zh/intlayer_CMS.md +164 -0
- package/docs/zh/intlayer_with_analog.md +193 -3
- package/docs/zh/intlayer_with_angular_19.md +272 -3
- package/docs/zh/intlayer_with_angular_21.md +7 -7
- package/docs/zh/intlayer_with_create_react_app.md +348 -26
- package/docs/zh/intlayer_with_lynx+react.md +263 -4
- package/docs/zh/intlayer_with_nextjs_14.md +1 -28
- package/docs/zh/intlayer_with_nextjs_15.md +1 -33
- package/docs/zh/intlayer_with_nextjs_no_locale_path.md +558 -1
- package/docs/zh/intlayer_with_nuxt.md +182 -7
- package/docs/zh/intlayer_with_react_router_v7.md +183 -25
- package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +306 -42
- package/docs/zh/intlayer_with_solid_start.md +1077 -0
- package/docs/zh/intlayer_with_storybook.md +260 -3
- package/docs/zh/intlayer_with_svelte_kit.md +428 -48
- package/docs/zh/intlayer_with_tanstack+solid.md +713 -13
- package/docs/zh/intlayer_with_tanstack.md +731 -20
- package/docs/zh/intlayer_with_vanilla.md +314 -4
- package/docs/zh/intlayer_with_vite+lit.md +465 -4
- package/docs/zh/intlayer_with_vite+preact.md +422 -116
- package/docs/zh/intlayer_with_vite+react.md +324 -45
- package/docs/zh/intlayer_with_vite+react_compiler.md +228 -13
- package/docs/zh/intlayer_with_vite+solid.md +462 -32
- package/docs/zh/intlayer_with_vite+vanilla.md +497 -4
- package/docs/zh/mcp_server.md +3 -9
- package/docs/zh/packages/intlayer/getLocalizedUrl.md +26 -24
- package/docs/zh/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/zh/packages/vite-intlayer/exports.md +29 -0
- package/docs/zh/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/zh/packages/vite-intlayer/intlayerPrune.md +79 -6
- package/docs/zh/releases/v9.md +12 -0
- package/docs/zh/self_hosting.md +60 -50
- package/docs/zh-TW/intlayer_with_angular_21.md +7 -7
- package/package.json +6 -6
- package/src/generated/blog.entry.ts +27 -27
- package/src/generated/docs.entry.ts +234 -214
- package/src/generated/frequentQuestions.entry.ts +17 -17
- package/src/generated/legal.entry.ts +2 -2
package/docs/vi/intlayer_CMS.md
CHANGED
|
@@ -244,12 +244,176 @@ Lệnh này sẽ tải các từ điển nội dung ban đầu của bạn lên,
|
|
|
244
244
|
|
|
245
245
|
Sau đó, bạn sẽ có thể xem và quản lý từ điển của mình trong [Intlayer CMS](https://app.intlayer.org/content).
|
|
246
246
|
|
|
247
|
+
## Truy cập lập trình với SDK `@intlayer/api`
|
|
248
|
+
|
|
249
|
+
Ngoài CLI và trình chỉnh sửa trực quan, Intlayer cung cấp một SDK được gõ kiểu trong gói [`@intlayer/api`](https://www.npmjs.com/package/@intlayer/api). Nó cho phép bạn coi CMS như một **cơ sở dữ liệu nội dung headless**: bạn có thể lấy dự án, lấy từ điển và đẩy hoặc cập nhật chúng trực tiếp từ ứng dụng, tập lệnh hoặc CI pipeline của riêng bạn.
|
|
250
|
+
|
|
251
|
+
SDK xử lý xác thực cho bạn. Miễn là `clientId` và `clientSecret` của bạn có sẵn (trong cấu hình Intlayer hoặc môi trường của bạn), nó sẽ lấy và làm mới token truy cập OAuth2 tự động và ký mọi yêu cầu.
|
|
252
|
+
|
|
253
|
+
### Cài đặt
|
|
254
|
+
|
|
255
|
+
```bash packageManager="npm"
|
|
256
|
+
npm install @intlayer/api
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
```bash packageManager="yarn"
|
|
260
|
+
yarn add @intlayer/api
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
```bash packageManager="pnpm"
|
|
264
|
+
pnpm add @intlayer/api
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
```bash packageManager="bun"
|
|
268
|
+
bun add @intlayer/api
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Cách hoạt động: authenticator + endpoints
|
|
272
|
+
|
|
273
|
+
SDK được chia thành **hai import riêng biệt** có mục đích, để giữ bundle của bạn nhỏ gọn:
|
|
274
|
+
|
|
275
|
+
1. `createIntlayerCMS` — tạo một **authenticator** nhẹ. Nó chỉ chứa thông tin xác thực và mã token được quản lý; nó không biết gì về bất kỳ domain cụ thể nào.
|
|
276
|
+
2. `dictionaryEndpoint`, `projectEndpoint`, … — **endpoint binders** theo từng domain, mỗi cái được import từ đường dẫn con của nó (`@intlayer/api/dictionary`, `@intlayer/api/project`, …). Bạn truyền authenticator vào endpoint mà bạn cần.
|
|
277
|
+
|
|
278
|
+
Vì mỗi endpoint được import riêng biệt, bundle của bạn chỉ bao gồm những domain mà bạn thực sự sử dụng — import `dictionaryEndpoint` không bao giờ kéo theo project, AI, hoặc bất kỳ domain client nào khác.
|
|
279
|
+
|
|
280
|
+
```typescript fileName="cms.ts" codeFormat="typescript"
|
|
281
|
+
import { createIntlayerCMS } from "@intlayer/api";
|
|
282
|
+
|
|
283
|
+
// Cấu hình là tùy chọn: khi bị bỏ qua, thông tin xác thực được đọc từ
|
|
284
|
+
// `@intlayer/config/built`, cái mà phân giải các biến môi trường
|
|
285
|
+
// INTLAYER_CLIENT_ID và INTLAYER_CLIENT_SECRET.
|
|
286
|
+
export const cmsAuthenticator = createIntlayerCMS();
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
> [!WARNING]
|
|
290
|
+
> Thông tin xác thực CMS (`clientId` / `clientSecret`) cấp quyền **write access** vào nội dung của bạn. Chỉ tạo authenticator trên **phía server** (server actions, route handlers, scripts, CI). Không bao giờ import nó vào code phía client hoặc để lộ thông tin xác thực của bạn cho trình duyệt.
|
|
291
|
+
|
|
292
|
+
Nếu bạn không muốn dựa vào cấu hình build-time, hãy truyền thông tin xác thực một cách rõ ràng:
|
|
293
|
+
|
|
294
|
+
```typescript fileName="cms.ts" codeFormat="typescript"
|
|
295
|
+
import { createIntlayerCMS } from "@intlayer/api";
|
|
296
|
+
|
|
297
|
+
export const cmsAuthenticator = createIntlayerCMS({
|
|
298
|
+
editor: {
|
|
299
|
+
clientId: process.env.INTLAYER_CLIENT_ID,
|
|
300
|
+
clientSecret: process.env.INTLAYER_CLIENT_SECRET,
|
|
301
|
+
// Tùy chọn, cho các backend tự lưu trữ:
|
|
302
|
+
// backendURL: process.env.INTLAYER_BACKEND_URL,
|
|
303
|
+
},
|
|
304
|
+
});
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
> Lấy thông tin xác thực của bạn bằng cách tạo khóa truy cập mới trong [Intlayer Dashboard - Projects](https://app.intlayer.org/projects).
|
|
308
|
+
|
|
309
|
+
### Lấy các dự án
|
|
310
|
+
|
|
311
|
+
```typescript fileName="projects.ts" codeFormat="typescript"
|
|
312
|
+
import { createIntlayerCMS } from "@intlayer/api";
|
|
313
|
+
import { projectEndpoint } from "@intlayer/api/project";
|
|
314
|
+
|
|
315
|
+
const cmsAuthenticator = createIntlayerCMS();
|
|
316
|
+
|
|
317
|
+
// Liệt kê các dự án có thể truy cập với thông tin xác thực của bạn
|
|
318
|
+
const { data: projects } =
|
|
319
|
+
await projectEndpoint(cmsAuthenticator).getProjects();
|
|
320
|
+
|
|
321
|
+
// Đọc thông tin chi tiết bản địa hóa tổng hợp của dự án đã chọn
|
|
322
|
+
const { data: insights } =
|
|
323
|
+
await projectEndpoint(cmsAuthenticator).getProjectInsights();
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Tìm nạp từ điển
|
|
327
|
+
|
|
328
|
+
```typescript fileName="read-dictionaries.ts" codeFormat="typescript"
|
|
329
|
+
import { createIntlayerCMS } from "@intlayer/api";
|
|
330
|
+
import { dictionaryEndpoint } from "@intlayer/api/dictionary";
|
|
331
|
+
|
|
332
|
+
const cmsAuthenticator = createIntlayerCMS();
|
|
333
|
+
|
|
334
|
+
// Liệt kê mọi từ điển từ xa của dự án
|
|
335
|
+
const { data: dictionaries } =
|
|
336
|
+
await dictionaryEndpoint(cmsAuthenticator).getDictionaries();
|
|
337
|
+
|
|
338
|
+
// Hoặc lấy một từ điển duy nhất theo khóa
|
|
339
|
+
const { data: dictionary } = await dictionaryEndpoint(
|
|
340
|
+
cmsAuthenticator
|
|
341
|
+
).getDictionary("my-first-dictionary-key");
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Đẩy và cập nhật từ điển
|
|
345
|
+
|
|
346
|
+
Sử dụng CMS như một cơ sở dữ liệu để ghi nội dung trở lại:
|
|
347
|
+
|
|
348
|
+
```typescript fileName="write-dictionaries.ts" codeFormat="typescript"
|
|
349
|
+
import { createIntlayerCMS } from "@intlayer/api";
|
|
350
|
+
import { dictionaryEndpoint } from "@intlayer/api/dictionary";
|
|
351
|
+
|
|
352
|
+
const cmsAuthenticator = createIntlayerCMS();
|
|
353
|
+
|
|
354
|
+
// Tạo một từ điển mới
|
|
355
|
+
await dictionaryEndpoint(cmsAuthenticator).addDictionary({
|
|
356
|
+
key: "my-first-dictionary-key",
|
|
357
|
+
content: { title: "Hello world" },
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
// Upsert một loạt từ điển (tạo hoặc cập nhật chúng trong một lệnh gọi)
|
|
361
|
+
await dictionaryEndpoint(cmsAuthenticator).pushDictionaries([
|
|
362
|
+
{ key: "home", content: { title: "Home" } },
|
|
363
|
+
{ key: "about", content: { title: "About" } },
|
|
364
|
+
]);
|
|
365
|
+
|
|
366
|
+
// Cập nhật một từ điển hiện có
|
|
367
|
+
await dictionaryEndpoint(cmsAuthenticator).updateDictionary({
|
|
368
|
+
id: "<dictionary-id>",
|
|
369
|
+
key: "home",
|
|
370
|
+
content: { title: "Updated title" },
|
|
371
|
+
});
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
> Mẹo: tái sử dụng endpoint đã liên kết để tránh lặp lại:
|
|
375
|
+
>
|
|
376
|
+
> ```typescript codeFormat="typescript"
|
|
377
|
+
> const dictionary = dictionaryEndpoint(cmsAuthenticator);
|
|
378
|
+
> await dictionary.pushDictionaries([myDictionary]);
|
|
379
|
+
> const { data } = await dictionary.getDictionaries();
|
|
380
|
+
> ```
|
|
381
|
+
|
|
382
|
+
### Trích xuất một phương thức duy nhất
|
|
383
|
+
|
|
384
|
+
Mỗi phương thức endpoint đã được xác thực và độc lập (nó mang theo xử lý token riêng của mình), vì vậy bạn có thể trích xuất một phương thức và truyền nó xung quanh — ví dụ để inject nó như một dependency:
|
|
385
|
+
|
|
386
|
+
```typescript fileName="push.ts" codeFormat="typescript"
|
|
387
|
+
import { createIntlayerCMS } from "@intlayer/api";
|
|
388
|
+
import { dictionaryEndpoint } from "@intlayer/api/dictionary";
|
|
389
|
+
|
|
390
|
+
const dictionary = dictionaryEndpoint(createIntlayerCMS());
|
|
391
|
+
|
|
392
|
+
// Đã được xác thực — tự động làm mới token trên mỗi lần gọi
|
|
393
|
+
export const pushDictionaries = dictionary.pushDictionaries;
|
|
394
|
+
|
|
395
|
+
// Cách sử dụng
|
|
396
|
+
await pushDictionaries([{ key: "home", content: { title: "Home" } }]);
|
|
397
|
+
```
|
|
398
|
+
|
|
247
399
|
## Đồng bộ trực tiếp (Live sync)
|
|
248
400
|
|
|
249
401
|
Live Sync cho phép ứng dụng của bạn phản ánh các thay đổi nội dung CMS trong thời gian chạy. Không cần xây dựng lại hoặc triển khai lại. Khi được bật, các cập nhật sẽ được truyền đến máy chủ Live Sync để làm mới các từ điển mà ứng dụng của bạn đang đọc.
|
|
250
402
|
|
|
251
403
|
Để xem hướng dẫn thiết lập đầy đủ (kích hoạt, khởi động máy chủ Live Sync, quy trình phát triển cục bộ và các giới hạn), xem [tài liệu Live Sync](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/live-sync.md).
|
|
252
404
|
|
|
405
|
+
## Tự Hosting
|
|
406
|
+
|
|
407
|
+
Intlayer có thể chạy hoàn toàn trên cơ sở hạ tầng của riêng bạn. Một lệnh duy nhất khởi động toàn bộ stack (dashboard, API, database, object storage, và email) với Docker Compose:
|
|
408
|
+
|
|
409
|
+
```sh
|
|
410
|
+
curl -fsSL https://intlayer.org/install.sh | sh
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
Để biết hướng dẫn thiết lập hoàn chỉnh, tham khảo biến môi trường, hướng dẫn nâng cấp và các thủ tục sao lưu/khôi phục, hãy xem [Hướng dẫn Tự Hosting](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/self_hosting.md).
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
253
417
|
## Gỡ lỗi
|
|
254
418
|
|
|
255
419
|
Nếu bạn gặp bất kỳ vấn đề nào với CMS, hãy kiểm tra các điều sau:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-04-18
|
|
3
3
|
updatedAt: 2026-05-31
|
|
4
|
-
title: "Angular
|
|
5
|
-
description: "Không còn i18next nữa. Hướng dẫn 2026 để xây dựng ứng dụng Angular
|
|
4
|
+
title: "Angular 22 i18n - Hướng dẫn đầy đủ để dịch ứng dụng của bạn"
|
|
5
|
+
description: "Không còn i18next nữa. Hướng dẫn 2026 để xây dựng ứng dụng Angular 22 đa ngôn ngữ (i18n). Dịch với các AI agent và tối ưu hóa kích thước bundle, SEO và hiệu suất."
|
|
6
6
|
keywords:
|
|
7
7
|
- Quốc tế hóa
|
|
8
8
|
- Tài liệu
|
|
@@ -13,8 +13,8 @@ slugs:
|
|
|
13
13
|
- doc
|
|
14
14
|
- environment
|
|
15
15
|
- angular
|
|
16
|
-
applicationTemplate: https://github.com/aymericzip/intlayer-angular-
|
|
17
|
-
applicationShowcase: https://intlayer-angular-
|
|
16
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-angular-22-template
|
|
17
|
+
applicationShowcase: https://intlayer-angular-22-template.vercel.app/
|
|
18
18
|
history:
|
|
19
19
|
- version: 8.9.0
|
|
20
20
|
date: 2026-05-04
|
|
@@ -31,7 +31,7 @@ history:
|
|
|
31
31
|
author: aymericzip
|
|
32
32
|
---
|
|
33
33
|
|
|
34
|
-
# Dịch trang web Angular
|
|
34
|
+
# Dịch trang web Angular 22 (Vite) của bạn bằng Intlayer | Quốc tế hóa (i18n)
|
|
35
35
|
|
|
36
36
|
## Mục lục
|
|
37
37
|
|
|
@@ -94,7 +94,7 @@ Không chỉ là giải pháp i18n, Intlayer còn cung cấp **[trình chỉnh s
|
|
|
94
94
|
<Tab label="Mã" value="code">
|
|
95
95
|
|
|
96
96
|
<iframe
|
|
97
|
-
src="https://ide.intlayer.org/aymericzip/intlayer-angular-
|
|
97
|
+
src="https://ide.intlayer.org/aymericzip/intlayer-angular-22-template?file=intlayer.config.ts"
|
|
98
98
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
99
99
|
title="Demo CodeSandbox - Cách quốc tế hóa ứng dụng của bạn bằng Intlayer"
|
|
100
100
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
@@ -105,7 +105,7 @@ Không chỉ là giải pháp i18n, Intlayer còn cung cấp **[trình chỉnh s
|
|
|
105
105
|
<Tab label="Demo" value="demo">
|
|
106
106
|
|
|
107
107
|
<iframe
|
|
108
|
-
src="https://intlayer-angular-
|
|
108
|
+
src="https://intlayer-angular-22-template.vercel.app/"
|
|
109
109
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
110
110
|
title="Demo - intlayer-angular-template"
|
|
111
111
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
@@ -115,7 +115,7 @@ Không chỉ là giải pháp i18n, Intlayer còn cung cấp **[trình chỉnh s
|
|
|
115
115
|
</Tab>
|
|
116
116
|
</Tabs>
|
|
117
117
|
|
|
118
|
-
Xem [Mẫu Ứng Dụng](https://github.com/aymericzip/intlayer-angular-
|
|
118
|
+
Xem [Mẫu Ứng Dụng](https://github.com/aymericzip/intlayer-angular-22-template) trên GitHub.
|
|
119
119
|
|
|
120
120
|
<Steps>
|
|
121
121
|
|
|
@@ -203,7 +203,7 @@ export default config;
|
|
|
203
203
|
|
|
204
204
|
<Step number={3} title="Tích hợp Intlayer vào Cấu hình Angular của bạn">
|
|
205
205
|
|
|
206
|
-
Để tích hợp Intlayer với Angular CLI, bạn cần sử dụng một builder tùy chỉnh. Hướng dẫn này giả định bạn đang sử dụng Vite/esbuild (mặc định cho các dự án Angular
|
|
206
|
+
Để tích hợp Intlayer với Angular CLI, bạn cần sử dụng một builder tùy chỉnh. Hướng dẫn này giả định bạn đang sử dụng Vite/esbuild (mặc định cho các dự án Angular 22).
|
|
207
207
|
|
|
208
208
|
Trước tiên, sửa đổi tập tin `angular.json` của bạn để sử dụng builder esbuild tùy chỉnh. Cập nhật cấu hình `build` và `serve`:
|
|
209
209
|
|
|
@@ -44,31 +44,6 @@ author: aymericzip
|
|
|
44
44
|
|
|
45
45
|
# Dịch trang web Next.js 14 và App Router của bạn bằng Intlayer | Quốc tế hóa (i18n)
|
|
46
46
|
|
|
47
|
-
<Tabs defaultTab="code">
|
|
48
|
-
<Tab label="Mã nguồn" value="code">
|
|
49
|
-
|
|
50
|
-
<iframe
|
|
51
|
-
src="https://ide.intlayer.org/aymericzip/intlayer-next-14-template?file=intlayer.config.ts"
|
|
52
|
-
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
53
|
-
title="Demo CodeSandbox - Cách quốc tế hóa ứng dụng của bạn bằng Intlayer"
|
|
54
|
-
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
55
|
-
loading="lazy"
|
|
56
|
-
/>
|
|
57
|
-
|
|
58
|
-
</Tab>
|
|
59
|
-
<Tab label="Bản demo" value="demo">
|
|
60
|
-
|
|
61
|
-
<iframe
|
|
62
|
-
src="https://intlayer-next-14-template.vercel.app"
|
|
63
|
-
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
64
|
-
title="Bản demo - intlayer-next-14-template"
|
|
65
|
-
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
66
|
-
loading="lazy"
|
|
67
|
-
/>
|
|
68
|
-
|
|
69
|
-
</Tab>
|
|
70
|
-
</Tabs>
|
|
71
|
-
|
|
72
47
|
## Mục lục
|
|
73
48
|
|
|
74
49
|
<TOC/>
|
|
@@ -101,7 +101,7 @@ Không chỉ là giải pháp i18n, Intlayer còn cung cấp **[trình chỉnh s
|
|
|
101
101
|
|
|
102
102
|
<Tabs defaultTab="video">
|
|
103
103
|
<Tab label="Video" value="video">
|
|
104
|
-
|
|
104
|
+
|
|
105
105
|
<iframe title="How to translate an 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&origin=https://intlayer.org&controls=0&rel=1"/>
|
|
106
106
|
|
|
107
107
|
</Tab>
|
|
@@ -189,6 +189,75 @@ export default [
|
|
|
189
189
|
|
|
190
190
|
Thiết lập root layout và các layout theo ngôn ngữ cụ thể:
|
|
191
191
|
|
|
192
|
+
#### Cấu trúc File
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
app/
|
|
196
|
+
├── root.tsx # Layout wrapper for locale routes
|
|
197
|
+
└──routes/
|
|
198
|
+
├── ($locale)._index.tsx # Home page (/, /es, etc.)
|
|
199
|
+
├── ($locale)._index.content.ts # Home page content
|
|
200
|
+
├── ($locale).about.tsx # About page (/about, /es/about, etc.)
|
|
201
|
+
└── ($locale).about.content.ts # About page content
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Các quy ước đặt tên:
|
|
205
|
+
|
|
206
|
+
- `($locale)` - Optional dynamic segment cho locale parameter
|
|
207
|
+
- `_layout` - Layout route bao bọc các child routes
|
|
208
|
+
- `_index` - Index route (renders tại parent path)
|
|
209
|
+
- `.` (dot) - Separates path segments (e.g., `($locale).about` → `/:locale?/about`)
|
|
210
|
+
|
|
211
|
+
#### Thành phần Layout
|
|
212
|
+
|
|
213
|
+
```tsx fileName="app/root.tsx"
|
|
214
|
+
import { getLocaleFromPath } from "intlayer";
|
|
215
|
+
import { IntlayerProvider } from "react-intlayer";
|
|
216
|
+
import {
|
|
217
|
+
isRouteErrorResponse,
|
|
218
|
+
Meta,
|
|
219
|
+
Outlet,
|
|
220
|
+
Scripts,
|
|
221
|
+
ScrollRestoration,
|
|
222
|
+
useLoaderData,
|
|
223
|
+
} from "react-router";
|
|
224
|
+
|
|
225
|
+
import type { Route } from "./+types/root";
|
|
226
|
+
|
|
227
|
+
import "./app.css";
|
|
228
|
+
|
|
229
|
+
// ... Mã App, links và ErrorBoundary không thay đổi
|
|
230
|
+
|
|
231
|
+
export async function loader({ request }: Route.LoaderArgs) {
|
|
232
|
+
const locale = getLocaleFromPath(request.url);
|
|
233
|
+
|
|
234
|
+
return { locale };
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export function Layout({
|
|
238
|
+
children,
|
|
239
|
+
}: { children: React.ReactNode } & Route.ComponentProps) {
|
|
240
|
+
const data = useLoaderData<typeof loader>();
|
|
241
|
+
const { locale } = data ?? {};
|
|
242
|
+
|
|
243
|
+
return (
|
|
244
|
+
<html lang={locale}>
|
|
245
|
+
<head>
|
|
246
|
+
<meta charSet="utf-8" />
|
|
247
|
+
<meta content="width=device-width, initial-scale=1" name="viewport" />
|
|
248
|
+
<Meta />
|
|
249
|
+
<Links />
|
|
250
|
+
</head>
|
|
251
|
+
<body>
|
|
252
|
+
<IntlayerProvider locale={locale}>{children}</IntlayerProvider>
|
|
253
|
+
<ScrollRestoration />
|
|
254
|
+
<Scripts />
|
|
255
|
+
</body>
|
|
256
|
+
</html>
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
192
261
|
#### Root Layout
|
|
193
262
|
|
|
194
263
|
```tsx fileName="app/routes/layout.tsx"
|
|
@@ -571,68 +640,6 @@ Ensure your TypeScript configuration includes the autogenerated types:
|
|
|
571
640
|
|
|
572
641
|
---
|
|
573
642
|
|
|
574
|
-
## Documentation References
|
|
575
|
-
|
|
576
|
-
- [Intlayer Documentation](https://intlayer.org)
|
|
577
|
-
- [React Router v7 Documentation](https://reactrouter.com/)
|
|
578
|
-
- [React Router fs-routes Documentation](https://reactrouter.com/how-to/file-route-conventions)
|
|
579
|
-
- [useIntlayer hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useIntlayer.md)
|
|
580
|
-
- [useLocale hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useLocale.md)
|
|
581
|
-
- [Content Declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md)
|
|
582
|
-
- [Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md)
|
|
583
|
-
|
|
584
|
-
This comprehensive guide provides everything you need to integrate Intlayer with React Router v7 using file-system based routing for a fully internationalized application with locale-aware routing and TypeScript support.
|
|
585
|
-
|
|
586
|
-
<Steps>
|
|
587
|
-
|
|
588
|
-
<Step number={11} title="Thêm middleware">
|
|
589
|
-
|
|
590
|
-
Bạn cũng có thể sử dụng `intlayerProxy` để thêm routing phía server cho ứng dụng của bạn. Plugin này sẽ tự động phát hiện locale hiện tại dựa trên URL và thiết lập cookie locale phù hợp. Nếu không có locale nào được chỉ định, plugin sẽ xác định locale phù hợp nhất dựa trên ngôn ngữ trình duyệt của người dùng. Nếu không phát hiện được locale nào, nó sẽ chuyển hướng đến locale mặc định.
|
|
591
|
-
|
|
592
|
-
> Lưu ý rằng để sử dụng `intlayerProxy` trong môi trường production, bạn cần chuyển gói `vite-intlayer` từ `devDependencies` sang `dependencies`.
|
|
593
|
-
|
|
594
|
-
```typescript {3,7} fileName="vite.config.ts"
|
|
595
|
-
import { reactRouter } from "@react-router/dev/vite";
|
|
596
|
-
import { defineConfig } from "vite";
|
|
597
|
-
import { intlayer } from "vite-intlayer";
|
|
598
|
-
|
|
599
|
-
export default defineConfig({
|
|
600
|
-
plugins: [
|
|
601
|
-
reactRouter(),
|
|
602
|
-
|
|
603
|
-
intlayer({
|
|
604
|
-
proxy: {
|
|
605
|
-
ignore: (req) => req.url?.startsWith("/api"),
|
|
606
|
-
},
|
|
607
|
-
}),
|
|
608
|
-
],
|
|
609
|
-
});
|
|
610
|
-
```
|
|
611
|
-
|
|
612
|
-
---
|
|
613
|
-
|
|
614
|
-
</Step>
|
|
615
|
-
|
|
616
|
-
</Steps>
|
|
617
|
-
|
|
618
|
-
## Cấu hình TypeScript
|
|
619
|
-
|
|
620
|
-
Intlayer sử dụng module augmentation để tận dụng các lợi ích của TypeScript và làm cho codebase của bạn mạnh mẽ hơn.
|
|
621
|
-
|
|
622
|
-
Đảm bảo cấu hình TypeScript của bạn bao gồm các kiểu được tạo tự động:
|
|
623
|
-
|
|
624
|
-
```json5 fileName="tsconfig.json"
|
|
625
|
-
{
|
|
626
|
-
// ... các cấu hình hiện có của bạn
|
|
627
|
-
include: [
|
|
628
|
-
// ... các phần include hiện có của bạn
|
|
629
|
-
".intlayer/**/*.ts", // Bao gồm các kiểu được tạo tự động
|
|
630
|
-
],
|
|
631
|
-
}
|
|
632
|
-
```
|
|
633
|
-
|
|
634
|
-
---
|
|
635
|
-
|
|
636
643
|
## Cấu hình Git
|
|
637
644
|
|
|
638
645
|
Khuyến nghị bỏ qua các tệp được tạo bởi Intlayer. Điều này giúp bạn tránh việc commit chúng vào kho Git của mình.
|