@intlayer/docs 9.1.3 → 9.3.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/index.md +1 -1
- package/blog/ar/rag_powered_documentation_assistant.md +7 -0
- package/blog/de/index.md +1 -1
- package/blog/de/rag_powered_documentation_assistant.md +6 -0
- package/blog/en/index.md +1 -1
- package/blog/en-GB/index.md +1 -1
- package/blog/en-GB/rag_powered_documentation_assistant.md +6 -0
- package/blog/es/index.md +1 -1
- package/blog/es/rag_powered_documentation_assistant.md +7 -0
- package/blog/fr/i18n_meaning.md +7 -1
- package/blog/fr/index.md +1 -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/index.md +1 -1
- 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/index.md +1 -1
- package/blog/id/rag_powered_documentation_assistant.md +6 -0
- package/blog/it/index.md +1 -1
- package/blog/it/rag_powered_documentation_assistant.md +6 -0
- package/blog/ja/index.md +1 -1
- package/blog/ja/rag_powered_documentation_assistant.md +7 -0
- package/blog/ko/index.md +1 -1
- package/blog/ko/list_i18n_technologies/frameworks/react.md +7 -7
- package/blog/ko/rag_powered_documentation_assistant.md +6 -0
- package/blog/pl/index.md +1 -1
- package/blog/pl/rag_powered_documentation_assistant.md +6 -0
- package/blog/pt/index.md +1 -1
- package/blog/pt/rag_powered_documentation_assistant.md +6 -0
- package/blog/ru/index.md +1 -1
- 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/index.md +1 -1
- package/blog/uk/rag_powered_documentation_assistant.md +6 -0
- package/blog/vi/index.md +1 -1
- package/blog/vi/rag_powered_documentation_assistant.md +6 -0
- package/blog/zh/index.md +1 -1
- 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/common.cjs +24 -1
- package/dist/cjs/common.cjs.map +1 -1
- package/dist/cjs/generated/blog.entry.cjs +58 -31
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +265 -218
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +48 -21
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +33 -6
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/esm/common.mjs +24 -1
- package/dist/esm/common.mjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +58 -31
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +265 -218
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/esm/generated/frequentQuestions.entry.mjs +48 -21
- package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
- package/dist/esm/generated/legal.entry.mjs +33 -6
- package/dist/esm/generated/legal.entry.mjs.map +1 -1
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/generated/blog.entry.d.ts.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/dist/types/generated/frequentQuestions.entry.d.ts.map +1 -1
- package/dist/types/generated/legal.entry.d.ts.map +1 -1
- package/docs/ar/analytics.md +222 -0
- package/docs/ar/autoFill.md +28 -9
- package/docs/ar/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -0
- 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/bundle_optimization.md +58 -25
- package/docs/bn/configuration.md +25 -8
- package/docs/bn/intlayer_with_angular_21.md +9 -9
- package/docs/cs/bundle_optimization.md +58 -25
- 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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -0
- 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/bundle_optimization.md +51 -23
- 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/live-sync.md +4 -0
- package/docs/en-GB/analytics.md +222 -0
- package/docs/en-GB/autoFill.md +26 -7
- package/docs/en-GB/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -0
- 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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -0
- 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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -0
- 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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -0
- 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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -0
- 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/bundle_optimization.md +58 -25
- 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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -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/bundle_optimization.md +58 -24
- 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/live-sync.md +4 -0
- 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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -0
- 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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -0
- 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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -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/bundle_optimization.md +58 -25
- 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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -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/bundle_optimization.md +58 -25
- 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/live-sync.md +4 -0
- 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/bundle_optimization.md +58 -25
- package/docs/zh-TW/intlayer_with_angular_21.md +7 -7
- package/package.json +7 -7
- package/src/common.ts +39 -2
- package/src/generated/blog.entry.ts +66 -34
- package/src/generated/docs.entry.ts +273 -221
- package/src/generated/frequentQuestions.entry.ts +56 -24
- package/src/generated/legal.entry.ts +41 -9
package/docs/en-GB/formatters.md
CHANGED
|
@@ -46,34 +46,6 @@ author: aymericzip
|
|
|
46
46
|
|
|
47
47
|
Intlayer provides a set of lightweight helpers built on top of the native `Intl` APIs, plus a cached `Intl` wrapper to avoid repeatedly constructing heavy formatters. These utilities are fully locale-aware and can be used from the main `intlayer` package.
|
|
48
48
|
|
|
49
|
-
### Import
|
|
50
|
-
|
|
51
|
-
```ts
|
|
52
|
-
import {
|
|
53
|
-
Intl,
|
|
54
|
-
number,
|
|
55
|
-
percentage,
|
|
56
|
-
currency,
|
|
57
|
-
date,
|
|
58
|
-
relativeTime,
|
|
59
|
-
units,
|
|
60
|
-
compact,
|
|
61
|
-
list,
|
|
62
|
-
getLocaleName,
|
|
63
|
-
getLocaleLang,
|
|
64
|
-
getLocaleFromPath,
|
|
65
|
-
getPathWithoutLocale,
|
|
66
|
-
getLocalizedUrl,
|
|
67
|
-
getHTMLTextDir,
|
|
68
|
-
getContent,
|
|
69
|
-
getTranslation,
|
|
70
|
-
getIntlayer,
|
|
71
|
-
getIntlayerAsync,
|
|
72
|
-
} from "intlayer";
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
If you are using React, hooks are also available; see `react-intlayer/format`.
|
|
76
|
-
|
|
77
49
|
## Cached Intl
|
|
78
50
|
|
|
79
51
|
The exported `Intl` is a thin, cached wrapper around the global `Intl`. It memoises instances of `NumberFormat`, `DateTimeFormat`, `RelativeTimeFormat`, `ListFormat`, `DisplayNames`, `Collator`, and `PluralRules`, which avoids rebuilding the same formatter repeatedly.
|
|
@@ -110,86 +82,8 @@ pluralRules.select(1); // "one"
|
|
|
110
82
|
pluralRules.select(2); // "other"
|
|
111
83
|
```
|
|
112
84
|
|
|
113
|
-
## Additional Intl Utilities
|
|
114
|
-
|
|
115
|
-
Beyond the formatter helpers, you can also use the cached Intl wrapper directly for other Intl features:
|
|
116
|
-
|
|
117
|
-
### `Intl.DisplayNames`
|
|
118
|
-
|
|
119
|
-
For localised names of languages, regions, currencies, and scripts:
|
|
120
|
-
|
|
121
|
-
```ts
|
|
122
|
-
import { Intl } from "intlayer";
|
|
123
|
-
|
|
124
|
-
const languageNames = new Intl.DisplayNames("en", { type: "language" });
|
|
125
|
-
languageNames.of("fr"); // "French"
|
|
126
|
-
|
|
127
|
-
const regionNames = new Intl.DisplayNames("fr", { type: "region" });
|
|
128
|
-
regionNames.of("US"); // "États-Unis"
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### `Intl.Collator`
|
|
132
|
-
|
|
133
|
-
For locale-aware string comparison and sorting:
|
|
134
|
-
|
|
135
|
-
```ts
|
|
136
|
-
import { Intl } from "intlayer";
|
|
137
|
-
|
|
138
|
-
const collator = new Intl.Collator("de", {
|
|
139
|
-
sensitivity: "base",
|
|
140
|
-
numeric: true,
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
const words = ["äpfel", "zebra", "100", "20"];
|
|
144
|
-
words.sort(collator.compare); // ["20", "100", "äpfel", "zebra"]
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### `Intl.PluralRules`
|
|
148
|
-
|
|
149
|
-
For determining plural forms in different locales:
|
|
150
|
-
|
|
151
|
-
```ts
|
|
152
|
-
import { Intl } from "intlayer";
|
|
153
|
-
|
|
154
|
-
const pluralRules = new Intl.PluralRules("ar");
|
|
155
|
-
pluralRules.select(0); // "zero"
|
|
156
|
-
pluralRules.select(1); // "one"
|
|
157
|
-
pluralRules.select(2); // "two"
|
|
158
|
-
pluralRules.select(3); // "few"
|
|
159
|
-
pluralRules.select(11); // "many"
|
|
160
|
-
```
|
|
161
|
-
|
|
162
85
|
## Locale Utilities
|
|
163
86
|
|
|
164
|
-
### `getLocaleName(displayLocale, targetLocale?)`
|
|
165
|
-
|
|
166
|
-
Gets the localised name of a locale in another locale:
|
|
167
|
-
|
|
168
|
-
```ts
|
|
169
|
-
import { getLocaleName } from "intlayer";
|
|
170
|
-
|
|
171
|
-
getLocaleName("fr", "en"); // "French"
|
|
172
|
-
getLocaleName("en", "fr"); // "anglais"
|
|
173
|
-
getLocaleName("de", "es"); // "alemán"
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
- **displayLocale**: The locale to get the name for
|
|
177
|
-
- **targetLocale**: The locale to display the name in (defaults to displayLocale)
|
|
178
|
-
|
|
179
|
-
### `getLocaleLang(locale?)`
|
|
180
|
-
|
|
181
|
-
Extracts the language code from a locale string:
|
|
182
|
-
|
|
183
|
-
```ts
|
|
184
|
-
import { getLocaleLang } from "intlayer";
|
|
185
|
-
|
|
186
|
-
getLocaleLang("en-US"); // "en"
|
|
187
|
-
getLocaleLang("fr-CA"); // "fr"
|
|
188
|
-
getLocaleLang("de"); // "de"
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
- **locale**: The locale to extract the language from (defaults to current locale)
|
|
192
|
-
|
|
193
87
|
### `getLocaleFromPath(inputUrl)`
|
|
194
88
|
|
|
195
89
|
Extracts the locale segment from a URL or pathname:
|
|
@@ -330,9 +224,11 @@ const content = await getIntlayerAsync("common", "fr");
|
|
|
330
224
|
|
|
331
225
|
All helpers below are exported from `intlayer`.
|
|
332
226
|
|
|
333
|
-
### `
|
|
227
|
+
### `percentage(value, options?)`
|
|
334
228
|
|
|
335
|
-
Formats a
|
|
229
|
+
Formats a number as a percentage string.
|
|
230
|
+
|
|
231
|
+
Behaviour: values greater than 1 are interpreted as whole percentages and normalised (e.g., `25` → `25%`, `0.25` → `25%`).
|
|
336
232
|
|
|
337
233
|
- **value**: `number | string`
|
|
338
234
|
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
@@ -340,83 +236,75 @@ Formats a numeric value using locale-aware grouping and decimals.
|
|
|
340
236
|
Examples:
|
|
341
237
|
|
|
342
238
|
```ts
|
|
343
|
-
import {
|
|
239
|
+
import { percentage } from "intlayer";
|
|
240
|
+
|
|
241
|
+
percentage(0.25); // "25%"
|
|
242
|
+
percentage(25); // "25%"
|
|
243
|
+
percentage(0.237, { minimumFractionDigits: 1 }); // "23.7%"
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Additional Intl Features
|
|
247
|
+
|
|
248
|
+
#### `number(value, options?)`
|
|
249
|
+
|
|
250
|
+
Formats a numeric value using locale-aware grouping and decimals.
|
|
251
|
+
|
|
252
|
+
- **value**: `number | string`
|
|
253
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
344
254
|
|
|
255
|
+
```ts
|
|
345
256
|
number(123456.789); // "123,456.789" (in en-US)
|
|
346
257
|
number("1000000", { locale: "fr" }); // "1 000 000"
|
|
347
258
|
number(1234.5, { minimumFractionDigits: 2 }); // "1,234.50"
|
|
348
259
|
```
|
|
349
260
|
|
|
350
|
-
|
|
261
|
+
#### `percentage(value, options?)`
|
|
351
262
|
|
|
352
|
-
Formats a number as a percentage string.
|
|
353
|
-
|
|
354
|
-
Behaviour: values greater than 1 are interpreted as whole percentages and normalised (e.g., `25` → `25%`, `0.25` → `25%`).
|
|
263
|
+
Formats a number as a percentage string. Values greater than 1 are normalised (e.g., `25` → `25%`, `0.25` → `25%`).
|
|
355
264
|
|
|
356
265
|
- **value**: `number | string`
|
|
357
266
|
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
358
267
|
|
|
359
|
-
Examples:
|
|
360
|
-
|
|
361
268
|
```ts
|
|
362
|
-
import { percentage } from "intlayer";
|
|
363
|
-
|
|
364
269
|
percentage(0.25); // "25%"
|
|
365
270
|
percentage(25); // "25%"
|
|
366
271
|
percentage(0.237, { minimumFractionDigits: 1 }); // "23.7%"
|
|
367
272
|
```
|
|
368
273
|
|
|
369
|
-
|
|
274
|
+
#### `currency(value, options?)`
|
|
370
275
|
|
|
371
|
-
Formats a value as localised currency. Defaults to `USD
|
|
276
|
+
Formats a value as localised currency. Defaults to `USD`.
|
|
372
277
|
|
|
373
278
|
- **value**: `number | string`
|
|
374
279
|
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
375
|
-
- Common
|
|
376
|
-
|
|
377
|
-
Examples:
|
|
280
|
+
- Common: `currency`, `currencyDisplay` (`"symbol" | "code" | "name"`)
|
|
378
281
|
|
|
379
282
|
```ts
|
|
380
|
-
import { currency } from "intlayer";
|
|
381
|
-
|
|
382
283
|
currency(1234.5, { currency: "EUR" }); // "€1,234.50"
|
|
383
284
|
currency("5000", { locale: "fr", currency: "CAD", currencyDisplay: "code" }); // "5 000,00 CAD"
|
|
384
285
|
```
|
|
385
286
|
|
|
386
|
-
|
|
287
|
+
#### `date(date, optionsOrPreset?)`
|
|
387
288
|
|
|
388
|
-
Formats a date/time value
|
|
289
|
+
Formats a date/time value.
|
|
389
290
|
|
|
390
291
|
- **date**: `Date | string | number`
|
|
391
|
-
- **optionsOrPreset**: `Intl.DateTimeFormatOptions & { locale?: LocalesValues }` or
|
|
392
|
-
- Presets: `"short" | "long" | "dateOnly" | "timeOnly" | "full"`
|
|
393
|
-
|
|
394
|
-
Examples:
|
|
292
|
+
- **optionsOrPreset**: `Intl.DateTimeFormatOptions & { locale?: LocalesValues }` or preset: `"short" | "long" | "dateOnly" | "timeOnly" | "full"`
|
|
395
293
|
|
|
396
294
|
```ts
|
|
397
|
-
import { date } from "intlayer";
|
|
398
|
-
|
|
399
295
|
date(new Date(), "short"); // e.g., "08/02/25, 14:30"
|
|
400
296
|
date("2025-08-02T14:30:00Z", { locale: "fr", month: "long", day: "numeric" }); // "2 août"
|
|
401
297
|
```
|
|
402
298
|
|
|
403
|
-
|
|
299
|
+
#### `relativeTime(from, to?, options?)`
|
|
404
300
|
|
|
405
|
-
|
|
301
|
+
Formats relative time between two instants.
|
|
406
302
|
|
|
407
|
-
Formats relative time between two instants with `Intl.RelativeTimeFormat`.
|
|
408
|
-
|
|
409
|
-
- Pass "now" as the first argument and the target as the second to get natural phrasing.
|
|
410
303
|
- **from**: `Date | string | number`
|
|
411
304
|
- **to**: `Date | string | number` (defaults to `new Date()`)
|
|
412
|
-
- **options**: `{ locale
|
|
413
|
-
- Default `unit` is `"second"`.
|
|
414
|
-
|
|
415
|
-
Examples:
|
|
305
|
+
- **options**: `{ locale?, unit?, numeric?, style? }`
|
|
416
306
|
|
|
417
307
|
```ts
|
|
418
|
-
import { relativeTime } from "intlayer";
|
|
419
|
-
|
|
420
308
|
const now = new Date();
|
|
421
309
|
const in3Days = new Date(now.getTime() + 3 * 864e5);
|
|
422
310
|
relativeTime(now, in3Days, { unit: "day" }); // "in 3 days"
|
|
@@ -425,6 +313,121 @@ const twoHoursAgo = new Date(now.getTime() - 2 * 3600e3);
|
|
|
425
313
|
relativeTime(now, twoHoursAgo, { unit: "hour", numeric: "auto" }); // "2 hours ago"
|
|
426
314
|
```
|
|
427
315
|
|
|
316
|
+
#### `units(value, options?)`
|
|
317
|
+
|
|
318
|
+
Formats a numeric value with a unit.
|
|
319
|
+
|
|
320
|
+
- **value**: `number | string`
|
|
321
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
322
|
+
- Common: `unit` (e.g., `"kilometer"`, `"byte"`), `unitDisplay` (`"short" | "narrow" | "long"`)
|
|
323
|
+
|
|
324
|
+
```ts
|
|
325
|
+
units(5, { unit: "kilometer", unitDisplay: "long", locale: "en-GB" }); // "5 kilometres"
|
|
326
|
+
units(1024, { unit: "byte", unitDisplay: "narrow" }); // "1,024B"
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
#### `compact(value, options?)`
|
|
330
|
+
|
|
331
|
+
Formats a number using compact notation.
|
|
332
|
+
|
|
333
|
+
- **value**: `number | string`
|
|
334
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
335
|
+
|
|
336
|
+
```ts
|
|
337
|
+
compact(1200); // "1.2K"
|
|
338
|
+
compact("1000000", { locale: "fr", compactDisplay: "long" }); // "1 million"
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
#### `list(values, options?)`
|
|
342
|
+
|
|
343
|
+
Formats an array into a localised list string.
|
|
344
|
+
|
|
345
|
+
- **values**: `(string | number)[]`
|
|
346
|
+
- **options**: `Intl.ListFormatOptions & { locale?: LocalesValues }`
|
|
347
|
+
- Common: `type` (`"conjunction" | "disjunction" | "unit"`), `style` (`"long" | "short" | "narrow"`)
|
|
348
|
+
|
|
349
|
+
```ts
|
|
350
|
+
list(["apple", "banana", "orange"]); // "apple, banana, and orange"
|
|
351
|
+
list(["red", "green", "blue"], { locale: "fr", type: "disjunction" }); // "rouge, vert ou bleu"
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
## Cached Intl
|
|
355
|
+
|
|
356
|
+
The exported `Intl` from `intlayer` is a cached wrapper around the global `Intl`. It memoizes formatter instances (`NumberFormat`, `DateTimeFormat`, etc.) to avoid repeatedly constructing them, improving performance.
|
|
357
|
+
|
|
358
|
+
```ts
|
|
359
|
+
import { Intl } from "intlayer";
|
|
360
|
+
|
|
361
|
+
// Number formatting
|
|
362
|
+
const numberFormat = new Intl.NumberFormat("en-GB", {
|
|
363
|
+
style: "currency",
|
|
364
|
+
currency: "GBP",
|
|
365
|
+
});
|
|
366
|
+
numberFormat.format(1234.5); // "£1,234.50"
|
|
367
|
+
|
|
368
|
+
// Display names for languages, regions, etc.
|
|
369
|
+
const displayNames = new Intl.DisplayNames("fr", { type: "language" });
|
|
370
|
+
displayNames.of("en"); // "anglais"
|
|
371
|
+
|
|
372
|
+
// Collation for sorting
|
|
373
|
+
const collator = new Intl.Collator("fr", { sensitivity: "base" });
|
|
374
|
+
collator.compare("é", "e"); // 0 (equal)
|
|
375
|
+
|
|
376
|
+
// Plural rules
|
|
377
|
+
const pluralRules = new Intl.PluralRules("fr");
|
|
378
|
+
pluralRules.select(1); // "one"
|
|
379
|
+
pluralRules.select(2); // "other"
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Additional Intl Features
|
|
383
|
+
|
|
384
|
+
#### `Intl.DisplayNames`
|
|
385
|
+
|
|
386
|
+
For localised names of languages, regions, currencies, and scripts:
|
|
387
|
+
|
|
388
|
+
```ts
|
|
389
|
+
import { Intl } from "intlayer";
|
|
390
|
+
|
|
391
|
+
const languageNames = new Intl.DisplayNames("en", { type: "language" });
|
|
392
|
+
languageNames.of("fr"); // "French"
|
|
393
|
+
|
|
394
|
+
const regionNames = new Intl.DisplayNames("fr", { type: "region" });
|
|
395
|
+
regionNames.of("US"); // "États-Unis"
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
#### `Intl.Collator`
|
|
399
|
+
|
|
400
|
+
For locale-aware string comparison and sorting:
|
|
401
|
+
|
|
402
|
+
```ts
|
|
403
|
+
import { Intl } from "intlayer";
|
|
404
|
+
|
|
405
|
+
const collator = new Intl.Collator("de", {
|
|
406
|
+
sensitivity: "base",
|
|
407
|
+
numeric: true,
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
const words = ["äpfel", "zebra", "100", "20"];
|
|
411
|
+
words.sort(collator.compare); // ["20", "100", "äpfel", "zebra"]
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
#### `Intl.PluralRules`
|
|
415
|
+
|
|
416
|
+
For determining plural forms in different locales:
|
|
417
|
+
|
|
418
|
+
```ts
|
|
419
|
+
import { Intl } from "intlayer";
|
|
420
|
+
|
|
421
|
+
const pluralRules = new Intl.PluralRules("ar");
|
|
422
|
+
pluralRules.select(0); // "zero"
|
|
423
|
+
pluralRules.select(1); // "one"
|
|
424
|
+
pluralRules.select(2); // "two"
|
|
425
|
+
pluralRules.select(3); // "few"
|
|
426
|
+
pluralRules.select(11); // "many"
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
## Locale Utilities
|
|
430
|
+
|
|
428
431
|
### `units(value, options?)`
|
|
429
432
|
|
|
430
433
|
Formats a numeric value as a localised unit string using `Intl.NumberFormat` with `style: 'unit'`.
|
|
@@ -459,8 +462,6 @@ compact(1200); // "1.2K"
|
|
|
459
462
|
compact("1000000", { locale: "fr", compactDisplay: "long" }); // "1 million"
|
|
460
463
|
```
|
|
461
464
|
|
|
462
|
-
## Locale Utilities
|
|
463
|
-
|
|
464
465
|
### `list(values, options?)`
|
|
465
466
|
|
|
466
467
|
Formats an array of values into a localised list string using `Intl.ListFormat`.
|
|
@@ -491,42 +492,6 @@ getLocaleLang("en-US"); // "en"
|
|
|
491
492
|
getLocaleLang("fr-CA"); // "fr"
|
|
492
493
|
```
|
|
493
494
|
|
|
494
|
-
## Notes
|
|
495
|
-
|
|
496
|
-
- All helpers accept `string` inputs; they are internally coerced to numbers or dates.
|
|
497
|
-
- Locale defaults to your configured `internationalization.defaultLocale` if not provided.
|
|
498
|
-
- These utilities are thin wrappers; for advanced formatting, pass through the standard `Intl` options.
|
|
499
|
-
|
|
500
|
-
## Entry points and re-exports (`@index.ts`)
|
|
501
|
-
|
|
502
|
-
The formatters reside in the core package and are re-exported from higher-level packages to keep imports ergonomic across runtimes:
|
|
503
|
-
|
|
504
|
-
Examples:
|
|
505
|
-
|
|
506
|
-
```ts
|
|
507
|
-
// App code (recommended)
|
|
508
|
-
import {
|
|
509
|
-
number,
|
|
510
|
-
currency,
|
|
511
|
-
date,
|
|
512
|
-
relativeTime,
|
|
513
|
-
units,
|
|
514
|
-
compact,
|
|
515
|
-
list,
|
|
516
|
-
Intl,
|
|
517
|
-
getLocaleName,
|
|
518
|
-
getLocaleLang,
|
|
519
|
-
getLocaleFromPath,
|
|
520
|
-
getPathWithoutLocale,
|
|
521
|
-
getLocalizedUrl,
|
|
522
|
-
getHTMLTextDir,
|
|
523
|
-
getContent,
|
|
524
|
-
getTranslation,
|
|
525
|
-
getIntlayer,
|
|
526
|
-
getIntlayerAsync,
|
|
527
|
-
} from "intlayer";
|
|
528
|
-
```
|
|
529
|
-
|
|
530
495
|
### React
|
|
531
496
|
|
|
532
497
|
Client components:
|
|
@@ -247,6 +247,158 @@ This command uploads your initial content dictionaries, making them available fo
|
|
|
247
247
|
|
|
248
248
|
You will then be able to view and manage your dictionary in the [Intlayer CMS](https://app.intlayer.org/content).
|
|
249
249
|
|
|
250
|
+
## Programmatic access with the `@intlayer/api` SDK
|
|
251
|
+
|
|
252
|
+
Beyond the CLI and the visual editor, Intlayer ships a typed SDK in the [`@intlayer/api`](https://www.npmjs.com/package/@intlayer/api) package. It lets you treat the CMS as a **headless content database**: you can fetch projects, fetch dictionaries, and push or update them directly from your own application, scripts, or CI pipeline.
|
|
253
|
+
|
|
254
|
+
The SDK handles authentication for you. As long as your `clientId` and `clientSecret` are available (in your Intlayer configuration or environment), it obtains and refreshes an OAuth2 access token automatically and signs every request.
|
|
255
|
+
|
|
256
|
+
### Installation
|
|
257
|
+
|
|
258
|
+
```bash packageManager="npm"
|
|
259
|
+
npm install @intlayer/api
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
```bash packageManager="yarn"
|
|
263
|
+
yarn add @intlayer/api
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
```bash packageManager="pnpm"
|
|
267
|
+
pnpm add @intlayer/api
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
```bash packageManager="bun"
|
|
271
|
+
bun add @intlayer/api
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### How it works: authenticator + endpoints
|
|
275
|
+
|
|
276
|
+
The SDK is split into **two separate imports** on purpose, to keep your bundle small:
|
|
277
|
+
|
|
278
|
+
1. `createIntlayerCMS` — creates a lightweight **authenticator**. It only carries the credentials and the managed access token; it knows nothing about any specific domain.
|
|
279
|
+
2. `dictionaryEndpoint`, `projectEndpoint`, … — per-domain **endpoint binders**, each imported from its own subpath (`@intlayer/api/dictionary`, `@intlayer/api/project`, …). You pass the authenticator to the endpoint you need.
|
|
280
|
+
|
|
281
|
+
Because each endpoint is imported separately, your bundle includes only the domains you actually use — importing `dictionaryEndpoint` never pulls in the project, AI, or any other domain client.
|
|
282
|
+
|
|
283
|
+
```typescript fileName="cms.ts" codeFormat="typescript"
|
|
284
|
+
import { createIntlayerCMS } from "@intlayer/api";
|
|
285
|
+
|
|
286
|
+
// The configuration is optional: when omitted, the credentials are read from
|
|
287
|
+
// `@intlayer/config/built`, which resolves the INTLAYER_CLIENT_ID and
|
|
288
|
+
// INTLAYER_CLIENT_SECRET environment variables.
|
|
289
|
+
export const cmsAuthenticator = createIntlayerCMS();
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
> [!WARNING]
|
|
293
|
+
> The CMS credentials (`clientId` / `clientSecret`) grant **write access** to your content. Only ever create the authenticator on the **server side** (server actions, route handlers, scripts, CI). Never import it into client-side code or expose your credentials to the browser.
|
|
294
|
+
|
|
295
|
+
If you prefer not to rely on the build-time configuration, pass the credentials explicitly:
|
|
296
|
+
|
|
297
|
+
```typescript fileName="cms.ts" codeFormat="typescript"
|
|
298
|
+
import { createIntlayerCMS } from "@intlayer/api";
|
|
299
|
+
|
|
300
|
+
export const cmsAuthenticator = createIntlayerCMS({
|
|
301
|
+
editor: {
|
|
302
|
+
clientId: process.env.INTLAYER_CLIENT_ID,
|
|
303
|
+
clientSecret: process.env.INTLAYER_CLIENT_SECRET,
|
|
304
|
+
// Optional, for self-hosted backends:
|
|
305
|
+
// backendURL: process.env.INTLAYER_BACKEND_URL,
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
> Get your credentials by creating a new access key in the [Intlayer Dashboard - Projects](https://app.intlayer.org/projects).
|
|
311
|
+
|
|
312
|
+
### Fetch projects
|
|
313
|
+
|
|
314
|
+
```typescript fileName="projects.ts" codeFormat="typescript"
|
|
315
|
+
import { createIntlayerCMS } from "@intlayer/api";
|
|
316
|
+
import { projectEndpoint } from "@intlayer/api/project";
|
|
317
|
+
|
|
318
|
+
const cmsAuthenticator = createIntlayerCMS();
|
|
319
|
+
|
|
320
|
+
// List the projects accessible with your credentials
|
|
321
|
+
const { data: projects } =
|
|
322
|
+
await projectEndpoint(cmsAuthenticator).getProjects();
|
|
323
|
+
|
|
324
|
+
// Read aggregated localisation insights of the selected project
|
|
325
|
+
const { data: insights } =
|
|
326
|
+
await projectEndpoint(cmsAuthenticator).getProjectInsights();
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Fetch dictionaries
|
|
330
|
+
|
|
331
|
+
```typescript fileName="read-dictionaries.ts" codeFormat="typescript"
|
|
332
|
+
import { createIntlayerCMS } from "@intlayer/api";
|
|
333
|
+
import { dictionaryEndpoint } from "@intlayer/api/dictionary";
|
|
334
|
+
|
|
335
|
+
const cmsAuthenticator = createIntlayerCMS();
|
|
336
|
+
|
|
337
|
+
// List every remote dictionary of the project
|
|
338
|
+
const { data: dictionaries } =
|
|
339
|
+
await dictionaryEndpoint(cmsAuthenticator).getDictionaries();
|
|
340
|
+
|
|
341
|
+
// Or get a single dictionary by key
|
|
342
|
+
const { data: dictionary } = await dictionaryEndpoint(
|
|
343
|
+
cmsAuthenticator
|
|
344
|
+
).getDictionary("my-first-dictionary-key");
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Push and update dictionaries
|
|
348
|
+
|
|
349
|
+
Use the CMS as a database to write content back:
|
|
350
|
+
|
|
351
|
+
```typescript fileName="write-dictionaries.ts" codeFormat="typescript"
|
|
352
|
+
import { createIntlayerCMS } from "@intlayer/api";
|
|
353
|
+
import { dictionaryEndpoint } from "@intlayer/api/dictionary";
|
|
354
|
+
|
|
355
|
+
const cmsAuthenticator = createIntlayerCMS();
|
|
356
|
+
|
|
357
|
+
// Create a new dictionary
|
|
358
|
+
await dictionaryEndpoint(cmsAuthenticator).addDictionary({
|
|
359
|
+
key: "my-first-dictionary-key",
|
|
360
|
+
content: { title: "Hello world" },
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
// Upsert a batch of dictionaries (create or update them in one call)
|
|
364
|
+
await dictionaryEndpoint(cmsAuthenticator).pushDictionaries([
|
|
365
|
+
{ key: "home", content: { title: "Home" } },
|
|
366
|
+
{ key: "about", content: { title: "About" } },
|
|
367
|
+
]);
|
|
368
|
+
|
|
369
|
+
// Update an existing dictionary
|
|
370
|
+
await dictionaryEndpoint(cmsAuthenticator).updateDictionary({
|
|
371
|
+
id: "<dictionary-id>",
|
|
372
|
+
key: "home",
|
|
373
|
+
content: { title: "Updated title" },
|
|
374
|
+
});
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
> Tip: reuse the bound endpoint to avoid repeating yourself:
|
|
378
|
+
>
|
|
379
|
+
> ```typescript codeFormat="typescript"
|
|
380
|
+
> const dictionary = dictionaryEndpoint(cmsAuthenticator);
|
|
381
|
+
> await dictionary.pushDictionaries([myDictionary]);
|
|
382
|
+
> const { data } = await dictionary.getDictionaries();
|
|
383
|
+
> ```
|
|
384
|
+
|
|
385
|
+
### Extracting a single method
|
|
386
|
+
|
|
387
|
+
Every endpoint method is already authenticated and standalone (it carries its own token handling), so you can extract one and pass it around — for example to inject it as a dependency:
|
|
388
|
+
|
|
389
|
+
```typescript fileName="push.ts" codeFormat="typescript"
|
|
390
|
+
import { createIntlayerCMS } from "@intlayer/api";
|
|
391
|
+
import { dictionaryEndpoint } from "@intlayer/api/dictionary";
|
|
392
|
+
|
|
393
|
+
const dictionary = dictionaryEndpoint(createIntlayerCMS());
|
|
394
|
+
|
|
395
|
+
// Already authenticated — refreshes the token automatically on each call
|
|
396
|
+
export const pushDictionaries = dictionary.pushDictionaries;
|
|
397
|
+
|
|
398
|
+
// Usage
|
|
399
|
+
await pushDictionaries([{ key: "home", content: { title: "Home" } }]);
|
|
400
|
+
```
|
|
401
|
+
|
|
250
402
|
## Live sync
|
|
251
403
|
|
|
252
404
|
Live Sync allows your app to reflect CMS content changes at runtime. No rebuild or redeploy is required. When enabled, updates are streamed to a Live Sync server that refreshes the dictionaries your application reads.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-04-18
|
|
3
3
|
updatedAt: 2026-05-31
|
|
4
|
-
title: "Angular
|
|
5
|
-
description: "No more i18next. The 2026 guide to building a multilingual (i18n) Angular
|
|
4
|
+
title: "Angular 22 i18n - Complete guide to translate your app"
|
|
5
|
+
description: "No more i18next. The 2026 guide to building a multilingual (i18n) Angular 22 app. Translate with AI agents and optimise bundle size, SEO and performances."
|
|
6
6
|
keywords:
|
|
7
7
|
- Internationalisation
|
|
8
8
|
- Documentation
|
|
@@ -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
|
-
# Translate your Angular
|
|
34
|
+
# Translate your Angular 22 (Vite) website using Intlayer | Internationalisation (i18n)
|
|
35
35
|
|
|
36
36
|
## Table of contents
|
|
37
37
|
|
|
@@ -94,7 +94,7 @@ More than just an i18n solution, Intlayer provides an **self-hosted [visual edit
|
|
|
94
94
|
<Tab label="Code" 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 - How to internationalise your application using Intlayer"
|
|
100
100
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
@@ -105,7 +105,7 @@ More than just an i18n solution, Intlayer provides an **self-hosted [visual edit
|
|
|
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 @@ More than just an i18n solution, Intlayer provides an **self-hosted [visual edit
|
|
|
115
115
|
</Tab>
|
|
116
116
|
</Tabs>
|
|
117
117
|
|
|
118
|
-
See the [Application Template](https://github.com/aymericzip/intlayer-angular-
|
|
118
|
+
See the [Application Template](https://github.com/aymericzip/intlayer-angular-22-template) on GitHub.
|
|
119
119
|
|
|
120
120
|
<Steps>
|
|
121
121
|
|
|
@@ -203,7 +203,7 @@ export default config;
|
|
|
203
203
|
|
|
204
204
|
<Step number={3} title="Integrate Intlayer in Your Angular Configuration">
|
|
205
205
|
|
|
206
|
-
To integrate Intlayer with the Angular CLI, you need to use a custom builder. This guide assumes you are using Vite/esbuild (default for Angular
|
|
206
|
+
To integrate Intlayer with the Angular CLI, you need to use a custom builder. This guide assumes you are using Vite/esbuild (default for Angular 22 projects).
|
|
207
207
|
|
|
208
208
|
First, modify your `angular.json` to use the custom esbuild builder. Update the `build` and `serve` configurations:
|
|
209
209
|
|
|
@@ -29,13 +29,17 @@ history:
|
|
|
29
29
|
changes: "Initial doc"
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
# Translate your Nest backend website using Intlayer | Internationalization (i18n)
|
|
33
|
+
|
|
34
|
+
`express-intlayer` is a powerful internationalization (i18n) middleware for Express applications, designed to make your backend services globally accessible by providing localised responses based on the client's preferences. Since NestJS is built on top of Express, you can seamlessly integrate `express-intlayer` into your NestJS applications to handle multilingual content effectively.
|
|
35
|
+
|
|
36
|
+
Practical Use Cases
|
|
33
37
|
|
|
34
38
|
- **Displaying Backend Errors in User's Language**: When an error occurs, displaying messages in the user's native language improves understanding and reduces frustration. This is especially useful for dynamic error messages that might be shown in front-end components like toasts or modals.
|
|
35
39
|
|
|
36
40
|
- **Retrieving Multilingual Content**: For applications pulling content from a database, internationalisation ensures that you can serve this content in multiple languages. This is crucial for platforms like e-commerce sites or content management systems that need to display product descriptions, articles, and other content in the language preferred by the user.
|
|
37
41
|
|
|
38
|
-
- **Sending Multilingual Emails**: Whether it
|
|
42
|
+
- **Sending Multilingual Emails**: Whether it's transactional emails, marketing campaigns, or notifications, sending emails in the recipient's language can significantly increase engagement and effectiveness.
|
|
39
43
|
|
|
40
44
|
- **Multilingual Push Notifications**: For mobile applications, sending push notifications in a user's preferred language can enhance interaction and retention. This personal touch can make notifications feel more relevant and actionable.
|
|
41
45
|
|