@intlayer/docs 9.1.3 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blog/ar/rag_powered_documentation_assistant.md +7 -0
- package/blog/de/rag_powered_documentation_assistant.md +6 -0
- package/blog/en-GB/rag_powered_documentation_assistant.md +6 -0
- package/blog/es/rag_powered_documentation_assistant.md +7 -0
- package/blog/fr/i18n_meaning.md +7 -1
- package/blog/fr/list_i18n_technologies/frameworks/angular.md +5 -1
- package/blog/fr/rag_powered_documentation_assistant.md +6 -0
- package/blog/hi/next-i18next_vs_next-intl_vs_intlayer.md +119 -42
- package/blog/hi/rag_powered_documentation_assistant.md +7 -0
- package/blog/id/rag_powered_documentation_assistant.md +6 -0
- package/blog/it/rag_powered_documentation_assistant.md +6 -0
- package/blog/ja/rag_powered_documentation_assistant.md +7 -0
- package/blog/ko/list_i18n_technologies/frameworks/react.md +7 -7
- package/blog/ko/rag_powered_documentation_assistant.md +6 -0
- package/blog/pl/rag_powered_documentation_assistant.md +6 -0
- package/blog/pt/rag_powered_documentation_assistant.md +6 -0
- package/blog/ru/rag_powered_documentation_assistant.md +7 -0
- package/blog/tr/intlayer_with_react-intl.md +3 -1
- package/blog/tr/next-i18next_vs_next-intl_vs_intlayer.md +175 -42
- package/blog/tr/rag_powered_documentation_assistant.md +6 -0
- package/blog/uk/rag_powered_documentation_assistant.md +6 -0
- package/blog/vi/rag_powered_documentation_assistant.md +6 -0
- package/blog/zh/intlayer_with_i18next.md +87 -28
- package/blog/zh/intlayer_with_next-i18next.md +86 -29
- package/blog/zh/intlayer_with_next-intl.md +88 -28
- package/blog/zh/intlayer_with_react-i18next.md +87 -28
- package/blog/zh/intlayer_with_react-intl.md +88 -27
- package/blog/zh/intlayer_with_vue-i18n.md +117 -8
- package/blog/zh/rag_powered_documentation_assistant.md +6 -0
- package/dist/cjs/generated/blog.entry.cjs +27 -27
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +234 -214
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +17 -17
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +2 -2
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +27 -27
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +234 -214
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/esm/generated/frequentQuestions.entry.mjs +17 -17
- package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
- package/dist/esm/generated/legal.entry.mjs +2 -2
- package/dist/esm/generated/legal.entry.mjs.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +1 -0
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/docs/ar/analytics.md +222 -0
- package/docs/ar/autoFill.md +28 -9
- package/docs/ar/configuration.md +25 -8
- package/docs/ar/dictionary/file.md +3 -1
- package/docs/ar/dictionary/nesting.md +47 -30
- package/docs/ar/formatters.md +148 -193
- package/docs/ar/intlayer_CMS.md +152 -0
- package/docs/ar/intlayer_with_angular_21.md +9 -9
- package/docs/ar/intlayer_with_nextjs_14.md +1 -28
- package/docs/ar/intlayer_with_nextjs_15.md +1 -33
- package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +40 -83
- package/docs/ar/intlayer_with_solid_start.md +1078 -0
- package/docs/ar/intlayer_with_vite+vue.md +1 -3
- package/docs/ar/packages/intlayer/getLocalizedUrl.md +26 -24
- package/docs/ar/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/ar/packages/react-intlayer/useDictionary.md +4 -21
- package/docs/ar/packages/react-intlayer/useIntlayer.md +2 -2
- package/docs/ar/packages/vite-intlayer/exports.md +15 -0
- package/docs/ar/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/ar/packages/vite-intlayer/intlayerPrune.md +70 -3
- package/docs/ar/releases/v9.md +0 -37
- package/docs/ar/self_hosting.md +46 -49
- package/docs/bn/configuration.md +25 -8
- package/docs/bn/intlayer_with_angular_21.md +9 -9
- package/docs/cs/configuration.md +25 -8
- package/docs/cs/intlayer_with_angular_21.md +9 -9
- package/docs/de/analytics.md +222 -0
- package/docs/de/autoFill.md +28 -9
- package/docs/de/configuration.md +25 -8
- package/docs/de/dictionary/file.md +3 -1
- package/docs/de/dictionary/nesting.md +47 -31
- package/docs/de/formatters.md +208 -334
- package/docs/de/intlayer_CMS.md +66 -15
- package/docs/de/intlayer_with_angular_21.md +9 -9
- package/docs/de/intlayer_with_nestjs.md +11 -7
- package/docs/de/intlayer_with_nextjs_14.md +1 -28
- package/docs/de/intlayer_with_nextjs_15.md +1 -33
- package/docs/de/intlayer_with_solid_start.md +1078 -0
- package/docs/de/intlayer_with_vite+vue.md +1 -3
- package/docs/de/packages/intlayer/getLocalizedUrl.md +33 -25
- package/docs/de/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/de/packages/react-intlayer/useDictionary.md +2 -5
- package/docs/de/packages/vite-intlayer/exports.md +15 -0
- package/docs/de/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/de/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/de/releases/v9.md +0 -15
- package/docs/de/self_hosting.md +46 -50
- package/docs/en/cli/doc-review.md +13 -2
- package/docs/en/configuration.md +24 -15
- package/docs/en/intlayer_with_angular_21.md +9 -9
- package/docs/en/intlayer_with_solid_start.md +1091 -0
- package/docs/en/intlayer_with_vite+solid.md +12 -0
- package/docs/en-GB/analytics.md +222 -0
- package/docs/en-GB/autoFill.md +26 -7
- package/docs/en-GB/configuration.md +25 -8
- package/docs/en-GB/dictionary/file.md +2 -0
- package/docs/en-GB/dictionary/nesting.md +64 -205
- package/docs/en-GB/formatters.md +146 -181
- package/docs/en-GB/intlayer_CMS.md +152 -0
- package/docs/en-GB/intlayer_with_angular_21.md +9 -9
- package/docs/en-GB/intlayer_with_nestjs.md +6 -2
- package/docs/en-GB/intlayer_with_nextjs_14.md +0 -27
- package/docs/en-GB/intlayer_with_nextjs_15.md +1 -33
- package/docs/en-GB/intlayer_with_react_router_v7_fs_routes.md +40 -82
- package/docs/en-GB/intlayer_with_solid_start.md +1078 -0
- package/docs/en-GB/intlayer_with_vite+vue.md +1 -3
- package/docs/en-GB/packages/intlayer/getLocalizedUrl.md +30 -22
- package/docs/en-GB/packages/intlayer/getMultilingualUrls.md +16 -48
- package/docs/en-GB/packages/vite-intlayer/exports.md +15 -0
- package/docs/en-GB/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/en-GB/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/en-GB/self_hosting.md +60 -49
- package/docs/es/analytics.md +222 -0
- package/docs/es/autoFill.md +28 -9
- package/docs/es/configuration.md +24 -7
- package/docs/es/dictionary/file.md +3 -1
- package/docs/es/dictionary/nesting.md +47 -30
- package/docs/es/formatters.md +114 -168
- package/docs/es/intlayer_CMS.md +35 -10
- package/docs/es/intlayer_with_angular_21.md +9 -9
- package/docs/es/intlayer_with_nextjs_14.md +1 -28
- package/docs/es/intlayer_with_nextjs_15.md +1 -33
- package/docs/es/intlayer_with_solid_start.md +1078 -0
- package/docs/es/packages/intlayer/getLocalizedUrl.md +31 -23
- package/docs/es/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/es/packages/vite-intlayer/exports.md +15 -0
- package/docs/es/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/es/packages/vite-intlayer/intlayerPrune.md +69 -2
- package/docs/es/releases/v9.md +0 -15
- package/docs/es/self_hosting.md +46 -49
- package/docs/fr/analytics.md +222 -0
- package/docs/fr/autoFill.md +27 -8
- package/docs/fr/configuration.md +25 -8
- package/docs/fr/dictionary/file.md +2 -0
- package/docs/fr/dictionary/nesting.md +37 -184
- package/docs/fr/formatters.md +95 -236
- package/docs/fr/intlayer_CMS.md +66 -15
- package/docs/fr/intlayer_with_angular_21.md +9 -9
- package/docs/fr/intlayer_with_nextjs_14.md +1 -28
- package/docs/fr/intlayer_with_nextjs_15.md +1 -33
- package/docs/fr/intlayer_with_solid_start.md +1078 -0
- package/docs/fr/packages/intlayer/getLocalizedUrl.md +37 -27
- package/docs/fr/packages/intlayer/getMultilingualUrls.md +18 -20
- package/docs/fr/packages/vite-intlayer/exports.md +15 -0
- package/docs/fr/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/fr/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/fr/releases/v9.md +0 -15
- package/docs/fr/self_hosting.md +46 -49
- package/docs/hi/analytics.md +222 -0
- package/docs/hi/autoFill.md +28 -9
- package/docs/hi/configuration.md +25 -8
- package/docs/hi/dictionary/file.md +3 -1
- package/docs/hi/dictionary/nesting.md +47 -30
- package/docs/hi/formatters.md +233 -334
- package/docs/hi/how_works_intlayer.md +3 -1
- package/docs/hi/intlayer_CMS.md +152 -0
- package/docs/hi/intlayer_with_angular_21.md +9 -9
- package/docs/hi/intlayer_with_nestjs.md +11 -7
- package/docs/hi/intlayer_with_nextjs_14.md +1 -28
- package/docs/hi/intlayer_with_nextjs_15.md +1 -33
- package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +40 -83
- package/docs/hi/intlayer_with_solid_start.md +1077 -0
- package/docs/hi/intlayer_with_vite+preact.md +56 -49
- package/docs/hi/intlayer_with_vite+react.md +48 -41
- package/docs/hi/intlayer_with_vite+solid.md +32 -41
- package/docs/hi/intlayer_with_vite+vue.md +49 -44
- package/docs/hi/packages/intlayer/getLocalizedUrl.md +26 -24
- package/docs/hi/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/hi/packages/next-intlayer/t.md +33 -1
- package/docs/hi/packages/react-intlayer/useDictionary.md +4 -21
- package/docs/hi/packages/vite-intlayer/exports.md +15 -0
- package/docs/hi/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/hi/packages/vite-intlayer/intlayerPrune.md +78 -5
- package/docs/hi/plugins/sync-json.md +9 -9
- package/docs/hi/releases/v9.md +0 -15
- package/docs/hi/self_hosting.md +38 -51
- package/docs/id/analytics.md +223 -0
- package/docs/id/configuration.md +25 -8
- package/docs/id/dictionary/nesting.md +37 -184
- package/docs/id/formatters.md +208 -305
- package/docs/id/intlayer_CMS.md +164 -0
- package/docs/id/intlayer_with_angular_21.md +9 -9
- package/docs/id/intlayer_with_nextjs_14.md +1 -26
- package/docs/id/intlayer_with_react_router_v7_fs_routes.md +70 -63
- package/docs/id/intlayer_with_solid_start.md +1078 -0
- package/docs/id/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/id/packages/react-intlayer/useIntlayer.md +2 -2
- package/docs/id/packages/vite-intlayer/exports.md +15 -0
- package/docs/id/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/id/packages/vite-intlayer/intlayerPrune.md +78 -5
- package/docs/id/releases/v9.md +12 -0
- package/docs/id/self_hosting.md +61 -50
- package/docs/it/analytics.md +222 -0
- package/docs/it/autoFill.md +27 -8
- package/docs/it/configuration.md +25 -8
- package/docs/it/dictionary/file.md +3 -1
- package/docs/it/dictionary/nesting.md +47 -30
- package/docs/it/formatters.md +114 -168
- package/docs/it/intlayer_CMS.md +66 -15
- package/docs/it/intlayer_with_angular_21.md +9 -9
- package/docs/it/intlayer_with_nestjs.md +11 -7
- package/docs/it/intlayer_with_nextjs_14.md +1 -28
- package/docs/it/intlayer_with_nextjs_15.md +1 -33
- package/docs/it/intlayer_with_solid_start.md +1078 -0
- package/docs/it/intlayer_with_vite+vue.md +1 -3
- package/docs/it/packages/intlayer/getLocalizedUrl.md +34 -26
- package/docs/it/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/it/packages/react-intlayer/useDictionary.md +4 -21
- package/docs/it/packages/vite-intlayer/exports.md +15 -0
- package/docs/it/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/it/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/it/releases/v9.md +0 -15
- package/docs/it/self_hosting.md +60 -49
- package/docs/ja/analytics.md +222 -0
- package/docs/ja/autoFill.md +28 -9
- package/docs/ja/configuration.md +25 -8
- package/docs/ja/dictionary/content_file.md +15 -7
- package/docs/ja/dictionary/file.md +3 -1
- package/docs/ja/dictionary/nesting.md +47 -30
- package/docs/ja/formatters.md +133 -187
- package/docs/ja/intlayer_visual_editor.md +3 -1
- package/docs/ja/intlayer_with_angular_21.md +6 -6
- package/docs/ja/intlayer_with_nestjs.md +2 -12
- package/docs/ja/intlayer_with_nextjs_14.md +1 -28
- package/docs/ja/intlayer_with_nextjs_15.md +1 -33
- package/docs/ja/intlayer_with_react_router_v7.md +456 -20
- package/docs/ja/intlayer_with_solid_start.md +1078 -0
- package/docs/ja/intlayer_with_vite+preact.md +73 -41
- package/docs/ja/intlayer_with_vite+vue.md +1 -3
- package/docs/ja/mcp_server.md +3 -9
- package/docs/ja/packages/intlayer/getLocalizedUrl.md +26 -24
- package/docs/ja/packages/intlayer/getMultilingualUrls.md +3 -17
- package/docs/ja/packages/vite-intlayer/exports.md +15 -0
- package/docs/ja/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/ja/packages/vite-intlayer/intlayerPrune.md +79 -6
- package/docs/ja/releases/v9.md +12 -0
- package/docs/ja/self_hosting.md +46 -50
- package/docs/ko/analytics.md +222 -0
- package/docs/ko/autoFill.md +28 -9
- package/docs/ko/configuration.md +25 -8
- package/docs/ko/dictionary/file.md +3 -1
- package/docs/ko/dictionary/nesting.md +47 -30
- package/docs/ko/formatters.md +133 -187
- package/docs/ko/intlayer_with_angular_21.md +9 -9
- package/docs/ko/intlayer_with_lynx+react.md +133 -39
- package/docs/ko/intlayer_with_nextjs_14.md +1 -28
- package/docs/ko/intlayer_with_nextjs_15.md +1 -33
- package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +40 -188
- package/docs/ko/intlayer_with_solid_start.md +1078 -0
- package/docs/ko/intlayer_with_vite+preact.md +57 -23
- package/docs/ko/intlayer_with_vite+vue.md +1 -3
- package/docs/ko/packages/intlayer/getLocalizedUrl.md +26 -24
- package/docs/ko/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/ko/packages/vite-intlayer/exports.md +15 -0
- package/docs/ko/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/ko/packages/vite-intlayer/intlayerPrune.md +79 -6
- package/docs/ko/releases/v9.md +12 -0
- package/docs/ko/self_hosting.md +60 -49
- package/docs/nl/configuration.md +25 -8
- package/docs/nl/intlayer_with_angular_21.md +9 -9
- package/docs/pl/analytics.md +220 -0
- package/docs/pl/configuration.md +25 -8
- package/docs/pl/dictionary/nesting.md +47 -30
- package/docs/pl/formatters.md +208 -305
- package/docs/pl/intlayer_CMS.md +152 -0
- package/docs/pl/intlayer_with_angular_21.md +9 -9
- package/docs/pl/intlayer_with_nextjs_14.md +1 -26
- package/docs/pl/intlayer_with_solid_start.md +1078 -0
- package/docs/pl/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/pl/packages/react-intlayer/useDictionary.md +2 -19
- package/docs/pl/packages/vite-intlayer/exports.md +15 -0
- package/docs/pl/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/pl/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/pl/releases/v9.md +0 -15
- package/docs/pl/self_hosting.md +60 -49
- package/docs/pt/analytics.md +222 -0
- package/docs/pt/configuration.md +25 -8
- package/docs/pt/dictionary/file.md +3 -1
- package/docs/pt/dictionary/nesting.md +47 -30
- package/docs/pt/formatters.md +112 -168
- package/docs/pt/intlayer_CMS.md +66 -15
- package/docs/pt/intlayer_with_angular_21.md +9 -9
- package/docs/pt/intlayer_with_astro_lit.md +26 -1
- package/docs/pt/intlayer_with_nextjs_14.md +1 -28
- package/docs/pt/intlayer_with_nextjs_15.md +1 -33
- package/docs/pt/intlayer_with_solid_start.md +1078 -0
- package/docs/pt/intlayer_with_vite+vue.md +1 -3
- package/docs/pt/packages/intlayer/getLocalizedUrl.md +34 -26
- package/docs/pt/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/pt/packages/vite-intlayer/exports.md +15 -0
- package/docs/pt/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/pt/packages/vite-intlayer/intlayerPrune.md +78 -6
- package/docs/pt/releases/v9.md +0 -15
- package/docs/pt/self_hosting.md +60 -49
- package/docs/ru/analytics.md +222 -0
- package/docs/ru/autoFill.md +27 -8
- package/docs/ru/configuration.md +25 -8
- package/docs/ru/dictionary/file.md +3 -1
- package/docs/ru/dictionary/nesting.md +64 -205
- package/docs/ru/formatters.md +108 -128
- package/docs/ru/intlayer_with_angular_21.md +9 -9
- package/docs/ru/intlayer_with_nextjs_14.md +1 -28
- package/docs/ru/intlayer_with_nextjs_15.md +1 -33
- package/docs/ru/intlayer_with_solid_start.md +1078 -0
- package/docs/ru/intlayer_with_vite+vue.md +1 -3
- package/docs/ru/packages/intlayer/getLocalizedUrl.md +34 -26
- package/docs/ru/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/ru/packages/react-intlayer/useDictionary.md +4 -21
- package/docs/ru/packages/vite-intlayer/exports.md +15 -0
- package/docs/ru/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/ru/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/ru/releases/v9.md +0 -15
- package/docs/ru/self_hosting.md +60 -49
- package/docs/tr/analytics.md +222 -0
- package/docs/tr/autoFill.md +28 -9
- package/docs/tr/configuration.md +25 -8
- package/docs/tr/dictionary/file.md +2 -0
- package/docs/tr/dictionary/nesting.md +47 -30
- package/docs/tr/formatters.md +144 -190
- package/docs/tr/intlayer_CMS.md +152 -0
- package/docs/tr/intlayer_with_angular_21.md +9 -9
- package/docs/tr/intlayer_with_nestjs.md +2 -12
- package/docs/tr/intlayer_with_nextjs_15.md +1 -33
- package/docs/tr/intlayer_with_solid_start.md +1078 -0
- package/docs/tr/intlayer_with_vite+vue.md +1 -3
- package/docs/tr/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/tr/packages/vite-intlayer/exports.md +15 -0
- package/docs/tr/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/tr/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/tr/self_hosting.md +47 -50
- package/docs/uk/analytics.md +222 -0
- package/docs/uk/configuration.md +25 -8
- package/docs/uk/dictionary/nesting.md +47 -30
- package/docs/uk/formatters.md +128 -185
- package/docs/uk/intlayer_CMS.md +152 -0
- package/docs/uk/intlayer_with_angular_21.md +9 -9
- package/docs/uk/intlayer_with_nextjs_14.md +1 -26
- package/docs/uk/intlayer_with_solid_start.md +1078 -0
- package/docs/uk/packages/react-intlayer/useDictionary.md +2 -19
- package/docs/uk/packages/vite-intlayer/exports.md +15 -0
- package/docs/uk/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/uk/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/uk/releases/v9.md +0 -15
- package/docs/uk/self_hosting.md +60 -50
- package/docs/ur/configuration.md +25 -8
- package/docs/ur/intlayer_with_angular_21.md +9 -9
- package/docs/vi/analytics.md +222 -0
- package/docs/vi/configuration.md +24 -8
- package/docs/vi/dictionary/nesting.md +37 -184
- package/docs/vi/formatters.md +208 -309
- package/docs/vi/intlayer_CMS.md +164 -0
- package/docs/vi/intlayer_with_angular_21.md +9 -9
- package/docs/vi/intlayer_with_nextjs_14.md +0 -25
- package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +70 -63
- package/docs/vi/intlayer_with_solid_start.md +1078 -0
- package/docs/vi/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/vi/packages/react-intlayer/useIntlayer.md +2 -2
- package/docs/vi/packages/vite-intlayer/exports.md +15 -0
- package/docs/vi/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/vi/packages/vite-intlayer/intlayerPrune.md +77 -4
- package/docs/vi/plugins/sync-json.md +6 -6
- package/docs/vi/releases/v9.md +12 -0
- package/docs/vi/self_hosting.md +61 -50
- package/docs/zh/CI_CD.md +4 -0
- package/docs/zh/analytics.md +222 -0
- package/docs/zh/autoFill.md +28 -9
- package/docs/zh/configuration.md +24 -8
- package/docs/zh/dictionary/file.md +2 -0
- package/docs/zh/dictionary/nesting.md +47 -30
- package/docs/zh/formatters.md +140 -188
- package/docs/zh/intlayer_CMS.md +164 -0
- package/docs/zh/intlayer_with_analog.md +193 -3
- package/docs/zh/intlayer_with_angular_19.md +272 -3
- package/docs/zh/intlayer_with_angular_21.md +7 -7
- package/docs/zh/intlayer_with_create_react_app.md +348 -26
- package/docs/zh/intlayer_with_lynx+react.md +263 -4
- package/docs/zh/intlayer_with_nextjs_14.md +1 -28
- package/docs/zh/intlayer_with_nextjs_15.md +1 -33
- package/docs/zh/intlayer_with_nextjs_no_locale_path.md +558 -1
- package/docs/zh/intlayer_with_nuxt.md +182 -7
- package/docs/zh/intlayer_with_react_router_v7.md +183 -25
- package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +306 -42
- package/docs/zh/intlayer_with_solid_start.md +1077 -0
- package/docs/zh/intlayer_with_storybook.md +260 -3
- package/docs/zh/intlayer_with_svelte_kit.md +428 -48
- package/docs/zh/intlayer_with_tanstack+solid.md +713 -13
- package/docs/zh/intlayer_with_tanstack.md +731 -20
- package/docs/zh/intlayer_with_vanilla.md +314 -4
- package/docs/zh/intlayer_with_vite+lit.md +465 -4
- package/docs/zh/intlayer_with_vite+preact.md +422 -116
- package/docs/zh/intlayer_with_vite+react.md +324 -45
- package/docs/zh/intlayer_with_vite+react_compiler.md +228 -13
- package/docs/zh/intlayer_with_vite+solid.md +462 -32
- package/docs/zh/intlayer_with_vite+vanilla.md +497 -4
- package/docs/zh/mcp_server.md +3 -9
- package/docs/zh/packages/intlayer/getLocalizedUrl.md +26 -24
- package/docs/zh/packages/intlayer/getMultilingualUrls.md +4 -18
- package/docs/zh/packages/vite-intlayer/exports.md +29 -0
- package/docs/zh/packages/vite-intlayer/intlayer.md +121 -6
- package/docs/zh/packages/vite-intlayer/intlayerPrune.md +79 -6
- package/docs/zh/releases/v9.md +12 -0
- package/docs/zh/self_hosting.md +60 -50
- package/docs/zh-TW/intlayer_with_angular_21.md +7 -7
- package/package.json +6 -6
- package/src/generated/blog.entry.ts +27 -27
- package/src/generated/docs.entry.ts +234 -214
- package/src/generated/frequentQuestions.entry.ts +17 -17
- package/src/generated/legal.entry.ts +2 -2
package/docs/id/formatters.md
CHANGED
|
@@ -137,45 +137,40 @@ const MyComponent = () => {
|
|
|
137
137
|
};
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
### Hook `useIntl`
|
|
141
141
|
|
|
142
|
-
`
|
|
142
|
+
Hook `useIntl` menyediakan akses langsung ke objek `Intl` yang terikat pada locale. Ini berguna ketika Anda memerlukan API `Intl` lengkap (misalnya, `DisplayNames`, `Collator`, `PluralRules`) dengan injeksi locale otomatis.
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
- Caching dilakukan per proses dan transparan bagi pemanggil.
|
|
144
|
+
```tsx
|
|
145
|
+
import { useIntl } from "react-intlayer/format";
|
|
147
146
|
|
|
148
|
-
|
|
147
|
+
const MyComponent = () => {
|
|
148
|
+
const intl = useIntl(); // menggunakan locale konteks
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
// API Intl standar, tetapi locale disuntikkan secara otomatis ketika undefined
|
|
151
|
+
const formatted = new intl.NumberFormat(undefined, {
|
|
152
|
+
style: "currency",
|
|
153
|
+
currency: "USD",
|
|
154
|
+
}).format(123.45);
|
|
151
155
|
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
// Anda masih dapat menimpa locale jika diperlukan
|
|
157
|
+
const date = new intl.DateTimeFormat("fr-FR").format(new Date());
|
|
154
158
|
|
|
155
|
-
//
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
currency: "GBP",
|
|
159
|
-
});
|
|
160
|
-
numberFormat.format(1234.5); // "£1,234.50"
|
|
159
|
+
// Akses fitur Intl lainnya
|
|
160
|
+
const displayNames = new intl.DisplayNames(undefined, { type: "language" });
|
|
161
|
+
const languageName = displayNames.of("fr"); // "French" (atau terlokalisasi)
|
|
161
162
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
// Aturan jamak
|
|
171
|
-
const pluralRules = new Intl.PluralRules("fr");
|
|
172
|
-
pluralRules.select(1); // "one"
|
|
173
|
-
pluralRules.select(2); // "other"
|
|
163
|
+
return (
|
|
164
|
+
<div>
|
|
165
|
+
<p>{formatted}</p>
|
|
166
|
+
<p>{date}</p>
|
|
167
|
+
<p>{languageName}</p>
|
|
168
|
+
</div>
|
|
169
|
+
);
|
|
170
|
+
};
|
|
174
171
|
```
|
|
175
172
|
|
|
176
|
-
##
|
|
177
|
-
|
|
178
|
-
Selain pembantu formatter, Anda juga dapat menggunakan pembungkus Intl yang di-cache secara langsung untuk fitur Intl lainnya:
|
|
173
|
+
## Vue Formatters
|
|
179
174
|
|
|
180
175
|
### `Intl.DisplayNames`
|
|
181
176
|
|
|
@@ -281,6 +276,189 @@ pluralRules.select(3); // "few"
|
|
|
281
276
|
pluralRules.select(11); // "many"
|
|
282
277
|
```
|
|
283
278
|
|
|
279
|
+
### Fungsi Formatter
|
|
280
|
+
|
|
281
|
+
#### `number(value, options?)`
|
|
282
|
+
|
|
283
|
+
Memformat nilai numerik menggunakan pengelompokan dan desimal yang menyadari lokal.
|
|
284
|
+
|
|
285
|
+
- **value**: `number | string`
|
|
286
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
287
|
+
|
|
288
|
+
```ts
|
|
289
|
+
number(123456.789); // "123,456.789" (in en-US)
|
|
290
|
+
number("1000000", { locale: "fr" }); // "1 000 000"
|
|
291
|
+
number(1234.5, { minimumFractionDigits: 2 }); // "1,234.50"
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
#### `percentage(value, options?)`
|
|
295
|
+
|
|
296
|
+
Memformat angka sebagai string persentase. Nilai lebih besar dari 1 dinormalisasi (misalnya, `25` → `25%`, `0.25` → `25%`).
|
|
297
|
+
|
|
298
|
+
- **value**: `number | string`
|
|
299
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
300
|
+
|
|
301
|
+
```ts
|
|
302
|
+
percentage(0.25); // "25%"
|
|
303
|
+
percentage(25); // "25%"
|
|
304
|
+
percentage(0.237, { minimumFractionDigits: 1 }); // "23.7%"
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
#### `currency(value, options?)`
|
|
308
|
+
|
|
309
|
+
Memformat nilai sebagai mata uang yang dilokalisasi. Default ke `USD`.
|
|
310
|
+
|
|
311
|
+
- **value**: `number | string`
|
|
312
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
313
|
+
- Common: `currency`, `currencyDisplay` (`"symbol" | "code" | "name"`)
|
|
314
|
+
|
|
315
|
+
```ts
|
|
316
|
+
currency(1234.5, { currency: "EUR" }); // "€1,234.50"
|
|
317
|
+
currency("5000", { locale: "fr", currency: "CAD", currencyDisplay: "code" }); // "5 000,00 CAD"
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
#### `date(date, optionsOrPreset?)`
|
|
321
|
+
|
|
322
|
+
Memformat nilai tanggal/waktu.
|
|
323
|
+
|
|
324
|
+
- **date**: `Date | string | number`
|
|
325
|
+
- **optionsOrPreset**: `Intl.DateTimeFormatOptions & { locale?: LocalesValues }` atau preset: `"short" | "long" | "dateOnly" | "timeOnly" | "full"`
|
|
326
|
+
|
|
327
|
+
```ts
|
|
328
|
+
date(new Date(), "short"); // misalnya, "08/02/25, 14:30"
|
|
329
|
+
date("2025-08-02T14:30:00Z", { locale: "fr", month: "long", day: "numeric" }); // "2 août"
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
#### `relativeTime(from, to?, options?)`
|
|
333
|
+
|
|
334
|
+
Memformat waktu relatif antara dua momen.
|
|
335
|
+
|
|
336
|
+
- **from**: `Date | string | number`
|
|
337
|
+
- **to**: `Date | string | number` (default ke `new Date()`)
|
|
338
|
+
- **options**: `{ locale?, unit?, numeric?, style? }`
|
|
339
|
+
|
|
340
|
+
```ts
|
|
341
|
+
const now = new Date();
|
|
342
|
+
const in3Days = new Date(now.getTime() + 3 * 864e5);
|
|
343
|
+
relativeTime(now, in3Days, { unit: "day" }); // "dalam 3 hari"
|
|
344
|
+
|
|
345
|
+
const twoHoursAgo = new Date(now.getTime() - 2 * 3600e3);
|
|
346
|
+
relativeTime(now, twoHoursAgo, { unit: "hour", numeric: "auto" }); // "2 jam yang lalu"
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
#### `units(value, options?)`
|
|
350
|
+
|
|
351
|
+
Memformat nilai numerik dengan unit.
|
|
352
|
+
|
|
353
|
+
- **value**: `number | string`
|
|
354
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
355
|
+
- Common: `unit` (e.g., `"kilometer"`, `"byte"`), `unitDisplay` (`"short" | "narrow" | "long"`)
|
|
356
|
+
|
|
357
|
+
```ts
|
|
358
|
+
units(5, { unit: "kilometer", unitDisplay: "long", locale: "en-GB" }); // "5 kilometers"
|
|
359
|
+
units(1024, { unit: "byte", unitDisplay: "narrow" }); // "1,024B"
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
#### `compact(value, options?)`
|
|
363
|
+
|
|
364
|
+
Memformat angka menggunakan notasi kompak.
|
|
365
|
+
|
|
366
|
+
- **value**: `number | string`
|
|
367
|
+
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
368
|
+
|
|
369
|
+
```ts
|
|
370
|
+
compact(1200); // "1.2K"
|
|
371
|
+
compact("1000000", { locale: "fr", compactDisplay: "long" }); // "1 million"
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
#### `list(values, options?)`
|
|
375
|
+
|
|
376
|
+
Memformat array menjadi string list yang terlokalisasi.
|
|
377
|
+
|
|
378
|
+
- **values**: `(string | number)[]`
|
|
379
|
+
- **options**: `Intl.ListFormatOptions & { locale?: LocalesValues }`
|
|
380
|
+
- Common: `type` (`"conjunction" | "disjunction" | "unit"`), `style` (`"long" | "short" | "narrow"`)
|
|
381
|
+
|
|
382
|
+
```ts
|
|
383
|
+
list(["apple", "banana", "orange"]); // "apple, banana, and orange"
|
|
384
|
+
list(["red", "green", "blue"], { locale: "fr", type: "disjunction" }); // "rouge, vert ou bleu"
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
## Cached Intl
|
|
388
|
+
|
|
389
|
+
`Intl` yang diekspor dari `intlayer` adalah wrapper yang di-cache di sekitar `Intl` global. Ini memoizes instance formatter (`NumberFormat`, `DateTimeFormat`, dll.) untuk menghindari pengulangan konstruksinya, meningkatkan performance.
|
|
390
|
+
|
|
391
|
+
```ts
|
|
392
|
+
import { Intl } from "intlayer";
|
|
393
|
+
|
|
394
|
+
// Pemformatan angka
|
|
395
|
+
const numberFormat = new Intl.NumberFormat("en-GB", {
|
|
396
|
+
style: "currency",
|
|
397
|
+
currency: "GBP",
|
|
398
|
+
});
|
|
399
|
+
numberFormat.format(1234.5); // "£1,234.50"
|
|
400
|
+
|
|
401
|
+
// Nama tampilan untuk bahasa, region, dll.
|
|
402
|
+
const displayNames = new Intl.DisplayNames("fr", { type: "language" });
|
|
403
|
+
displayNames.of("en"); // "anglais"
|
|
404
|
+
|
|
405
|
+
// Collation untuk pengurutan
|
|
406
|
+
const collator = new Intl.Collator("fr", { sensitivity: "base" });
|
|
407
|
+
collator.compare("é", "e"); // 0 (equal)
|
|
408
|
+
|
|
409
|
+
// Aturan plural
|
|
410
|
+
const pluralRules = new Intl.PluralRules("fr");
|
|
411
|
+
pluralRules.select(1); // "one"
|
|
412
|
+
pluralRules.select(2); // "other"
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### Fitur Intl Tambahan
|
|
416
|
+
|
|
417
|
+
#### `Intl.DisplayNames`
|
|
418
|
+
|
|
419
|
+
Untuk nama-nama terlokalisasi dari bahasa, region, mata uang, dan skrip:
|
|
420
|
+
|
|
421
|
+
```ts
|
|
422
|
+
import { Intl } from "intlayer";
|
|
423
|
+
|
|
424
|
+
const languageNames = new Intl.DisplayNames("en", { type: "language" });
|
|
425
|
+
languageNames.of("fr"); // "French"
|
|
426
|
+
|
|
427
|
+
const regionNames = new Intl.DisplayNames("fr", { type: "region" });
|
|
428
|
+
regionNames.of("US"); // "États-Unis"
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
#### `Intl.Collator`
|
|
432
|
+
|
|
433
|
+
Untuk perbandingan dan pengurutan string yang peka terhadap locale:
|
|
434
|
+
|
|
435
|
+
```ts
|
|
436
|
+
import { Intl } from "intlayer";
|
|
437
|
+
|
|
438
|
+
const collator = new Intl.Collator("de", {
|
|
439
|
+
sensitivity: "base",
|
|
440
|
+
numeric: true,
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
const words = ["äpfel", "zebra", "100", "20"];
|
|
444
|
+
words.sort(collator.compare); // ["20", "100", "äpfel", "zebra"]
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
#### `Intl.PluralRules`
|
|
448
|
+
|
|
449
|
+
Untuk menentukan bentuk plural dalam lokal yang berbeda:
|
|
450
|
+
|
|
451
|
+
```ts
|
|
452
|
+
import { Intl } from "intlayer";
|
|
453
|
+
|
|
454
|
+
const pluralRules = new Intl.PluralRules("ar");
|
|
455
|
+
pluralRules.select(0); // "zero"
|
|
456
|
+
pluralRules.select(1); // "one"
|
|
457
|
+
pluralRules.select(2); // "two"
|
|
458
|
+
pluralRules.select(3); // "few"
|
|
459
|
+
pluralRules.select(11); // "many"
|
|
460
|
+
```
|
|
461
|
+
|
|
284
462
|
## Utilitas Locale
|
|
285
463
|
|
|
286
464
|
### `getLocaleName(displayLocale, targetLocale?)`
|
|
@@ -419,8 +597,6 @@ const content = getTranslation(
|
|
|
419
597
|
- **locale**: Locale target (default ke locale default yang dikonfigurasi)
|
|
420
598
|
- **fallback**: Apakah akan kembali ke locale default (default true)
|
|
421
599
|
|
|
422
|
-
### Fitur Intl Tambahan
|
|
423
|
-
|
|
424
600
|
### `getIntlayer(dictionaryKey, locale?, plugins?)`
|
|
425
601
|
|
|
426
602
|
Mengambil dan mengubah konten dari kamus berdasarkan kunci:
|
|
@@ -436,281 +612,8 @@ const nestedContent = getIntlayer("common", "fr", customPlugins);
|
|
|
436
612
|
- **locale**: Locale opsional (default ke locale default yang dikonfigurasi)
|
|
437
613
|
- **plugins**: Array opsional dari plugin transformasi kustom
|
|
438
614
|
|
|
439
|
-
## Formatter
|
|
440
|
-
|
|
441
|
-
Semua helper di bawah ini diekspor dari `intlayer`.
|
|
442
|
-
|
|
443
|
-
### `number(value, options?)`
|
|
444
|
-
|
|
445
|
-
Memformat nilai numerik menggunakan pengelompokan dan desimal yang sesuai dengan locale.
|
|
446
|
-
|
|
447
|
-
- **value**: `number | string`
|
|
448
|
-
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
449
|
-
|
|
450
|
-
Contoh:
|
|
451
|
-
|
|
452
|
-
```ts
|
|
453
|
-
import { number } from "intlayer";
|
|
454
|
-
|
|
455
|
-
number(123456.789); // "123,456.789" (dalam en-US)
|
|
456
|
-
number("1000000", { locale: "fr" }); // "1 000 000"
|
|
457
|
-
number(1234.5, { minimumFractionDigits: 2 }); // "1,234.50"
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
### `percentage(value, options?)`
|
|
461
|
-
|
|
462
|
-
Memformat angka sebagai string persentase.
|
|
463
|
-
|
|
464
|
-
Perilaku: nilai yang lebih besar dari 1 diartikan sebagai persentase utuh dan dinormalisasi (misalnya, `25` → `25%`, `0.25` → `25%`).
|
|
465
|
-
|
|
466
|
-
- **value**: `number | string`
|
|
467
|
-
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
468
|
-
|
|
469
|
-
Contoh:
|
|
470
|
-
|
|
471
|
-
```ts
|
|
472
|
-
import { percentage } from "intlayer";
|
|
473
|
-
|
|
474
|
-
percentage(0.25); // "25%"
|
|
475
|
-
percentage(25); // "25%"
|
|
476
|
-
percentage(0.237, { minimumFractionDigits: 1 }); // "23.7%"
|
|
477
|
-
```
|
|
478
|
-
|
|
479
|
-
### `currency(value, options?)`
|
|
480
|
-
|
|
481
|
-
Memformat nilai sebagai mata uang lokal. Default ke `USD` dengan dua digit pecahan.
|
|
482
|
-
|
|
483
|
-
- **value**: `number | string`
|
|
484
|
-
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
485
|
-
- Field umum: `currency` (misalnya, `"EUR"`), `currencyDisplay` (`"symbol" | "code" | "name"`)
|
|
486
|
-
|
|
487
|
-
Contoh:
|
|
488
|
-
|
|
489
|
-
```ts
|
|
490
|
-
import { currency } from "intlayer";
|
|
491
|
-
|
|
492
|
-
currency(1234.5, { currency: "EUR" }); // "€1,234.50"
|
|
493
|
-
currency("5000", { locale: "fr", currency: "CAD", currencyDisplay: "code" }); // "5 000,00 CAD"
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
### `date(date, optionsOrPreset?)`
|
|
497
|
-
|
|
498
|
-
Memformat nilai tanggal/waktu dengan `Intl.DateTimeFormat`.
|
|
499
|
-
|
|
500
|
-
- **date**: `Date | string | number`
|
|
501
|
-
- **optionsOrPreset**: `Intl.DateTimeFormatOptions & { locale?: LocalesValues }` atau salah satu preset:
|
|
502
|
-
- Preset: `"short" | "long" | "dateOnly" | "timeOnly" | "full"`
|
|
503
|
-
|
|
504
|
-
Contoh:
|
|
505
|
-
|
|
506
|
-
```ts
|
|
507
|
-
import { date } from "intlayer";
|
|
508
|
-
|
|
509
|
-
date(new Date(), "short"); // misalnya, "08/02/25, 14:30"
|
|
510
|
-
date("2025-08-02T14:30:00Z", { locale: "fr", month: "long", day: "numeric" }); // "2 août"
|
|
511
|
-
```
|
|
512
|
-
|
|
513
|
-
### `relativeTime(from, to = new Date(), options?)`
|
|
514
|
-
|
|
515
|
-
Memformat waktu relatif antara dua momen dengan `Intl.RelativeTimeFormat`.
|
|
516
|
-
|
|
517
|
-
- Berikan "now" sebagai argumen pertama dan target sebagai argumen kedua untuk mendapatkan frasa yang alami.
|
|
518
|
-
- **from**: `Date | string | number`
|
|
519
|
-
- **to**: `Date | string | number` (defaultnya `new Date()`)
|
|
520
|
-
- **options**: `{ locale?: LocalesValues; unit?: Intl.RelativeTimeFormatUnit; numeric?: Intl.RelativeTimeFormatNumeric; style?: Intl.RelativeTimeFormatStyle }`
|
|
521
|
-
- Default `unit` adalah `"second"`.
|
|
522
|
-
|
|
523
|
-
Contoh:
|
|
524
|
-
|
|
525
|
-
```ts
|
|
526
|
-
import { relativeTime } from "intlayer";
|
|
527
|
-
|
|
528
|
-
const now = new Date();
|
|
529
|
-
const in3Days = new Date(now.getTime() + 3 * 864e5);
|
|
530
|
-
relativeTime(now, in3Days, { unit: "day" }); // "dalam 3 hari"
|
|
531
|
-
|
|
532
|
-
const twoHoursAgo = new Date(now.getTime() - 2 * 3600e3);
|
|
533
|
-
relativeTime(now, twoHoursAgo, { unit: "hour", numeric: "auto" }); // "2 jam yang lalu"
|
|
534
|
-
```
|
|
535
|
-
|
|
536
|
-
### `units(value, options?)`
|
|
537
|
-
|
|
538
|
-
Memformat nilai numerik sebagai string unit yang dilokalkan menggunakan `Intl.NumberFormat` dengan `style: 'unit'`.
|
|
539
|
-
|
|
540
|
-
- **value**: `number | string`
|
|
541
|
-
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }`
|
|
542
|
-
- Field umum: `unit` (misalnya, `"kilometer"`, `"byte"`), `unitDisplay` (`"short" | "narrow" | "long"`)
|
|
543
|
-
- Default: `unit: 'day'`, `unitDisplay: 'short'`, `useGrouping: false`
|
|
544
|
-
|
|
545
|
-
Contoh:
|
|
546
|
-
|
|
547
|
-
```ts
|
|
548
|
-
import { units } from "intlayer";
|
|
549
|
-
|
|
550
|
-
units(5, { unit: "kilometer", unitDisplay: "long", locale: "en-GB" }); // "5 kilometers"
|
|
551
|
-
units(1024, { unit: "byte", unitDisplay: "narrow" }); // "1,024B" (tergantung locale)
|
|
552
|
-
```
|
|
553
|
-
|
|
554
|
-
### `compact(value, options?)`
|
|
555
|
-
|
|
556
|
-
Memformat angka menggunakan notasi ringkas (misalnya, `1.2K`, `1M`).
|
|
557
|
-
|
|
558
|
-
- **value**: `number | string`
|
|
559
|
-
- **options**: `Intl.NumberFormatOptions & { locale?: LocalesValues }` (menggunakan `notation: 'compact'` secara internal)
|
|
560
|
-
|
|
561
|
-
Contoh:
|
|
562
|
-
|
|
563
|
-
```ts
|
|
564
|
-
import { compact } from "intlayer";
|
|
565
|
-
|
|
566
|
-
compact(1200); // "1.2K"
|
|
567
|
-
compact("1000000", { locale: "fr", compactDisplay: "long" }); // "1 juta"
|
|
568
|
-
```
|
|
569
|
-
|
|
570
|
-
### `list(values, options?)`
|
|
571
|
-
|
|
572
|
-
Memformat array nilai menjadi string daftar yang dilokalkan menggunakan `Intl.ListFormat`.
|
|
573
|
-
|
|
574
|
-
- **values**: `(string | number)[]`
|
|
575
|
-
- **options**: `Intl.ListFormatOptions & { locale?: LocalesValues }`
|
|
576
|
-
- Field umum: `type` (`"conjunction" | "disjunction" | "unit"`), `style` (`"long" | "short" | "narrow"`)
|
|
577
|
-
- Default: `type: 'conjunction'`, `style: 'long'`
|
|
578
|
-
|
|
579
|
-
Contoh:
|
|
580
|
-
|
|
581
|
-
```ts
|
|
582
|
-
import { list } from "intlayer";
|
|
583
|
-
|
|
584
|
-
list(["apple", "banana", "orange"]); // "apple, banana, dan orange"
|
|
585
|
-
list(["red", "green", "blue"], { locale: "fr", type: "disjunction" }); // "rouge, vert ou bleu"
|
|
586
|
-
list([1, 2, 3], { type: "unit" }); // "1, 2, 3"
|
|
587
|
-
```
|
|
588
|
-
|
|
589
|
-
## Utilitas Penanganan Konten
|
|
590
|
-
|
|
591
615
|
## Catatan
|
|
592
616
|
|
|
593
617
|
- Semua helper menerima input `string`; secara internal akan dikonversi menjadi angka atau tanggal.
|
|
594
618
|
- Locale default adalah `internationalization.defaultLocale` yang telah Anda konfigurasi jika tidak disediakan.
|
|
595
619
|
- Utilitas ini adalah pembungkus tipis; untuk pemformatan lanjutan, gunakan opsi standar `Intl`.
|
|
596
|
-
|
|
597
|
-
## Titik masuk dan ekspor ulang (`@index.ts`)
|
|
598
|
-
|
|
599
|
-
Formatter berada di paket inti dan diekspor ulang dari paket tingkat atas untuk menjaga impor tetap ergonomis di berbagai runtime:
|
|
600
|
-
|
|
601
|
-
Contoh:
|
|
602
|
-
|
|
603
|
-
```ts
|
|
604
|
-
// Kode aplikasi (direkomendasikan)
|
|
605
|
-
import {
|
|
606
|
-
number,
|
|
607
|
-
currency,
|
|
608
|
-
date,
|
|
609
|
-
relativeTime,
|
|
610
|
-
units,
|
|
611
|
-
compact,
|
|
612
|
-
list,
|
|
613
|
-
Intl,
|
|
614
|
-
getLocaleName,
|
|
615
|
-
getLocaleLang,
|
|
616
|
-
getLocaleFromPath,
|
|
617
|
-
getPathWithoutLocale,
|
|
618
|
-
getLocalizedUrl,
|
|
619
|
-
getHTMLTextDir,
|
|
620
|
-
getContent,
|
|
621
|
-
getTranslation,
|
|
622
|
-
getIntlayer,
|
|
623
|
-
} from "intlayer";
|
|
624
|
-
```
|
|
625
|
-
|
|
626
|
-
### React
|
|
627
|
-
|
|
628
|
-
Komponen klien:
|
|
629
|
-
|
|
630
|
-
```tsx
|
|
631
|
-
import {
|
|
632
|
-
useNumber,
|
|
633
|
-
useCurrency,
|
|
634
|
-
useDate,
|
|
635
|
-
usePercentage,
|
|
636
|
-
useCompact,
|
|
637
|
-
useList,
|
|
638
|
-
useRelativeTime,
|
|
639
|
-
useUnit,
|
|
640
|
-
} from "react-intlayer/format";
|
|
641
|
-
// atau di aplikasi Preact
|
|
642
|
-
// "preact-intlayer/format";
|
|
643
|
-
// atau di aplikasi Next.js
|
|
644
|
-
// "next-intlayer/client/format";
|
|
645
|
-
|
|
646
|
-
const MyComponent = () => {
|
|
647
|
-
const number = useNumber();
|
|
648
|
-
const currency = useCurrency();
|
|
649
|
-
const date = useDate();
|
|
650
|
-
const percentage = usePercentage();
|
|
651
|
-
const compact = useCompact();
|
|
652
|
-
const list = useList();
|
|
653
|
-
const relativeTime = useRelativeTime();
|
|
654
|
-
const unit = useUnit();
|
|
655
|
-
|
|
656
|
-
return (
|
|
657
|
-
<div>
|
|
658
|
-
<p>{number(123456.789)}</p>
|
|
659
|
-
<p>{currency(1234.5, { currency: "EUR" })}</p>
|
|
660
|
-
<p>{date(new Date(), "short")}</p>
|
|
661
|
-
<p>{percentage(0.25)}</p>
|
|
662
|
-
<p>{compact(1200)}</p>
|
|
663
|
-
<p>{list(["apel", "pisang", "jeruk"])}</p>
|
|
664
|
-
<p>{relativeTime(new Date(), new Date() + 1000)}</p>
|
|
665
|
-
<p>{unit(123456.789, { unit: "kilometer" })}</p>
|
|
666
|
-
</div>
|
|
667
|
-
);
|
|
668
|
-
};
|
|
669
|
-
```
|
|
670
|
-
|
|
671
|
-
Komponen server (atau runtime React Server):
|
|
672
|
-
|
|
673
|
-
```ts
|
|
674
|
-
import {
|
|
675
|
-
useNumber,
|
|
676
|
-
useCurrency,
|
|
677
|
-
useDate,
|
|
678
|
-
usePercentage,
|
|
679
|
-
useCompact,
|
|
680
|
-
useList,
|
|
681
|
-
useRelativeTime,
|
|
682
|
-
useUnit,
|
|
683
|
-
} from "react-intlayer/server/format";
|
|
684
|
-
// atau di aplikasi Next.js
|
|
685
|
-
import {
|
|
686
|
-
useNumber,
|
|
687
|
-
useCurrency,
|
|
688
|
-
useDate,
|
|
689
|
-
usePercentage,
|
|
690
|
-
useCompact,
|
|
691
|
-
useList,
|
|
692
|
-
useRelativeTime,
|
|
693
|
-
useUnit,
|
|
694
|
-
} from "next-intlayer/server/format";
|
|
695
|
-
```
|
|
696
|
-
|
|
697
|
-
> Hooks tersebut akan mempertimbangkan locale dari `IntlayerProvider` atau `IntlayerServerProvider`
|
|
698
|
-
|
|
699
|
-
### Vue
|
|
700
|
-
|
|
701
|
-
Komponen klien:
|
|
702
|
-
|
|
703
|
-
```ts
|
|
704
|
-
import {
|
|
705
|
-
useNumber,
|
|
706
|
-
useCurrency,
|
|
707
|
-
useDate,
|
|
708
|
-
usePercentage,
|
|
709
|
-
useCompact,
|
|
710
|
-
useList,
|
|
711
|
-
useRelativeTime,
|
|
712
|
-
useUnit,
|
|
713
|
-
} from "vue-intlayer/format";
|
|
714
|
-
```
|
|
715
|
-
|
|
716
|
-
> Composables tersebut akan mempertimbangkan locale dari `IntlayerProvider` yang di-inject
|