@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
|
@@ -29,199 +29,88 @@ author: aymericzip
|
|
|
29
29
|
|
|
30
30
|
Чтобы установить вложение в вашем проекте Intlayer, сначала определите базовый контент, который вы хотите повторно использовать. Затем в отдельном модуле контента используйте функцию `nest` для импорта этого контента.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
### Базовый словарь
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
<Tab label="React" value="react">
|
|
34
|
+
Ниже приведен пример базового словаря для вложения в другой словарь:
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
```tsx fileName="**/*.tsx" codeFormat={["typescript", "esm"]}
|
|
40
|
-
import type { FC } from "react";
|
|
41
|
-
import { useIntlayer } from "react-intlayer";
|
|
42
|
-
|
|
43
|
-
const NestComponent: FC = () => {
|
|
44
|
-
const { fullNestedContent, partialNestedContent } = useIntlayer(
|
|
45
|
-
"key_of_my_second_dictionary"
|
|
46
|
-
);
|
|
36
|
+
```typescript fileName="firstDictionary.content.ts" contentDeclarationFormat={["typescript", "esm", "commonjs"]}
|
|
37
|
+
import { type Dictionary } from "intlayer";
|
|
47
38
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
39
|
+
const firstDictionary = {
|
|
40
|
+
key: "key_of_my_first_dictionary",
|
|
41
|
+
content: {
|
|
42
|
+
content: "content",
|
|
43
|
+
subContent: {
|
|
44
|
+
contentNumber: 0,
|
|
45
|
+
contentString: "string",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
} satisfies Dictionary;
|
|
55
49
|
|
|
56
|
-
export default
|
|
50
|
+
export default firstDictionary;
|
|
57
51
|
```
|
|
58
52
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const { fullNestedContent, partialNestedContent } = useIntlayer(
|
|
72
|
-
"key_of_my_second_dictionary"
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<div>
|
|
77
|
-
<p>Full Nested Content: {JSON.stringify(fullNestedContent)}</p>
|
|
78
|
-
<p>Partial Nested Value: {partialNestedContent}</p>
|
|
79
|
-
</div>
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export default NestComponent;
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
</Tab>
|
|
87
|
-
<Tab label="Vue" value="vue">
|
|
88
|
-
|
|
89
|
-
To use nested content in Vue components, retrieve it via the `useIntlayer` hook. Here's an example:
|
|
90
|
-
|
|
91
|
-
```vue fileName="**/*.vue"
|
|
92
|
-
<script setup lang="ts">
|
|
93
|
-
import { useIntlayer } from "vue-intlayer";
|
|
94
|
-
|
|
95
|
-
const { fullNestedContent, partialNestedContent } = useIntlayer(
|
|
96
|
-
"key_of_my_second_dictionary"
|
|
97
|
-
);
|
|
98
|
-
</script>
|
|
99
|
-
|
|
100
|
-
<template>
|
|
101
|
-
<div>
|
|
102
|
-
<p>Full Nested Content: {{ JSON.stringify(fullNestedContent) }}</p>
|
|
103
|
-
<p>Partial Nested Value: {{ partialNestedContent }}</p>
|
|
104
|
-
</div>
|
|
105
|
-
</template>
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
</Tab>
|
|
109
|
-
<Tab label="Svelte" value="svelte">
|
|
110
|
-
|
|
111
|
-
To use nested content in Svelte components, retrieve it via the `useIntlayer` hook. The store is accessed with `$`. Here's an example:
|
|
112
|
-
|
|
113
|
-
```svelte fileName="**/*.svelte"
|
|
114
|
-
<script lang="ts">
|
|
115
|
-
import { useIntlayer } from "svelte-intlayer";
|
|
116
|
-
|
|
117
|
-
const content = useIntlayer("key_of_my_second_dictionary");
|
|
118
|
-
</script>
|
|
119
|
-
|
|
120
|
-
<div>
|
|
121
|
-
<p>Full Nested Content: {JSON.stringify($content.fullNestedContent)}</p>
|
|
122
|
-
<p>Partial Nested Value: {$content.partialNestedContent}</p>
|
|
123
|
-
</div>
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
</Tab>
|
|
127
|
-
<Tab label="Preact" value="preact">
|
|
128
|
-
|
|
129
|
-
To use nested content in Preact components, retrieve it via the `useIntlayer` hook. Here's an example:
|
|
130
|
-
|
|
131
|
-
```tsx fileName="**/*.tsx" codeFormat={["typescript", "esm"]}
|
|
132
|
-
import type { FC } from "preact";
|
|
133
|
-
import { useIntlayer } from "preact-intlayer";
|
|
134
|
-
|
|
135
|
-
const NestComponent: FC = () => {
|
|
136
|
-
const { fullNestedContent, partialNestedContent } = useIntlayer(
|
|
137
|
-
"key_of_my_second_dictionary"
|
|
138
|
-
);
|
|
139
|
-
|
|
140
|
-
return (
|
|
141
|
-
<div>
|
|
142
|
-
<p>Full Nested Content: {JSON.stringify(fullNestedContent)}</p>
|
|
143
|
-
<p>Partial Nested Value: {partialNestedContent}</p>
|
|
144
|
-
</div>
|
|
145
|
-
);
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
export default NestComponent;
|
|
53
|
+
```json fileName="firstDictionary.content.json" contentDeclarationFormat="json"
|
|
54
|
+
{
|
|
55
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
56
|
+
"key": "key_of_my_first_dictionary",
|
|
57
|
+
"content": {
|
|
58
|
+
"content": "content",
|
|
59
|
+
"subContent": {
|
|
60
|
+
"contentNumber": 0,
|
|
61
|
+
"contentString": "string"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
149
65
|
```
|
|
150
66
|
|
|
151
|
-
|
|
152
|
-
<Tab label="Solid" value="solid">
|
|
67
|
+
### Ссылка с Nest
|
|
153
68
|
|
|
154
|
-
|
|
69
|
+
Теперь создайте еще один модуль содержимого, который использует функцию `nest` для ссылки на приведенное выше содержимое. Вы можете ссылаться на все содержимое или на конкретное вложенное значение:
|
|
155
70
|
|
|
156
|
-
```
|
|
157
|
-
import type
|
|
158
|
-
import { useIntlayer } from "solid-intlayer";
|
|
71
|
+
```typescript fileName="secondDictionary.content.ts" contentDeclarationFormat={["typescript", "esm", "commonjs"]}
|
|
72
|
+
import { nest, type Dictionary } from "intlayer";
|
|
159
73
|
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
74
|
+
const myNestingContent = {
|
|
75
|
+
key: "key_of_my_second_dictionary",
|
|
76
|
+
content: {
|
|
77
|
+
// Ссылается на весь словарь:
|
|
78
|
+
fullNestedContent: nest("key_of_my_first_dictionary"),
|
|
79
|
+
// Ссылается на конкретное вложенное значение:
|
|
80
|
+
partialNestedContent: nest(
|
|
81
|
+
"key_of_my_first_dictionary",
|
|
82
|
+
"subContent.contentNumber"
|
|
83
|
+
),
|
|
84
|
+
},
|
|
85
|
+
} satisfies Dictionary;
|
|
164
86
|
|
|
165
|
-
|
|
166
|
-
<div>
|
|
167
|
-
<p>Full Nested Content: {JSON.stringify(fullNestedContent)}</p>
|
|
168
|
-
<p>Partial Nested Value: {partialNestedContent}</p>
|
|
169
|
-
</div>
|
|
170
|
-
);
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
export default NestComponent;
|
|
87
|
+
export default myNestingContent;
|
|
174
88
|
```
|
|
175
89
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
})
|
|
196
|
-
export class NestComponent {
|
|
197
|
-
content = useIntlayer("key_of_my_second_dictionary");
|
|
198
|
-
JSON = JSON;
|
|
90
|
+
```json fileName="secondDictionary.content.json" contentDeclarationFormat="json"
|
|
91
|
+
{
|
|
92
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
93
|
+
"key": "key_of_my_second_dictionary",
|
|
94
|
+
"content": {
|
|
95
|
+
"fullNestedContent": {
|
|
96
|
+
"nodeType": "nested",
|
|
97
|
+
"nested": {
|
|
98
|
+
"dictionaryKey": "key_of_my_first_dictionary"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"partialNestedContent": {
|
|
102
|
+
"nodeType": "nested",
|
|
103
|
+
"nested": {
|
|
104
|
+
"dictionaryKey": "key_of_my_first_dictionary",
|
|
105
|
+
"path": "subContent.contentNumber"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
199
109
|
}
|
|
200
110
|
```
|
|
201
111
|
|
|
202
|
-
|
|
203
|
-
<Tab label="Vanilla JS" value="vanilla">
|
|
204
|
-
|
|
205
|
-
To use nested content with `vanilla-intlayer`, retrieve it via the `useIntlayer` hook. Here's an example:
|
|
206
|
-
|
|
207
|
-
```typescript fileName="**/*.ts" codeFormat={["typescript", "esm"]}
|
|
208
|
-
import { installIntlayer, useIntlayer } from "vanilla-intlayer";
|
|
209
|
-
|
|
210
|
-
installIntlayer();
|
|
112
|
+
Как второй параметр можно указать путь к вложенному значению внутри этого содержимого. Если путь не предоставлен, будет возвращено все содержимое из указанного словаря.
|
|
211
113
|
|
|
212
|
-
const content = useIntlayer("key_of_my_second_dictionary").onChange(
|
|
213
|
-
(newContent) => {
|
|
214
|
-
document.getElementById("nested")!.textContent =
|
|
215
|
-
newContent.partialNestedContent;
|
|
216
|
-
}
|
|
217
|
-
);
|
|
218
|
-
|
|
219
|
-
// Initial render
|
|
220
|
-
document.getElementById("nested")!.textContent = content.partialNestedContent;
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
</Tab>
|
|
224
|
-
</Tabs>
|
|
225
114
|
## Настройка вложенности
|
|
226
115
|
|
|
227
116
|
<Tabs group="framework">
|
|
@@ -416,36 +305,6 @@ document.getElementById("nested")!.textContent = content.partialNestedContent;
|
|
|
416
305
|
</Tab>
|
|
417
306
|
</Tabs>
|
|
418
307
|
|
|
419
|
-
## Использование вложенности с React Intlayer
|
|
420
|
-
|
|
421
|
-
Чтобы использовать вложенный контент в React-компоненте, используйте хук `useIntlayer` из пакета `react-intlayer`. Этот хук извлекает правильный контент на основе указанного ключа. Вот пример его использования:
|
|
422
|
-
|
|
423
|
-
```tsx fileName="**/*.tsx" codeFormat={["typescript", "esm"]}
|
|
424
|
-
import type { FC } from "react";
|
|
425
|
-
import { useIntlayer } from "react-intlayer";
|
|
426
|
-
|
|
427
|
-
const NestComponent: FC = () => {
|
|
428
|
-
const { fullNestedContent, partialNestedContent } = useIntlayer(
|
|
429
|
-
"key_of_my_second_dictionary"
|
|
430
|
-
);
|
|
431
|
-
|
|
432
|
-
return (
|
|
433
|
-
<div>
|
|
434
|
-
<p>
|
|
435
|
-
Полный вложенный контент: {JSON.stringify(fullNestedContent)}
|
|
436
|
-
{/* Вывод: {"content": "content", "subContent": {"contentNumber": 0, "contentString": "string"}} */}
|
|
437
|
-
</p>
|
|
438
|
-
<p>
|
|
439
|
-
Частичное вложенное значение: {partialNestedContent}
|
|
440
|
-
{/* Вывод: 0 */}
|
|
441
|
-
</p>
|
|
442
|
-
</div>
|
|
443
|
-
);
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
export default NestComponent;
|
|
447
|
-
```
|
|
448
|
-
|
|
449
308
|
## Дополнительные ресурсы
|
|
450
309
|
|
|
451
310
|
Для получения более подробной информации о настройке и использовании обратитесь к следующим ресурсам:
|
package/docs/ru/formatters.md
CHANGED
|
@@ -46,34 +46,6 @@ author: aymericzip
|
|
|
46
46
|
|
|
47
47
|
Intlayer предоставляет набор лёгких помощников, построенных поверх нативных API `Intl`, а также кешированный обёртку `Intl`, чтобы избежать многократного создания тяжёлых форматтеров. Эти утилиты полностью учитывают локаль и могут использоваться из основного пакета `intlayer`.
|
|
48
48
|
|
|
49
|
-
### Импорт
|
|
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
|
-
Если вы используете React, хуки также доступны; смотрите `react-intlayer/format`.
|
|
76
|
-
|
|
77
49
|
## Кешированный Intl
|
|
78
50
|
|
|
79
51
|
Экспортируемый `Intl`, это тонкая кешированная обёртка вокруг глобального `Intl`. Он мемоизирует экземпляры `NumberFormat`, `DateTimeFormat`, `RelativeTimeFormat`, `ListFormat`, `DisplayNames`, `Collator` и `PluralRules`, что позволяет избежать повторного создания одного и того же форматтера.
|
|
@@ -110,9 +82,7 @@ pluralRules.select(1); // "one"
|
|
|
110
82
|
pluralRules.select(2); // "other"
|
|
111
83
|
```
|
|
112
84
|
|
|
113
|
-
##
|
|
114
|
-
|
|
115
|
-
Помимо помощников для форматтеров, вы также можете использовать кешированную обёртку Intl напрямую для других возможностей Intl:
|
|
85
|
+
## React Formatters
|
|
116
86
|
|
|
117
87
|
### `Intl.DisplayNames`
|
|
118
88
|
|
|
@@ -128,6 +98,22 @@ const regionNames = new Intl.DisplayNames("fr", { type: "region" });
|
|
|
128
98
|
regionNames.of("US"); // "États-Unis"
|
|
129
99
|
```
|
|
130
100
|
|
|
101
|
+
### Доступные Hooks
|
|
102
|
+
|
|
103
|
+
Все hooks автоматически используют локаль из `IntlayerProvider` или `IntlayerServerProvider`.
|
|
104
|
+
|
|
105
|
+
| Hook | Description | Example Output |
|
|
106
|
+
| ------------------- | ------------------------------------------- | ----------------------------- |
|
|
107
|
+
| `useNumber()` | Форматирование чисел с разделением | `"123,456.789"` |
|
|
108
|
+
| `useCurrency()` | Форматирование значений валют | `"€1,234.50"` |
|
|
109
|
+
| `usePercentage()` | Форматирование процентов | `"25%"` |
|
|
110
|
+
| `useDate()` | Форматирование дат и времени | `"Aug 2, 2025"` |
|
|
111
|
+
| `useRelativeTime()` | Форматирование относительного времени | `"in 3 days"` |
|
|
112
|
+
| `useUnit()` | Форматирование значений с единицами | `"5 kilometers"` |
|
|
113
|
+
| `useCompact()` | Форматирование чисел в сокращенной форме | `"1.2K"` |
|
|
114
|
+
| `useList()` | Форматирование массивов как списки | `"apple, banana, and orange"` |
|
|
115
|
+
| `useIntl()` | Получить привязанный к локали объект `Intl` | Full `Intl` API access |
|
|
116
|
+
|
|
131
117
|
### `Intl.Collator`
|
|
132
118
|
|
|
133
119
|
Для локализованного сравнения и сортировки строк:
|
|
@@ -286,127 +272,111 @@ getLocaleLang("de"); // "de"
|
|
|
286
272
|
|
|
287
273
|
### Функции форматирования
|
|
288
274
|
|
|
289
|
-
|
|
275
|
+
#### `number(value, options?)`
|
|
290
276
|
|
|
291
|
-
|
|
277
|
+
Форматирует числовое значение с учётом локали, используя локализованные разделители групп и десятичные разделители.
|
|
292
278
|
|
|
293
|
-
|
|
294
|
-
|
|
279
|
+
- **value**: `number | string`
|
|
280
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
295
281
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
282
|
+
```ts
|
|
283
|
+
number(123456.789); // "123,456.789" (в en-US)
|
|
284
|
+
number("1000000", { locale: "fr" }); // "1 000 000"
|
|
285
|
+
number(1234.5, { minimumFractionDigits: 2 }); // "1,234.50"
|
|
300
286
|
```
|
|
301
287
|
|
|
302
|
-
|
|
303
|
-
- **returns**: Обнаруженная локаль или локаль по умолчанию, если локаль не найдена
|
|
288
|
+
#### `percentage(value, options?)`
|
|
304
289
|
|
|
305
|
-
|
|
290
|
+
Форматирует число как строку процента. Значения больше 1 нормализуются (например, `25` → `25%`, `0.25` → `25%`).
|
|
306
291
|
|
|
307
|
-
|
|
292
|
+
- **value**: `number | string`
|
|
293
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
308
294
|
|
|
309
295
|
```ts
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
getPathWithoutLocale("/fr/dashboard"); // "/dashboard"
|
|
314
|
-
getPathWithoutLocale("https://example.com/en/about"); // "https://example.com/about"
|
|
296
|
+
percentage(0.25); // "25%"
|
|
297
|
+
percentage(25); // "25%"
|
|
298
|
+
percentage(0.237, { minimumFractionDigits: 1 }); // "23.7%"
|
|
315
299
|
```
|
|
316
300
|
|
|
317
|
-
|
|
318
|
-
- **locales**: Необязательный массив поддерживаемых локалей (по умолчанию используется настроенный список локалей)
|
|
319
|
-
- **returns**: URL без сегмента локали
|
|
301
|
+
#### `currency(value, options?)`
|
|
320
302
|
|
|
321
|
-
|
|
303
|
+
Форматирует значение как локализованную валюту. По умолчанию `USD`.
|
|
322
304
|
|
|
323
|
-
|
|
305
|
+
- **value**: `number | string`
|
|
306
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
307
|
+
- Common: `currency`, `currencyDisplay` (`"symbol" | "code" | "name"`)
|
|
324
308
|
|
|
325
309
|
```ts
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
getLocalizedUrl("/about", "fr", ["en", "fr"], "en", false); // "/fr/about"
|
|
329
|
-
getLocalizedUrl("/about", "en", ["en", "fr"], "en", false); // "/about"
|
|
330
|
-
getLocalizedUrl("https://example.com/about", "fr", ["en", "fr"], "en", true); // "https://example.com/fr/about"
|
|
310
|
+
currency(1234.5, { currency: "EUR" }); // "€1,234.50"
|
|
311
|
+
currency("5000", { locale: "fr", currency: "CAD", currencyDisplay: "code" }); // "5 000,00 CAD"
|
|
331
312
|
```
|
|
332
313
|
|
|
333
|
-
|
|
334
|
-
- **currentLocale**: Текущая локаль
|
|
335
|
-
- **locales**: Необязательный массив поддерживаемых локалей (по умолчанию используется настроенный список локалей)
|
|
336
|
-
- **defaultLocale**: Необязательная локаль по умолчанию (по умолчанию используется настроенная локаль по умолчанию)
|
|
337
|
-
- **prefixDefault**: Добавлять ли префикс для локали по умолчанию (по умолчанию используется настроенное значение)
|
|
314
|
+
#### `date(date, optionsOrPreset?)`
|
|
338
315
|
|
|
339
|
-
|
|
316
|
+
Форматирует значение даты/времени.
|
|
340
317
|
|
|
341
|
-
|
|
318
|
+
- **date**: `Date | string | number`
|
|
319
|
+
- **optionsOrPreset**: `Intl.DateTimeFormatOptions & { locale?: LocalesValues }` или preset: `"short" | "long" | "dateOnly" | "timeOnly" | "full"`
|
|
342
320
|
|
|
343
321
|
```ts
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
getHTMLTextDir("en-US"); // "ltr"
|
|
347
|
-
getHTMLTextDir("ar"); // "rtl"
|
|
348
|
-
getHTMLTextDir("he"); // "rtl"
|
|
322
|
+
date(new Date(), "short"); // например, "08/02/25, 14:30"
|
|
323
|
+
date("2025-08-02T14:30:00Z", { locale: "fr", month: "long", day: "numeric" }); // "2 août"
|
|
349
324
|
```
|
|
350
325
|
|
|
351
|
-
|
|
352
|
-
- **returns**: `"ltr"`, `"rtl"` или `"auto"`
|
|
326
|
+
#### `relativeTime(from, to?, options?)`
|
|
353
327
|
|
|
354
|
-
|
|
328
|
+
Форматирует относительное время между двумя моментами.
|
|
355
329
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
330
|
+
- **from**: `Date | string | number`
|
|
331
|
+
- **to**: `Date | string | number` (по умолчанию `new Date()`)
|
|
332
|
+
- **options**: `{ locale?, unit?, numeric?, style? }`
|
|
359
333
|
|
|
360
334
|
```ts
|
|
361
|
-
|
|
335
|
+
const now = new Date();
|
|
336
|
+
const in3Days = new Date(now.getTime() + 3 * 864e5);
|
|
337
|
+
relativeTime(now, in3Days, { unit: "day" }); // "через 3 дня"
|
|
362
338
|
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
{ dictionaryKey: "common", dictionaryPath: "/path/to/dict" },
|
|
366
|
-
"fr"
|
|
367
|
-
);
|
|
339
|
+
const twoHoursAgo = new Date(now.getTime() - 2 * 3600e3);
|
|
340
|
+
relativeTime(now, twoHoursAgo, { unit: "hour", numeric: "auto" }); // "2 часа назад"
|
|
368
341
|
```
|
|
369
342
|
|
|
370
|
-
|
|
371
|
-
- **nodeProps**: Свойства для контекста преобразования
|
|
372
|
-
- **locale**: Необязательная локаль (по умолчанию используется настроенная локаль по умолчанию)
|
|
343
|
+
#### `units(value, options?)`
|
|
373
344
|
|
|
374
|
-
|
|
345
|
+
Форматирует числовое значение с единицей измерения.
|
|
375
346
|
|
|
376
|
-
|
|
347
|
+
- **value**: `number | string`
|
|
348
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
349
|
+
- Common: `unit` (например, `"kilometer"`, `"byte"`), `unitDisplay` (`"short" | "narrow" | "long"`)
|
|
377
350
|
|
|
378
351
|
```ts
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
const content = getTranslation(
|
|
382
|
-
{
|
|
383
|
-
en: "Hello",
|
|
384
|
-
fr: "Bonjour",
|
|
385
|
-
de: "Hallo",
|
|
386
|
-
},
|
|
387
|
-
"fr",
|
|
388
|
-
true
|
|
389
|
-
); // "Bonjour"
|
|
352
|
+
units(5, { unit: "kilometer", unitDisplay: "long", locale: "en-GB" }); // "5 kilometers"
|
|
353
|
+
units(1024, { unit: "byte", unitDisplay: "narrow" }); // "1,024B"
|
|
390
354
|
```
|
|
391
355
|
|
|
392
|
-
|
|
393
|
-
- **locale**: Целевая локаль (по умолчанию используется настроенная локаль по умолчанию)
|
|
394
|
-
- **fallback**: Использовать ли резервный вариант с локалью по умолчанию (по умолчанию true)
|
|
356
|
+
#### `compact(value, options?)`
|
|
395
357
|
|
|
396
|
-
|
|
358
|
+
Форматирует число с использованием компактной нотации.
|
|
397
359
|
|
|
398
|
-
|
|
360
|
+
- **value**: `number | string`
|
|
361
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
399
362
|
|
|
400
363
|
```ts
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
const content = getIntlayer("common", "fr");
|
|
404
|
-
const nestedContent = getIntlayer("common", "fr", customPlugins);
|
|
364
|
+
compact(1200); // "1.2K"
|
|
365
|
+
compact("1000000", { locale: "fr", compactDisplay: "long" }); // "1 million"
|
|
405
366
|
```
|
|
406
367
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
368
|
+
#### `list(values, options?)`
|
|
369
|
+
|
|
370
|
+
Форматирует массив в локализованную строку списка.
|
|
371
|
+
|
|
372
|
+
- **values**: `(string | number)[]`
|
|
373
|
+
- **options**: `Intl.ListFormatOptions & { locale?: LocalesValues }`
|
|
374
|
+
- Common: `type` (`"conjunction" | "disjunction" | "unit"`), `style` (`"long" | "short" | "narrow"`)
|
|
375
|
+
|
|
376
|
+
```ts
|
|
377
|
+
list(["apple", "banana", "orange"]); // "apple, banana, and orange"
|
|
378
|
+
list(["red", "green", "blue"], { locale: "fr", type: "disjunction" }); // "rouge, vert ou bleu"
|
|
379
|
+
```
|
|
410
380
|
|
|
411
381
|
## Cached Intl
|
|
412
382
|
|
|
@@ -438,39 +408,49 @@ pluralRules.select(2); // "other"
|
|
|
438
408
|
|
|
439
409
|
### Дополнительные возможности Intl
|
|
440
410
|
|
|
441
|
-
|
|
411
|
+
#### `Intl.DisplayNames`
|
|
442
412
|
|
|
443
|
-
|
|
413
|
+
Для локализованных названий языков, регионов, валют и письменностей:
|
|
444
414
|
|
|
445
415
|
```ts
|
|
446
|
-
import {
|
|
416
|
+
import { Intl } from "intlayer";
|
|
447
417
|
|
|
448
|
-
const
|
|
418
|
+
const languageNames = new Intl.DisplayNames("en", { type: "language" });
|
|
419
|
+
languageNames.of("fr"); // "French"
|
|
420
|
+
|
|
421
|
+
const regionNames = new Intl.DisplayNames("fr", { type: "region" });
|
|
422
|
+
regionNames.of("US"); // "États-Unis"
|
|
449
423
|
```
|
|
450
424
|
|
|
451
|
-
|
|
452
|
-
- **locale**: Необязательная локаль (по умолчанию используется настроенная локаль по умолчанию)
|
|
453
|
-
- **plugins**: Необязательный массив пользовательских плагинов трансформации
|
|
425
|
+
#### `Intl.Collator`
|
|
454
426
|
|
|
455
|
-
|
|
427
|
+
Для локализованного сравнения и сортировки строк:
|
|
456
428
|
|
|
457
|
-
|
|
429
|
+
```ts
|
|
430
|
+
import { Intl } from "intlayer";
|
|
458
431
|
|
|
459
|
-
|
|
432
|
+
const collator = new Intl.Collator("de", {
|
|
433
|
+
sensitivity: "base",
|
|
434
|
+
numeric: true,
|
|
435
|
+
});
|
|
460
436
|
|
|
461
|
-
|
|
437
|
+
const words = ["äpfel", "zebra", "100", "20"];
|
|
438
|
+
words.sort(collator.compare); // ["20", "100", "äpfel", "zebra"]
|
|
439
|
+
```
|
|
462
440
|
|
|
463
|
-
|
|
464
|
-
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
441
|
+
#### `Intl.PluralRules`
|
|
465
442
|
|
|
466
|
-
|
|
443
|
+
Для определения форм множественного числа в разных локалях:
|
|
467
444
|
|
|
468
445
|
```ts
|
|
469
|
-
import {
|
|
446
|
+
import { Intl } from "intlayer";
|
|
470
447
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
448
|
+
const pluralRules = new Intl.PluralRules("ar");
|
|
449
|
+
pluralRules.select(0); // "zero"
|
|
450
|
+
pluralRules.select(1); // "one"
|
|
451
|
+
pluralRules.select(2); // "two"
|
|
452
|
+
pluralRules.select(3); // "few"
|
|
453
|
+
pluralRules.select(11); // "many"
|
|
474
454
|
```
|
|
475
455
|
|
|
476
456
|
## Утилиты Локализации
|