@intlayer/docs 7.0.6 → 7.0.8-canary.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/i18n_using_next-i18next.md +1068 -0
- package/blog/ar/i18n_using_next-intl.md +768 -0
- package/blog/ar/intlayer_with_react-intl.md +0 -4
- package/blog/ar/next-i18next_vs_next-intl_vs_intlayer.md +5 -4
- package/blog/de/i18n_using_next-i18next.md +1107 -0
- package/blog/de/i18n_using_next-intl.md +760 -0
- package/blog/de/intlayer_with_react-intl.md +0 -4
- package/blog/de/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
- package/blog/en/i18n_using_next-i18next.md +1073 -0
- package/blog/en/i18n_using_next-intl.md +757 -0
- package/blog/en/intlayer_with_i18next.md +71 -8
- package/blog/en/intlayer_with_next-i18next.md +71 -8
- package/blog/en/intlayer_with_next-intl.md +71 -8
- package/blog/en/intlayer_with_react-i18next.md +69 -8
- package/blog/en/intlayer_with_react-intl.md +68 -9
- package/blog/en/intlayer_with_vue-i18n.md +68 -7
- package/blog/en/react-i18next_vs_react-intl_vs_intlayer.md +2 -0
- package/blog/en/vue-i18n_vs_intlayer.md +2 -0
- package/blog/en-GB/i18n_using_next-i18next.md +1074 -0
- package/blog/en-GB/i18n_using_next-intl.md +757 -0
- package/blog/en-GB/intlayer_with_i18next.md +15 -6
- package/blog/en-GB/intlayer_with_next-i18next.md +16 -6
- package/blog/en-GB/intlayer_with_next-intl.md +16 -6
- package/blog/en-GB/intlayer_with_react-i18next.md +16 -7
- package/blog/en-GB/intlayer_with_react-intl.md +14 -9
- package/blog/en-GB/intlayer_with_vue-i18n.md +16 -7
- package/blog/en-GB/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
- package/blog/en-GB/react-i18next_vs_react-intl_vs_intlayer.md +2 -0
- package/blog/en-GB/vue-i18n_vs_intlayer.md +2 -0
- package/blog/es/i18n_using_next-i18next.md +1066 -0
- package/blog/es/i18n_using_next-intl.md +757 -0
- package/blog/es/intlayer_with_react-intl.md +0 -4
- package/blog/es/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
- package/blog/fr/i18n_using_next-i18next.md +1078 -0
- package/blog/fr/i18n_using_next-intl.md +759 -0
- package/blog/fr/intlayer_with_react-intl.md +0 -4
- package/blog/fr/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
- package/blog/hi/i18n_using_next-i18next.md +1068 -0
- package/blog/hi/i18n_using_next-intl.md +758 -0
- package/blog/hi/intlayer_with_react-intl.md +0 -4
- package/blog/hi/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
- package/blog/id/i18n_using_next-i18next.md +1078 -0
- package/blog/id/i18n_using_next-intl.md +757 -0
- package/blog/id/index.md +69 -0
- package/blog/id/internationalization_and_SEO.md +364 -0
- package/blog/id/intlayer_with_react-intl.md +0 -4
- package/blog/id/list_i18n_technologies/CMS/drupal.md +143 -0
- package/blog/id/list_i18n_technologies/CMS/wix.md +167 -0
- package/blog/id/list_i18n_technologies/CMS/wordpress.md +188 -0
- package/blog/id/list_i18n_technologies/frameworks/angular.md +125 -0
- package/blog/id/list_i18n_technologies/frameworks/flutter.md +150 -0
- package/blog/id/list_i18n_technologies/frameworks/react-native.md +217 -0
- package/blog/id/list_i18n_technologies/frameworks/react.md +155 -0
- package/blog/id/list_i18n_technologies/frameworks/svelte.md +131 -0
- package/blog/id/list_i18n_technologies/frameworks/vue.md +130 -0
- package/blog/id/next-i18next_vs_next-intl_vs_intlayer.md +1500 -0
- package/blog/id/nextjs-multilingual-seo-comparison.md +361 -0
- package/blog/id/rag_powered_documentation_assistant.md +288 -0
- package/blog/id/react-i18next_vs_react-intl_vs_intlayer.md +164 -0
- package/blog/id/vue-i18n_vs_intlayer.md +278 -0
- package/blog/id/what_is_internationalization.md +166 -0
- package/blog/it/i18n_using_next-i18next.md +1078 -0
- package/blog/it/i18n_using_next-intl.md +758 -0
- package/blog/it/intlayer_with_react-intl.md +0 -4
- package/blog/it/react-i18next_vs_react-intl_vs_intlayer.md +4 -0
- package/blog/it/vue-i18n_vs_intlayer.md +2 -0
- package/blog/ja/i18n_using_next-i18next.md +1078 -0
- package/blog/ja/i18n_using_next-intl.md +758 -0
- package/blog/ja/intlayer_with_react-intl.md +0 -4
- package/blog/ja/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
- package/blog/ko/i18n_using_next-i18next.md +1075 -0
- package/blog/ko/i18n_using_next-intl.md +759 -0
- package/blog/ko/intlayer_with_react-intl.md +0 -4
- package/blog/ko/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
- package/blog/pl/i18n_using_next-i18next.md +1078 -0
- package/blog/pl/i18n_using_next-intl.md +758 -0
- package/blog/pl/index.md +69 -0
- package/blog/pl/internationalization_and_SEO.md +363 -0
- package/blog/pl/intlayer_with_react-intl.md +0 -4
- package/blog/pl/list_i18n_technologies/CMS/drupal.md +143 -0
- package/blog/pl/list_i18n_technologies/CMS/wix.md +167 -0
- package/blog/pl/list_i18n_technologies/CMS/wordpress.md +196 -0
- package/blog/pl/list_i18n_technologies/frameworks/angular.md +125 -0
- package/blog/pl/list_i18n_technologies/frameworks/flutter.md +151 -0
- package/blog/pl/list_i18n_technologies/frameworks/react-native.md +217 -0
- package/blog/pl/list_i18n_technologies/frameworks/react.md +155 -0
- package/blog/pl/list_i18n_technologies/frameworks/svelte.md +131 -0
- package/blog/pl/list_i18n_technologies/frameworks/vue.md +130 -0
- package/blog/pl/next-i18next_vs_next-intl_vs_intlayer.md +1501 -0
- package/blog/pl/nextjs-multilingual-seo-comparison.md +362 -0
- package/blog/pl/rag_powered_documentation_assistant.md +288 -0
- package/blog/pl/react-i18next_vs_react-intl_vs_intlayer.md +164 -0
- package/blog/pl/vue-i18n_vs_intlayer.md +278 -0
- package/blog/pl/what_is_internationalization.md +167 -0
- package/blog/pt/i18n_using_next-i18next.md +1067 -0
- package/blog/pt/i18n_using_next-intl.md +760 -0
- package/blog/pt/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
- package/blog/ru/i18n_using_next-i18next.md +1106 -0
- package/blog/ru/i18n_using_next-intl.md +759 -0
- package/blog/ru/intlayer_with_react-intl.md +0 -4
- package/blog/ru/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
- package/blog/tr/i18n_using_next-i18next.md +1078 -0
- package/blog/tr/i18n_using_next-intl.md +760 -0
- package/blog/tr/intlayer_with_react-intl.md +0 -4
- package/blog/tr/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
- package/blog/tr/react-i18next_vs_react-intl_vs_intlayer.md +2 -0
- package/blog/tr/vue-i18n_vs_intlayer.md +2 -0
- package/blog/vi/i18n_using_next-i18next.md +1080 -0
- package/blog/vi/i18n_using_next-intl.md +758 -0
- package/blog/vi/index.md +69 -0
- package/blog/vi/internationalization_and_SEO.md +363 -0
- package/blog/vi/intlayer_with_react-intl.md +0 -4
- package/blog/vi/list_i18n_technologies/CMS/drupal.md +143 -0
- package/blog/vi/list_i18n_technologies/CMS/wix.md +167 -0
- package/blog/vi/list_i18n_technologies/CMS/wordpress.md +188 -0
- package/blog/vi/list_i18n_technologies/frameworks/angular.md +125 -0
- package/blog/vi/list_i18n_technologies/frameworks/flutter.md +150 -0
- package/blog/vi/list_i18n_technologies/frameworks/react-native.md +217 -0
- package/blog/vi/list_i18n_technologies/frameworks/react.md +155 -0
- package/blog/vi/list_i18n_technologies/frameworks/svelte.md +131 -0
- package/blog/vi/list_i18n_technologies/frameworks/vue.md +130 -0
- package/blog/vi/next-i18next_vs_next-intl_vs_intlayer.md +1520 -0
- package/blog/vi/nextjs-multilingual-seo-comparison.md +362 -0
- package/blog/vi/rag_powered_documentation_assistant.md +288 -0
- package/blog/vi/react-i18next_vs_react-intl_vs_intlayer.md +164 -0
- package/blog/vi/vue-i18n_vs_intlayer.md +278 -0
- package/blog/vi/what_is_internationalization.md +168 -0
- package/blog/zh/i18n_using_next-i18next.md +1105 -0
- package/blog/zh/i18n_using_next-intl.md +758 -0
- package/blog/zh/intlayer_with_react-intl.md +0 -4
- package/blog/zh/next-i18next_vs_next-intl_vs_intlayer.md +2 -0
- package/blog/zh/react-i18next_vs_react-intl_vs_intlayer.md +2 -0
- package/dist/cjs/common.cjs +0 -4
- package/dist/cjs/common.cjs.map +1 -1
- package/dist/cjs/generated/blog.entry.cjs +38 -6
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +0 -6
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +0 -6
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +0 -6
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +38 -0
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/types/generated/blog.entry.d.ts +2 -0
- package/dist/types/generated/blog.entry.d.ts.map +1 -1
- package/docs/ar/component_i18n.md +1 -1
- package/docs/ar/configuration.md +6 -0
- package/docs/ar/intlayer_cli.md +8 -3
- package/docs/ar/intlayer_with_next-i18next.md +619 -0
- package/docs/ar/intlayer_with_next-intl.md +446 -0
- package/docs/ar/intlayer_with_nextjs_16.md +21 -0
- package/docs/ar/intlayer_with_tanstack.md +4 -0
- package/docs/ar/intlayer_with_vite+react.md +4 -0
- package/docs/de/component_i18n.md +1 -1
- package/docs/de/configuration.md +6 -0
- package/docs/de/intlayer_cli.md +8 -3
- package/docs/de/intlayer_with_next-i18next.md +627 -0
- package/docs/de/intlayer_with_next-intl.md +451 -0
- package/docs/de/intlayer_with_nextjs_16.md +21 -0
- package/docs/de/intlayer_with_tanstack.md +4 -0
- package/docs/de/intlayer_with_vite+react.md +4 -0
- package/docs/en/component_i18n.md +1 -1
- package/docs/en/intlayer_cli.md +8 -1
- package/docs/en/intlayer_with_astro.md +10 -2
- package/docs/en/intlayer_with_create_react_app.md +8 -0
- package/docs/en/intlayer_with_lynx+react.md +8 -0
- package/docs/en/intlayer_with_nestjs.md +10 -0
- package/docs/en/intlayer_with_nextjs_14.md +10 -2
- package/docs/en/intlayer_with_nextjs_15.md +21 -4
- package/docs/en/intlayer_with_nextjs_16.md +17 -0
- package/docs/en/intlayer_with_nuxt.md +8 -0
- package/docs/en/intlayer_with_react_native+expo.md +10 -2
- package/docs/en/intlayer_with_react_router_v7.md +8 -0
- package/docs/en/intlayer_with_tanstack.md +10 -0
- package/docs/en/intlayer_with_vite+preact.md +10 -2
- package/docs/en/intlayer_with_vite+react.md +21 -4
- package/docs/en/intlayer_with_vite+vue.md +10 -2
- package/docs/en-GB/component_i18n.md +1 -1
- package/docs/en-GB/configuration.md +6 -0
- package/docs/en-GB/intlayer_cli.md +8 -3
- package/docs/en-GB/intlayer_with_angular.md +4 -4
- package/docs/en-GB/intlayer_with_express.md +4 -4
- package/docs/en-GB/intlayer_with_lynx+react.md +12 -12
- package/{blog/en/_intlayer_with_next-i18next.md → docs/en-GB/intlayer_with_next-i18next.md} +241 -42
- package/{blog/en/_intlayer_with_next-intl.md → docs/en-GB/intlayer_with_next-intl.md} +144 -29
- package/docs/en-GB/intlayer_with_nextjs_16.md +21 -0
- package/docs/en-GB/intlayer_with_tanstack.md +5 -1
- package/docs/en-GB/intlayer_with_vite+react.md +4 -0
- package/docs/en-GB/packages/next-intlayer/t.md +2 -2
- package/docs/es/component_i18n.md +1 -1
- package/docs/es/configuration.md +6 -0
- package/docs/es/intlayer_cli.md +8 -3
- package/docs/es/intlayer_with_next-i18next.md +628 -0
- package/docs/es/intlayer_with_next-intl.md +446 -0
- package/docs/es/intlayer_with_nextjs_16.md +21 -0
- package/docs/es/intlayer_with_tanstack.md +4 -0
- package/docs/es/intlayer_with_vite+react.md +4 -0
- package/docs/fr/configuration.md +6 -0
- package/docs/fr/intlayer_cli.md +8 -3
- package/docs/fr/intlayer_with_next-i18next.md +628 -0
- package/docs/fr/intlayer_with_next-intl.md +446 -0
- package/docs/fr/intlayer_with_nextjs_16.md +23 -2
- package/docs/fr/intlayer_with_tanstack.md +4 -0
- package/docs/fr/intlayer_with_vite+react.md +4 -0
- package/docs/hi/component_i18n.md +1 -1
- package/docs/hi/configuration.md +6 -0
- package/docs/hi/intlayer_cli.md +8 -0
- package/docs/hi/intlayer_with_next-i18next.md +628 -0
- package/docs/hi/intlayer_with_next-intl.md +446 -0
- package/docs/hi/intlayer_with_nextjs_16.md +21 -0
- package/docs/hi/intlayer_with_tanstack.md +4 -0
- package/docs/hi/intlayer_with_vite+react.md +4 -0
- package/docs/id/CI_CD.md +198 -0
- package/docs/id/autoFill.md +284 -0
- package/docs/id/component_i18n.md +186 -0
- package/docs/id/configuration.md +710 -0
- package/docs/id/dictionary/condition.md +231 -0
- package/docs/id/dictionary/content_file.md +1092 -0
- package/docs/id/dictionary/enumeration.md +245 -0
- package/docs/id/dictionary/file.md +237 -0
- package/docs/id/dictionary/function_fetching.md +214 -0
- package/docs/id/dictionary/gender.md +273 -0
- package/docs/id/dictionary/insertion.md +192 -0
- package/docs/id/dictionary/markdown.md +381 -0
- package/docs/id/dictionary/nesting.md +273 -0
- package/docs/id/dictionary/translation.md +310 -0
- package/docs/id/formatters.md +596 -0
- package/docs/id/how_works_intlayer.md +256 -0
- package/docs/id/index.md +176 -0
- package/docs/id/interest_of_intlayer.md +293 -0
- package/docs/id/intlayer_CMS.md +549 -0
- package/docs/id/intlayer_cli.md +850 -0
- package/docs/id/intlayer_visual_editor.md +288 -0
- package/docs/id/intlayer_with_angular.md +694 -0
- package/docs/id/intlayer_with_astro.md +252 -0
- package/docs/id/intlayer_with_create_react_app.md +1233 -0
- package/docs/id/intlayer_with_express.md +411 -0
- package/docs/id/intlayer_with_lynx+react.md +518 -0
- package/docs/id/intlayer_with_nestjs.md +272 -0
- package/docs/id/intlayer_with_next-i18next.md +628 -0
- package/docs/id/intlayer_with_next-intl.md +446 -0
- package/docs/id/intlayer_with_nextjs_14.md +1617 -0
- package/docs/id/intlayer_with_nextjs_15.md +1698 -0
- package/docs/id/intlayer_with_nextjs_16.md +21 -0
- package/docs/id/intlayer_with_nextjs_page_router.md +1478 -0
- package/docs/id/intlayer_with_nuxt.md +808 -0
- package/docs/id/intlayer_with_react_native+expo.md +699 -0
- package/docs/id/intlayer_with_react_router_v7.md +496 -0
- package/docs/id/intlayer_with_tanstack.md +564 -0
- package/docs/id/intlayer_with_vite+preact.md +1737 -0
- package/docs/id/intlayer_with_vite+react.md +1413 -0
- package/docs/id/intlayer_with_vite+solid.md +289 -0
- package/docs/id/intlayer_with_vite+svelte.md +289 -0
- package/docs/id/intlayer_with_vite+vue.md +1088 -0
- package/docs/id/introduction.md +218 -0
- package/docs/id/locale_mapper.md +242 -0
- package/docs/id/mcp_server.md +211 -0
- package/docs/id/packages/express-intlayer/t.md +458 -0
- package/docs/id/packages/intlayer/getConfiguration.md +145 -0
- package/docs/id/packages/intlayer/getEnumeration.md +159 -0
- package/docs/id/packages/intlayer/getHTMLTextDir.md +122 -0
- package/docs/id/packages/intlayer/getLocaleLang.md +81 -0
- package/docs/id/packages/intlayer/getLocaleName.md +119 -0
- package/docs/id/packages/intlayer/getLocalizedUrl.md +309 -0
- package/docs/id/packages/intlayer/getMultilingualUrls.md +223 -0
- package/docs/id/packages/intlayer/getPathWithoutLocale.md +75 -0
- package/docs/id/packages/intlayer/getTranslation.md +190 -0
- package/docs/id/packages/intlayer/getTranslationContent.md +188 -0
- package/docs/id/packages/next-intlayer/t.md +352 -0
- package/docs/id/packages/next-intlayer/useDictionary.md +271 -0
- package/docs/id/packages/next-intlayer/useIntlayer.md +264 -0
- package/docs/id/packages/next-intlayer/useLocale.md +166 -0
- package/docs/id/packages/react-intlayer/t.md +303 -0
- package/docs/id/packages/react-intlayer/useDictionary.md +287 -0
- package/docs/id/packages/react-intlayer/useI18n.md +267 -0
- package/docs/id/packages/react-intlayer/useIntlayer.md +254 -0
- package/docs/id/packages/react-intlayer/useLocale.md +210 -0
- package/docs/id/per_locale_file.md +323 -0
- package/docs/id/readme.md +261 -0
- package/docs/id/releases/v6.md +305 -0
- package/docs/id/roadmap.md +362 -0
- package/docs/id/testing.md +202 -0
- package/docs/id/vs_code_extension.md +126 -0
- package/docs/it/component_i18n.md +1 -1
- package/docs/it/configuration.md +6 -0
- package/docs/it/intlayer_cli.md +8 -3
- package/docs/it/intlayer_with_next-i18next.md +628 -0
- package/docs/it/intlayer_with_next-intl.md +446 -0
- package/docs/it/intlayer_with_nextjs_16.md +21 -0
- package/docs/it/intlayer_with_tanstack.md +4 -0
- package/docs/it/intlayer_with_vite+react.md +4 -0
- package/docs/ja/component_i18n.md +1 -1
- package/docs/ja/configuration.md +6 -0
- package/docs/ja/intlayer_cli.md +8 -3
- package/docs/ja/intlayer_with_next-i18next.md +627 -0
- package/docs/ja/intlayer_with_next-intl.md +446 -0
- package/docs/ja/intlayer_with_nextjs_16.md +21 -0
- package/docs/ja/intlayer_with_tanstack.md +4 -0
- package/docs/ja/intlayer_with_vite+react.md +4 -0
- package/docs/ko/configuration.md +6 -0
- package/docs/ko/intlayer_cli.md +8 -3
- package/docs/ko/intlayer_with_next-i18next.md +627 -0
- package/docs/ko/intlayer_with_next-intl.md +446 -0
- package/docs/ko/intlayer_with_nextjs_16.md +21 -0
- package/docs/ko/intlayer_with_tanstack.md +4 -0
- package/docs/ko/intlayer_with_vite+react.md +4 -0
- package/docs/pl/CI_CD.md +198 -0
- package/docs/pl/autoFill.md +284 -0
- package/docs/pl/component_i18n.md +186 -0
- package/docs/pl/configuration.md +710 -0
- package/docs/pl/dictionary/condition.md +232 -0
- package/docs/pl/dictionary/content_file.md +1130 -0
- package/docs/pl/dictionary/enumeration.md +245 -0
- package/docs/pl/dictionary/file.md +234 -0
- package/docs/pl/dictionary/function_fetching.md +214 -0
- package/docs/pl/dictionary/gender.md +276 -0
- package/docs/pl/dictionary/insertion.md +188 -0
- package/docs/pl/dictionary/markdown.md +408 -0
- package/docs/pl/dictionary/nesting.md +273 -0
- package/docs/pl/dictionary/translation.md +310 -0
- package/docs/pl/formatters.md +596 -0
- package/docs/pl/how_works_intlayer.md +256 -0
- package/docs/pl/index.md +176 -0
- package/docs/pl/interest_of_intlayer.md +291 -0
- package/docs/pl/intlayer_CMS.md +549 -0
- package/docs/pl/intlayer_cli.md +857 -0
- package/docs/pl/intlayer_visual_editor.md +288 -0
- package/docs/pl/intlayer_with_angular.md +690 -0
- package/docs/pl/intlayer_with_astro.md +280 -0
- package/docs/pl/intlayer_with_create_react_app.md +1235 -0
- package/docs/pl/intlayer_with_express.md +411 -0
- package/docs/pl/intlayer_with_lynx+react.md +518 -0
- package/docs/pl/intlayer_with_nestjs.md +272 -0
- package/docs/pl/intlayer_with_next-i18next.md +628 -0
- package/docs/pl/intlayer_with_next-intl.md +446 -0
- package/docs/pl/intlayer_with_nextjs_14.md +1594 -0
- package/docs/pl/intlayer_with_nextjs_15.md +1701 -0
- package/docs/pl/intlayer_with_nextjs_16.md +21 -0
- package/docs/pl/intlayer_with_nextjs_page_router.md +1513 -0
- package/docs/pl/intlayer_with_nuxt.md +885 -0
- package/docs/pl/intlayer_with_react_native+expo.md +698 -0
- package/docs/pl/intlayer_with_react_router_v7.md +503 -0
- package/docs/pl/intlayer_with_tanstack.md +562 -0
- package/docs/pl/intlayer_with_vite+preact.md +1736 -0
- package/docs/pl/intlayer_with_vite+react.md +1438 -0
- package/docs/pl/intlayer_with_vite+solid.md +290 -0
- package/docs/pl/intlayer_with_vite+svelte.md +289 -0
- package/docs/pl/intlayer_with_vite+vue.md +1116 -0
- package/docs/pl/introduction.md +209 -0
- package/docs/pl/locale_mapper.md +242 -0
- package/docs/pl/mcp_server.md +211 -0
- package/docs/pl/packages/express-intlayer/t.md +458 -0
- package/docs/pl/packages/intlayer/getConfiguration.md +146 -0
- package/docs/pl/packages/intlayer/getEnumeration.md +160 -0
- package/docs/pl/packages/intlayer/getHTMLTextDir.md +121 -0
- package/docs/pl/packages/intlayer/getLocaleLang.md +81 -0
- package/docs/pl/packages/intlayer/getLocaleName.md +118 -0
- package/docs/pl/packages/intlayer/getLocalizedUrl.md +300 -0
- package/docs/pl/packages/intlayer/getMultilingualUrls.md +221 -0
- package/docs/pl/packages/intlayer/getPathWithoutLocale.md +75 -0
- package/docs/pl/packages/intlayer/getTranslation.md +190 -0
- package/docs/pl/packages/intlayer/getTranslationContent.md +189 -0
- package/docs/pl/packages/next-intlayer/t.md +353 -0
- package/docs/pl/packages/next-intlayer/useDictionary.md +270 -0
- package/docs/pl/packages/next-intlayer/useIntlayer.md +263 -0
- package/docs/pl/packages/next-intlayer/useLocale.md +166 -0
- package/docs/pl/packages/react-intlayer/t.md +303 -0
- package/docs/pl/packages/react-intlayer/useDictionary.md +289 -0
- package/docs/pl/packages/react-intlayer/useI18n.md +249 -0
- package/docs/pl/packages/react-intlayer/useIntlayer.md +256 -0
- package/docs/pl/packages/react-intlayer/useLocale.md +210 -0
- package/docs/pl/per_locale_file.md +321 -0
- package/docs/pl/readme.md +261 -0
- package/docs/pl/releases/v6.md +305 -0
- package/docs/pl/roadmap.md +362 -0
- package/docs/pl/testing.md +202 -0
- package/docs/pl/vs_code_extension.md +126 -0
- package/docs/pt/component_i18n.md +1 -1
- package/docs/pt/configuration.md +6 -0
- package/docs/pt/intlayer_cli.md +8 -3
- package/docs/pt/intlayer_with_next-i18next.md +627 -0
- package/docs/pt/intlayer_with_next-intl.md +446 -0
- package/docs/pt/intlayer_with_nextjs_16.md +21 -0
- package/docs/pt/intlayer_with_tanstack.md +4 -0
- package/docs/pt/intlayer_with_vite+react.md +4 -0
- package/docs/ru/component_i18n.md +1 -1
- package/docs/ru/configuration.md +6 -0
- package/docs/ru/intlayer_cli.md +301 -22
- package/docs/ru/intlayer_with_next-i18next.md +629 -0
- package/docs/ru/intlayer_with_next-intl.md +448 -0
- package/docs/ru/intlayer_with_nextjs_16.md +21 -0
- package/docs/ru/intlayer_with_tanstack.md +4 -0
- package/docs/ru/intlayer_with_vite+react.md +4 -0
- package/docs/tr/component_i18n.md +1 -1
- package/docs/tr/configuration.md +6 -0
- package/docs/tr/intlayer_cli.md +8 -0
- package/docs/tr/intlayer_with_next-i18next.md +627 -0
- package/docs/tr/intlayer_with_next-intl.md +446 -0
- package/docs/tr/intlayer_with_nextjs_16.md +21 -0
- package/docs/tr/intlayer_with_tanstack.md +4 -0
- package/docs/tr/intlayer_with_vite+react.md +4 -0
- package/docs/vi/CI_CD.md +198 -0
- package/docs/vi/autoFill.md +284 -0
- package/docs/vi/component_i18n.md +186 -0
- package/docs/vi/configuration.md +710 -0
- package/docs/vi/dictionary/condition.md +237 -0
- package/docs/vi/dictionary/content_file.md +1115 -0
- package/docs/vi/dictionary/enumeration.md +255 -0
- package/docs/vi/dictionary/file.md +234 -0
- package/docs/vi/dictionary/function_fetching.md +212 -0
- package/docs/vi/dictionary/gender.md +275 -0
- package/docs/vi/dictionary/insertion.md +191 -0
- package/docs/vi/dictionary/markdown.md +381 -0
- package/docs/vi/dictionary/nesting.md +273 -0
- package/docs/vi/dictionary/translation.md +309 -0
- package/docs/vi/formatters.md +595 -0
- package/docs/vi/how_works_intlayer.md +256 -0
- package/docs/vi/index.md +174 -0
- package/docs/vi/interest_of_intlayer.md +292 -0
- package/docs/vi/intlayer_CMS.md +549 -0
- package/docs/vi/intlayer_cli.md +850 -0
- package/docs/vi/intlayer_visual_editor.md +288 -0
- package/docs/vi/intlayer_with_angular.md +692 -0
- package/docs/vi/intlayer_with_astro.md +252 -0
- package/docs/vi/intlayer_with_create_react_app.md +1230 -0
- package/docs/vi/intlayer_with_express.md +409 -0
- package/docs/vi/intlayer_with_lynx+react.md +520 -0
- package/docs/vi/intlayer_with_nestjs.md +272 -0
- package/docs/vi/intlayer_with_next-i18next.md +628 -0
- package/docs/vi/intlayer_with_next-intl.md +446 -0
- package/docs/vi/intlayer_with_nextjs_14.md +1584 -0
- package/docs/vi/intlayer_with_nextjs_15.md +1738 -0
- package/docs/vi/intlayer_with_nextjs_16.md +21 -0
- package/docs/vi/intlayer_with_nextjs_page_router.md +1504 -0
- package/docs/vi/intlayer_with_nuxt.md +821 -0
- package/docs/vi/intlayer_with_react_native+expo.md +700 -0
- package/docs/vi/intlayer_with_react_router_v7.md +498 -0
- package/docs/vi/intlayer_with_tanstack.md +562 -0
- package/docs/vi/intlayer_with_vite+preact.md +1722 -0
- package/docs/vi/intlayer_with_vite+react.md +1407 -0
- package/docs/vi/intlayer_with_vite+solid.md +287 -0
- package/docs/vi/intlayer_with_vite+svelte.md +289 -0
- package/docs/vi/intlayer_with_vite+vue.md +1071 -0
- package/docs/vi/introduction.md +215 -0
- package/docs/vi/locale_mapper.md +242 -0
- package/docs/vi/mcp_server.md +211 -0
- package/docs/vi/packages/express-intlayer/t.md +457 -0
- package/docs/vi/packages/intlayer/getConfiguration.md +145 -0
- package/docs/vi/packages/intlayer/getEnumeration.md +162 -0
- package/docs/vi/packages/intlayer/getHTMLTextDir.md +121 -0
- package/docs/vi/packages/intlayer/getLocaleLang.md +81 -0
- package/docs/vi/packages/intlayer/getLocaleName.md +129 -0
- package/docs/vi/packages/intlayer/getLocalizedUrl.md +309 -0
- package/docs/vi/packages/intlayer/getMultilingualUrls.md +221 -0
- package/docs/vi/packages/intlayer/getPathWithoutLocale.md +75 -0
- package/docs/vi/packages/intlayer/getTranslation.md +201 -0
- package/docs/vi/packages/intlayer/getTranslationContent.md +188 -0
- package/docs/vi/packages/next-intlayer/t.md +352 -0
- package/docs/vi/packages/next-intlayer/useDictionary.md +273 -0
- package/docs/vi/packages/next-intlayer/useIntlayer.md +264 -0
- package/docs/vi/packages/next-intlayer/useLocale.md +166 -0
- package/docs/vi/packages/react-intlayer/t.md +304 -0
- package/docs/vi/packages/react-intlayer/useDictionary.md +288 -0
- package/docs/vi/packages/react-intlayer/useI18n.md +295 -0
- package/docs/vi/packages/react-intlayer/useIntlayer.md +256 -0
- package/docs/vi/packages/react-intlayer/useLocale.md +210 -0
- package/docs/vi/per_locale_file.md +326 -0
- package/docs/vi/readme.md +261 -0
- package/docs/vi/releases/v6.md +305 -0
- package/docs/vi/roadmap.md +346 -0
- package/docs/vi/testing.md +202 -0
- package/docs/vi/vs_code_extension.md +126 -0
- package/docs/zh/configuration.md +6 -0
- package/docs/zh/intlayer_cli.md +8 -3
- package/docs/zh/intlayer_with_next-i18next.md +628 -0
- package/docs/zh/intlayer_with_next-intl.md +448 -0
- package/docs/zh/intlayer_with_nextjs_16.md +21 -0
- package/docs/zh/intlayer_with_tanstack.md +4 -0
- package/docs/zh/intlayer_with_vite+react.md +4 -0
- package/frequent_questions/ar/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/ar/array_as_content_declaration.md +1 -2
- package/frequent_questions/ar/build_dictionaries.md +1 -2
- package/frequent_questions/ar/build_error_CI_CD.md +1 -2
- package/frequent_questions/ar/bun_set_up.md +1 -2
- package/frequent_questions/ar/customized_locale_list.md +1 -2
- package/frequent_questions/ar/domain_routing.md +1 -2
- package/frequent_questions/ar/esbuild_error.md +1 -2
- package/frequent_questions/ar/get_locale_cookie.md +1 -2
- package/frequent_questions/ar/intlayer_command_undefined.md +1 -2
- package/frequent_questions/ar/locale_incorect_in_url.md +1 -2
- package/frequent_questions/ar/static_rendering.md +1 -3
- package/frequent_questions/ar/translated_path_url.md +1 -2
- package/frequent_questions/ar/unknown_command.md +1 -2
- package/frequent_questions/de/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/de/array_as_content_declaration.md +1 -2
- package/frequent_questions/de/build_dictionaries.md +1 -2
- package/frequent_questions/de/build_error_CI_CD.md +1 -2
- package/frequent_questions/de/bun_set_up.md +1 -2
- package/frequent_questions/de/customized_locale_list.md +1 -2
- package/frequent_questions/de/domain_routing.md +1 -2
- package/frequent_questions/de/esbuild_error.md +1 -2
- package/frequent_questions/de/get_locale_cookie.md +1 -2
- package/frequent_questions/de/intlayer_command_undefined.md +1 -2
- package/frequent_questions/de/locale_incorect_in_url.md +1 -2
- package/frequent_questions/de/static_rendering.md +1 -3
- package/frequent_questions/de/translated_path_url.md +1 -2
- package/frequent_questions/de/unknown_command.md +1 -2
- package/frequent_questions/en/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/en/array_as_content_declaration.md +1 -2
- package/frequent_questions/en/build_dictionaries.md +1 -2
- package/frequent_questions/en/build_error_CI_CD.md +1 -2
- package/frequent_questions/en/bun_set_up.md +1 -2
- package/frequent_questions/en/customized_locale_list.md +1 -2
- package/frequent_questions/en/domain_routing.md +1 -2
- package/frequent_questions/en/esbuild_error.md +1 -2
- package/frequent_questions/en/get_locale_cookie.md +1 -2
- package/frequent_questions/en/intlayer_command_undefined.md +1 -2
- package/frequent_questions/en/locale_incorect_in_url.md +1 -2
- package/frequent_questions/en/static_rendering.md +1 -3
- package/frequent_questions/en/translated_path_url.md +1 -2
- package/frequent_questions/en/unknown_command.md +1 -2
- package/frequent_questions/en-GB/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/en-GB/array_as_content_declaration.md +1 -2
- package/frequent_questions/en-GB/build_dictionaries.md +1 -2
- package/frequent_questions/en-GB/build_error_CI_CD.md +1 -2
- package/frequent_questions/en-GB/bun_set_up.md +1 -2
- package/frequent_questions/en-GB/customized_locale_list.md +1 -2
- package/frequent_questions/en-GB/domain_routing.md +1 -2
- package/frequent_questions/en-GB/esbuild_error.md +1 -2
- package/frequent_questions/en-GB/get_locale_cookie.md +1 -2
- package/frequent_questions/en-GB/intlayer_command_undefined.md +1 -2
- package/frequent_questions/en-GB/locale_incorect_in_url.md +1 -2
- package/frequent_questions/en-GB/static_rendering.md +1 -3
- package/frequent_questions/en-GB/translated_path_url.md +1 -2
- package/frequent_questions/en-GB/unknown_command.md +1 -2
- package/frequent_questions/es/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/es/array_as_content_declaration.md +1 -2
- package/frequent_questions/es/build_dictionaries.md +1 -2
- package/frequent_questions/es/build_error_CI_CD.md +1 -2
- package/frequent_questions/es/bun_set_up.md +1 -2
- package/frequent_questions/es/customized_locale_list.md +1 -2
- package/frequent_questions/es/domain_routing.md +1 -2
- package/frequent_questions/es/esbuild_error.md +1 -2
- package/frequent_questions/es/get_locale_cookie.md +1 -2
- package/frequent_questions/es/intlayer_command_undefined.md +1 -2
- package/frequent_questions/es/locale_incorect_in_url.md +1 -2
- package/frequent_questions/es/static_rendering.md +1 -3
- package/frequent_questions/es/translated_path_url.md +1 -2
- package/frequent_questions/es/unknown_command.md +1 -2
- package/frequent_questions/fr/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/fr/array_as_content_declaration.md +1 -2
- package/frequent_questions/fr/build_dictionaries.md +1 -2
- package/frequent_questions/fr/build_error_CI_CD.md +1 -2
- package/frequent_questions/fr/bun_set_up.md +1 -2
- package/frequent_questions/fr/customized_locale_list.md +1 -2
- package/frequent_questions/fr/domain_routing.md +1 -2
- package/frequent_questions/fr/esbuild_error.md +1 -2
- package/frequent_questions/fr/get_locale_cookie.md +1 -2
- package/frequent_questions/fr/intlayer_command_undefined.md +1 -2
- package/frequent_questions/fr/locale_incorect_in_url.md +1 -2
- package/frequent_questions/fr/static_rendering.md +1 -3
- package/frequent_questions/fr/translated_path_url.md +1 -2
- package/frequent_questions/fr/unknown_command.md +1 -2
- package/frequent_questions/hi/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/hi/array_as_content_declaration.md +1 -2
- package/frequent_questions/hi/build_dictionaries.md +1 -2
- package/frequent_questions/hi/build_error_CI_CD.md +1 -2
- package/frequent_questions/hi/bun_set_up.md +1 -2
- package/frequent_questions/hi/customized_locale_list.md +1 -2
- package/frequent_questions/hi/domain_routing.md +1 -2
- package/frequent_questions/hi/esbuild_error.md +1 -2
- package/frequent_questions/hi/get_locale_cookie.md +1 -2
- package/frequent_questions/hi/intlayer_command_undefined.md +1 -2
- package/frequent_questions/hi/locale_incorect_in_url.md +1 -2
- package/frequent_questions/hi/static_rendering.md +1 -3
- package/frequent_questions/hi/translated_path_url.md +1 -2
- package/frequent_questions/hi/unknown_command.md +1 -2
- package/frequent_questions/id/SSR_Next_no_[locale].md +104 -0
- package/frequent_questions/id/array_as_content_declaration.md +71 -0
- package/frequent_questions/id/build_dictionaries.md +58 -0
- package/frequent_questions/id/build_error_CI_CD.md +74 -0
- package/frequent_questions/id/bun_set_up.md +53 -0
- package/frequent_questions/id/customized_locale_list.md +64 -0
- package/frequent_questions/id/domain_routing.md +113 -0
- package/frequent_questions/id/esbuild_error.md +29 -0
- package/frequent_questions/id/get_locale_cookie.md +142 -0
- package/frequent_questions/id/intlayer_command_undefined.md +155 -0
- package/frequent_questions/id/locale_incorect_in_url.md +73 -0
- package/frequent_questions/id/static_rendering.md +44 -0
- package/frequent_questions/id/translated_path_url.md +55 -0
- package/frequent_questions/id/unknown_command.md +97 -0
- package/frequent_questions/it/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/it/array_as_content_declaration.md +1 -2
- package/frequent_questions/it/build_dictionaries.md +1 -2
- package/frequent_questions/it/build_error_CI_CD.md +1 -2
- package/frequent_questions/it/bun_set_up.md +1 -2
- package/frequent_questions/it/customized_locale_list.md +1 -2
- package/frequent_questions/it/domain_routing.md +1 -2
- package/frequent_questions/it/esbuild_error.md +1 -2
- package/frequent_questions/it/get_locale_cookie.md +1 -2
- package/frequent_questions/it/intlayer_command_undefined.md +1 -2
- package/frequent_questions/it/locale_incorect_in_url.md +1 -2
- package/frequent_questions/it/static_rendering.md +1 -3
- package/frequent_questions/it/translated_path_url.md +1 -2
- package/frequent_questions/it/unknown_command.md +1 -2
- package/frequent_questions/ja/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/ja/array_as_content_declaration.md +1 -2
- package/frequent_questions/ja/build_dictionaries.md +1 -2
- package/frequent_questions/ja/build_error_CI_CD.md +1 -2
- package/frequent_questions/ja/bun_set_up.md +1 -2
- package/frequent_questions/ja/customized_locale_list.md +1 -2
- package/frequent_questions/ja/domain_routing.md +1 -2
- package/frequent_questions/ja/esbuild_error.md +1 -2
- package/frequent_questions/ja/get_locale_cookie.md +1 -2
- package/frequent_questions/ja/intlayer_command_undefined.md +1 -2
- package/frequent_questions/ja/locale_incorect_in_url.md +1 -2
- package/frequent_questions/ja/static_rendering.md +1 -3
- package/frequent_questions/ja/translated_path_url.md +1 -2
- package/frequent_questions/ja/unknown_command.md +1 -2
- package/frequent_questions/ko/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/ko/array_as_content_declaration.md +1 -2
- package/frequent_questions/ko/build_dictionaries.md +1 -2
- package/frequent_questions/ko/build_error_CI_CD.md +1 -2
- package/frequent_questions/ko/bun_set_up.md +1 -2
- package/frequent_questions/ko/customized_locale_list.md +1 -2
- package/frequent_questions/ko/domain_routing.md +1 -2
- package/frequent_questions/ko/esbuild_error.md +1 -2
- package/frequent_questions/ko/get_locale_cookie.md +1 -2
- package/frequent_questions/ko/intlayer_command_undefined.md +1 -2
- package/frequent_questions/ko/locale_incorect_in_url.md +1 -2
- package/frequent_questions/ko/static_rendering.md +1 -3
- package/frequent_questions/ko/translated_path_url.md +1 -2
- package/frequent_questions/ko/unknown_command.md +1 -2
- package/frequent_questions/pl/SSR_Next_no_[locale].md +104 -0
- package/frequent_questions/pl/array_as_content_declaration.md +71 -0
- package/frequent_questions/pl/build_dictionaries.md +58 -0
- package/frequent_questions/pl/build_error_CI_CD.md +74 -0
- package/frequent_questions/pl/bun_set_up.md +54 -0
- package/frequent_questions/pl/customized_locale_list.md +64 -0
- package/frequent_questions/pl/domain_routing.md +113 -0
- package/frequent_questions/pl/esbuild_error.md +29 -0
- package/frequent_questions/pl/get_locale_cookie.md +142 -0
- package/frequent_questions/pl/intlayer_command_undefined.md +155 -0
- package/frequent_questions/pl/locale_incorect_in_url.md +73 -0
- package/frequent_questions/pl/static_rendering.md +44 -0
- package/frequent_questions/pl/translated_path_url.md +55 -0
- package/frequent_questions/pl/unknown_command.md +97 -0
- package/frequent_questions/pt/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/pt/array_as_content_declaration.md +1 -2
- package/frequent_questions/pt/build_dictionaries.md +1 -2
- package/frequent_questions/pt/build_error_CI_CD.md +1 -2
- package/frequent_questions/pt/bun_set_up.md +1 -2
- package/frequent_questions/pt/customized_locale_list.md +1 -2
- package/frequent_questions/pt/domain_routing.md +1 -2
- package/frequent_questions/pt/esbuild_error.md +1 -2
- package/frequent_questions/pt/get_locale_cookie.md +1 -2
- package/frequent_questions/pt/intlayer_command_undefined.md +1 -2
- package/frequent_questions/pt/locale_incorect_in_url.md +1 -2
- package/frequent_questions/pt/static_rendering.md +1 -3
- package/frequent_questions/pt/translated_path_url.md +1 -2
- package/frequent_questions/pt/unknown_command.md +1 -2
- package/frequent_questions/ru/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/ru/array_as_content_declaration.md +1 -2
- package/frequent_questions/ru/build_dictionaries.md +1 -2
- package/frequent_questions/ru/build_error_CI_CD.md +1 -2
- package/frequent_questions/ru/bun_set_up.md +1 -2
- package/frequent_questions/ru/customized_locale_list.md +1 -2
- package/frequent_questions/ru/domain_routing.md +1 -2
- package/frequent_questions/ru/esbuild_error.md +1 -2
- package/frequent_questions/ru/get_locale_cookie.md +1 -2
- package/frequent_questions/ru/intlayer_command_undefined.md +1 -2
- package/frequent_questions/ru/locale_incorect_in_url.md +1 -2
- package/frequent_questions/ru/static_rendering.md +1 -2
- package/frequent_questions/ru/translated_path_url.md +1 -2
- package/frequent_questions/ru/unknown_command.md +1 -2
- package/frequent_questions/tr/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/tr/array_as_content_declaration.md +1 -2
- package/frequent_questions/tr/build_dictionaries.md +1 -2
- package/frequent_questions/tr/build_error_CI_CD.md +1 -2
- package/frequent_questions/tr/bun_set_up.md +1 -2
- package/frequent_questions/tr/customized_locale_list.md +1 -2
- package/frequent_questions/tr/domain_routing.md +1 -2
- package/frequent_questions/tr/esbuild_error.md +1 -2
- package/frequent_questions/tr/get_locale_cookie.md +1 -2
- package/frequent_questions/tr/intlayer_command_undefined.md +1 -2
- package/frequent_questions/tr/locale_incorect_in_url.md +1 -2
- package/frequent_questions/tr/static_rendering.md +1 -2
- package/frequent_questions/tr/translated_path_url.md +1 -2
- package/frequent_questions/tr/unknown_command.md +1 -2
- package/frequent_questions/vi/SSR_Next_no_[locale].md +106 -0
- package/frequent_questions/vi/array_as_content_declaration.md +71 -0
- package/frequent_questions/vi/build_dictionaries.md +58 -0
- package/frequent_questions/vi/build_error_CI_CD.md +74 -0
- package/frequent_questions/vi/bun_set_up.md +53 -0
- package/frequent_questions/vi/customized_locale_list.md +64 -0
- package/frequent_questions/vi/domain_routing.md +113 -0
- package/frequent_questions/vi/esbuild_error.md +29 -0
- package/frequent_questions/vi/get_locale_cookie.md +142 -0
- package/frequent_questions/vi/intlayer_command_undefined.md +155 -0
- package/frequent_questions/vi/locale_incorect_in_url.md +73 -0
- package/frequent_questions/vi/static_rendering.md +44 -0
- package/frequent_questions/vi/translated_path_url.md +55 -0
- package/frequent_questions/vi/unknown_command.md +97 -0
- package/frequent_questions/zh/SSR_Next_no_[locale].md +1 -2
- package/frequent_questions/zh/array_as_content_declaration.md +1 -2
- package/frequent_questions/zh/build_dictionaries.md +1 -2
- package/frequent_questions/zh/build_error_CI_CD.md +1 -2
- package/frequent_questions/zh/bun_set_up.md +1 -2
- package/frequent_questions/zh/customized_locale_list.md +1 -2
- package/frequent_questions/zh/domain_routing.md +1 -2
- package/frequent_questions/zh/esbuild_error.md +1 -2
- package/frequent_questions/zh/get_locale_cookie.md +1 -2
- package/frequent_questions/zh/intlayer_command_undefined.md +1 -2
- package/frequent_questions/zh/locale_incorect_in_url.md +1 -2
- package/frequent_questions/zh/static_rendering.md +1 -3
- package/frequent_questions/zh/translated_path_url.md +1 -2
- package/frequent_questions/zh/unknown_command.md +1 -2
- package/legal/id/privacy_notice.md +83 -0
- package/legal/id/terms_of_service.md +55 -0
- package/legal/pl/privacy_notice.md +83 -0
- package/legal/pl/terms_of_service.md +55 -0
- package/legal/vi/privacy_notice.md +83 -0
- package/legal/vi/terms_of_service.md +55 -0
- package/package.json +19 -18
- package/src/generated/blog.entry.ts +38 -0
|
@@ -0,0 +1,1088 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-04-18
|
|
3
|
+
updatedAt: 2025-06-29
|
|
4
|
+
title: Cara menerjemahkan aplikasi Vite dan Vue Anda – panduan i18n 2025
|
|
5
|
+
description: Temukan cara membuat situs web Vite dan Vue Anda menjadi multibahasa. Ikuti dokumentasi untuk melakukan internasionalisasi (i18n) dan menerjemahkannya.
|
|
6
|
+
keywords:
|
|
7
|
+
- Internasionalisasi
|
|
8
|
+
- Dokumentasi
|
|
9
|
+
- Intlayer
|
|
10
|
+
- Vite
|
|
11
|
+
- Vue
|
|
12
|
+
- JavaScript
|
|
13
|
+
slugs:
|
|
14
|
+
- doc
|
|
15
|
+
- environment
|
|
16
|
+
- vite-and-vue
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-vite-vue-template
|
|
18
|
+
history:
|
|
19
|
+
- version: 5.5.10
|
|
20
|
+
date: 2025-06-29
|
|
21
|
+
changes: Inisialisasi riwayat
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Terjemahkan situs web Vite dan Vue Anda menggunakan Intlayer | Internasionalisasi (i18n)
|
|
25
|
+
|
|
26
|
+
## Daftar Isi
|
|
27
|
+
|
|
28
|
+
<TOC/>
|
|
29
|
+
|
|
30
|
+
## Apa itu Intlayer?
|
|
31
|
+
|
|
32
|
+
**Intlayer** adalah pustaka internasionalisasi (i18n) open-source yang inovatif, dirancang untuk menyederhanakan dukungan multibahasa dalam aplikasi web modern.
|
|
33
|
+
|
|
34
|
+
Dengan Intlayer, Anda dapat:
|
|
35
|
+
|
|
36
|
+
- **Mengelola terjemahan dengan mudah** menggunakan kamus deklaratif di tingkat komponen.
|
|
37
|
+
- **Melokalkan metadata**, rute, dan konten secara dinamis.
|
|
38
|
+
- **Memastikan dukungan TypeScript** dengan tipe yang dihasilkan secara otomatis, meningkatkan autocompletion dan deteksi kesalahan.
|
|
39
|
+
- **Memanfaatkan fitur canggih**, seperti deteksi dan pergantian locale secara dinamis.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Panduan Langkah demi Langkah untuk Mengatur Intlayer dalam Aplikasi Vite dan Vue
|
|
44
|
+
|
|
45
|
+
<iframe
|
|
46
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-vite-vue-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
47
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
48
|
+
title="Demo CodeSandbox - Cara Menginternasionalisasi aplikasi Anda menggunakan Intlayer"
|
|
49
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
50
|
+
loading="lazy"
|
|
51
|
+
/>
|
|
52
|
+
|
|
53
|
+
Lihat [Template Aplikasi](https://github.com/aymericzip/intlayer-vite-vue-template) di GitHub.
|
|
54
|
+
|
|
55
|
+
### Langkah 1: Instalasi Dependensi
|
|
56
|
+
|
|
57
|
+
Instal paket yang diperlukan menggunakan npm:
|
|
58
|
+
|
|
59
|
+
```bash packageManager="npm"
|
|
60
|
+
npm install intlayer vue-intlayer
|
|
61
|
+
npm install vite-intlayer --save-dev
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```bash packageManager="pnpm"
|
|
65
|
+
pnpm add intlayer vue-intlayer
|
|
66
|
+
pnpm add vite-intlayer --save-dev
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```bash packageManager="yarn"
|
|
70
|
+
yarn add intlayer vue-intlayer
|
|
71
|
+
yarn add vite-intlayer --save-dev
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- **intlayer**
|
|
75
|
+
|
|
76
|
+
Paket inti yang menyediakan alat internasionalisasi untuk manajemen konfigurasi, terjemahan, [deklarasi konten](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/dictionary/content_file.md), transpile, dan [perintah CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/intlayer_cli.md).
|
|
77
|
+
|
|
78
|
+
- **vue-intlayer**
|
|
79
|
+
Paket yang mengintegrasikan Intlayer dengan aplikasi Vue. Paket ini menyediakan context providers dan composables untuk internasionalisasi Vue.
|
|
80
|
+
|
|
81
|
+
- **vite-intlayer**
|
|
82
|
+
Termasuk plugin Vite untuk mengintegrasikan Intlayer dengan [Vite bundler](https://vite.dev/guide/why.html#why-bundle-for-production), serta middleware untuk mendeteksi locale yang dipilih pengguna, mengelola cookie, dan menangani pengalihan URL.
|
|
83
|
+
|
|
84
|
+
### Langkah 2: Konfigurasi proyek Anda
|
|
85
|
+
|
|
86
|
+
Buat file konfigurasi untuk mengatur bahasa aplikasi Anda:
|
|
87
|
+
|
|
88
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
89
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
90
|
+
|
|
91
|
+
const config: IntlayerConfig = {
|
|
92
|
+
internationalization: {
|
|
93
|
+
locales: [
|
|
94
|
+
Locales.ENGLISH,
|
|
95
|
+
Locales.FRENCH,
|
|
96
|
+
Locales.SPANISH,
|
|
97
|
+
// Bahasa lain milik Anda
|
|
98
|
+
],
|
|
99
|
+
defaultLocale: Locales.ENGLISH,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export default config;
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
107
|
+
import { Locales } from "intlayer";
|
|
108
|
+
|
|
109
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
110
|
+
const config = {
|
|
111
|
+
internationalization: {
|
|
112
|
+
locales: [
|
|
113
|
+
Locales.ENGLISH,
|
|
114
|
+
Locales.FRENCH,
|
|
115
|
+
Locales.SPANISH,
|
|
116
|
+
// Bahasa lain milik Anda
|
|
117
|
+
],
|
|
118
|
+
defaultLocale: Locales.ENGLISH,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export default config;
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
126
|
+
const { Locales } = require("intlayer");
|
|
127
|
+
|
|
128
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
129
|
+
const config = {
|
|
130
|
+
internationalization: {
|
|
131
|
+
locales: [
|
|
132
|
+
Locales.ENGLISH,
|
|
133
|
+
Locales.FRENCH,
|
|
134
|
+
Locales.SPANISH,
|
|
135
|
+
// Bahasa lain milik Anda
|
|
136
|
+
],
|
|
137
|
+
defaultLocale: Locales.ENGLISH,
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
module.exports = config;
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
> Melalui file konfigurasi ini, Anda dapat mengatur URL yang dilokalkan, pengalihan middleware, nama cookie, lokasi dan ekstensi deklarasi konten Anda, menonaktifkan log Intlayer di konsol, dan lainnya. Untuk daftar lengkap parameter yang tersedia, lihat [dokumentasi konfigurasi](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/configuration.md).
|
|
145
|
+
|
|
146
|
+
### Langkah 3: Integrasikan Intlayer dalam Konfigurasi Vite Anda
|
|
147
|
+
|
|
148
|
+
Tambahkan plugin intlayer ke dalam konfigurasi Anda.
|
|
149
|
+
|
|
150
|
+
```typescript fileName="vite.config.ts" codeFormat="typescript"
|
|
151
|
+
import { defineConfig } from "vite";
|
|
152
|
+
import vue from "@vitejs/plugin-vue";
|
|
153
|
+
import { intlayer } from "vite-intlayer";
|
|
154
|
+
|
|
155
|
+
// https://vitejs.dev/config/
|
|
156
|
+
export default defineConfig({
|
|
157
|
+
plugins: [vue(), intlayer()],
|
|
158
|
+
});
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
```javascript fileName="vite.config.mjs" codeFormat="esm"
|
|
162
|
+
import { defineConfig } from "vite";
|
|
163
|
+
import vue from "@vitejs/plugin-vue";
|
|
164
|
+
import { intlayer } from "vite-intlayer";
|
|
165
|
+
|
|
166
|
+
// https://vitejs.dev/config/
|
|
167
|
+
export default defineConfig({
|
|
168
|
+
plugins: [vue(), intlayer()],
|
|
169
|
+
});
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
```javascript fileName="vite.config.cjs" codeFormat="commonjs"
|
|
173
|
+
const { defineConfig } = require("vite");
|
|
174
|
+
const vue = require("@vitejs/plugin-vue");
|
|
175
|
+
const { intlayer } = require("vite-intlayer");
|
|
176
|
+
|
|
177
|
+
// https://vitejs.dev/config/
|
|
178
|
+
module.exports = defineConfig({
|
|
179
|
+
plugins: [vue(), intlayer()],
|
|
180
|
+
});
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
> Plugin Vite `intlayer()` digunakan untuk mengintegrasikan Intlayer dengan Vite. Plugin ini memastikan pembuatan file deklarasi konten dan memantau file tersebut dalam mode pengembangan. Plugin ini juga mendefinisikan variabel lingkungan Intlayer dalam aplikasi Vite. Selain itu, plugin ini menyediakan alias untuk mengoptimalkan performa.
|
|
184
|
+
|
|
185
|
+
### Langkah 4: Deklarasikan Konten Anda
|
|
186
|
+
|
|
187
|
+
Buat dan kelola deklarasi konten Anda untuk menyimpan terjemahan:
|
|
188
|
+
|
|
189
|
+
```tsx fileName="src/helloWorld.content.ts" contentDeclarationFormat="typescript"
|
|
190
|
+
import { t, type Dictionary } from "intlayer";
|
|
191
|
+
|
|
192
|
+
const helloWorldContent = {
|
|
193
|
+
key: "helloworld",
|
|
194
|
+
content: {
|
|
195
|
+
count: t({ en: "count is ", fr: "le compte est ", es: "el recuento es " }),
|
|
196
|
+
edit: t({
|
|
197
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
198
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
199
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
200
|
+
}),
|
|
201
|
+
checkOut: t({
|
|
202
|
+
en: "Check out ",
|
|
203
|
+
id: "Periksa ",
|
|
204
|
+
fr: "Vérifiez ",
|
|
205
|
+
es: "Compruebe ",
|
|
206
|
+
}),
|
|
207
|
+
officialStarter: t({
|
|
208
|
+
en: ", the official Vue + Vite starter",
|
|
209
|
+
id: ", starter resmi Vue + Vite",
|
|
210
|
+
fr: ", le starter officiel Vue + Vite",
|
|
211
|
+
es: ", el starter oficial Vue + Vite",
|
|
212
|
+
}),
|
|
213
|
+
learnMore: t({
|
|
214
|
+
en: "Learn more about IDE Support for Vue in the ",
|
|
215
|
+
id: "Pelajari lebih lanjut tentang Dukungan IDE untuk Vue di ",
|
|
216
|
+
fr: "En savoir plus sur le support IDE pour Vue dans le ",
|
|
217
|
+
es: "Aprenda más sobre el soporte IDE para Vue en el ",
|
|
218
|
+
}),
|
|
219
|
+
vueDocs: t({
|
|
220
|
+
en: "Vue Docs Scaling up Guide",
|
|
221
|
+
id: "Panduan Peningkatan Skala Dokumentasi Vue",
|
|
222
|
+
fr: "Vue Docs Scaling up Guide",
|
|
223
|
+
es: "Vue Docs Scaling up Guide",
|
|
224
|
+
}),
|
|
225
|
+
readTheDocs: t({
|
|
226
|
+
en: "Click on the Vite and Vue logos to learn more",
|
|
227
|
+
id: "Klik pada logo Vite dan Vue untuk mempelajari lebih lanjut",
|
|
228
|
+
fr: "Cliquez sur les logos Vite et Vue pour en savoir plus",
|
|
229
|
+
es: "Haga clic en los logotipos de Vite y Vue para obtener más información",
|
|
230
|
+
}),
|
|
231
|
+
},
|
|
232
|
+
} satisfies Dictionary;
|
|
233
|
+
|
|
234
|
+
export default helloWorldContent;
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
```javascript fileName="src/helloWorld.content.mjs" contentDeclarationFormat="esm"
|
|
238
|
+
import { t } from "intlayer";
|
|
239
|
+
|
|
240
|
+
/** @type {import('intlayer').Dictionary} */
|
|
241
|
+
const helloWorldContent = {
|
|
242
|
+
key: "helloworld",
|
|
243
|
+
content: {
|
|
244
|
+
count: t({
|
|
245
|
+
en: "count is ",
|
|
246
|
+
id: "jumlah adalah ",
|
|
247
|
+
fr: "le compte est ",
|
|
248
|
+
es: "el recuento es ",
|
|
249
|
+
}),
|
|
250
|
+
edit: t({
|
|
251
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
252
|
+
id: "Edit <code>components/HelloWorld.vue</code> dan simpan untuk menguji HMR",
|
|
253
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
254
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
255
|
+
}),
|
|
256
|
+
checkOut: t({
|
|
257
|
+
en: "Check out ",
|
|
258
|
+
id: "Periksa ",
|
|
259
|
+
fr: "Vérifiez ",
|
|
260
|
+
es: "Compruebe ",
|
|
261
|
+
}),
|
|
262
|
+
officialStarter: t({
|
|
263
|
+
en: "the official Vue + Vite starter",
|
|
264
|
+
id: "starter resmi Vue + Vite",
|
|
265
|
+
fr: "le starter officiel Vue + Vite",
|
|
266
|
+
es: "el starter oficial Vue + Vite",
|
|
267
|
+
}),
|
|
268
|
+
learnMore: t({
|
|
269
|
+
en: "Learn more about IDE Support for Vue in the ",
|
|
270
|
+
id: "Pelajari lebih lanjut tentang Dukungan IDE untuk Vue di ",
|
|
271
|
+
fr: "En savoir plus sur le support IDE pour Vue dans le ",
|
|
272
|
+
es: "Aprenda más sobre el soporte IDE para Vue en el ",
|
|
273
|
+
}),
|
|
274
|
+
vueDocs: t({
|
|
275
|
+
en: "Vue Docs Scaling up Guide",
|
|
276
|
+
id: "Panduan Scaling up Vue Docs",
|
|
277
|
+
fr: "Vue Docs Scaling up Guide",
|
|
278
|
+
es: "Vue Docs Scaling up Guide",
|
|
279
|
+
}),
|
|
280
|
+
readTheDocs: t({
|
|
281
|
+
en: "Click on the Vite and Vue logos to learn more",
|
|
282
|
+
fr: "Cliquez sur les logos Vite et Vue pour en savoir plus",
|
|
283
|
+
es: "Haga clic en los logotipos de Vite y Vue para obtener más información",
|
|
284
|
+
id: "Klik logo Vite dan Vue untuk mempelajari lebih lanjut",
|
|
285
|
+
}),
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
export default helloWorldContent;
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
```javascript fileName="src/helloWorld.content.cjs" contentDeclarationFormat="commonjs"
|
|
293
|
+
const { t } = require("intlayer");
|
|
294
|
+
|
|
295
|
+
/** @type {import('intlayer').Dictionary} */
|
|
296
|
+
const appContent = {
|
|
297
|
+
key: "helloworld",
|
|
298
|
+
content: {
|
|
299
|
+
count: t({ en: "count is ", id: "jumlah adalah ", fr: "le compte est ", es: "el recuento es " }),
|
|
300
|
+
edit: t({
|
|
301
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
302
|
+
id: "Edit <code>components/HelloWorld.vue</code> dan simpan untuk menguji HMR",
|
|
303
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
304
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
305
|
+
}),
|
|
306
|
+
checkOut: t({ en: "Check out ", id: "Periksa ", fr: "Vérifiez ", es: "Compruebe " }),
|
|
307
|
+
officialStarter: t({
|
|
308
|
+
en: "the official Vue + Vite starter",
|
|
309
|
+
id: "starter resmi Vue + Vite",
|
|
310
|
+
fr: "le starter officiel Vue + Vite",
|
|
311
|
+
es: "el starter oficial Vue + Vite",
|
|
312
|
+
}),
|
|
313
|
+
learnMore: t({
|
|
314
|
+
en: "Learn more about IDE Support for Vue in the ",
|
|
315
|
+
id: "Pelajari lebih lanjut tentang Dukungan IDE untuk Vue di ",
|
|
316
|
+
fr: "En savoir plus sur le support IDE pour Vue dans le ",
|
|
317
|
+
es: "Aprenda más sobre el soporte IDE para Vue en el ",
|
|
318
|
+
}),
|
|
319
|
+
vueDocs: t({
|
|
320
|
+
en: "Vue Docs Scaling up Guide",
|
|
321
|
+
id: "Panduan Scaling up Vue Docs",
|
|
322
|
+
fr: "Vue Docs Scaling up Guide",
|
|
323
|
+
es: "Vue Docs Scaling up Guide",
|
|
324
|
+
}),
|
|
325
|
+
readTheDocs: t({
|
|
326
|
+
en: "Click on the Vite and Vue logos to learn more",
|
|
327
|
+
id: "Klik pada logo Vite dan Vue untuk mempelajari lebih lanjut",
|
|
328
|
+
fr: "Cliquez sur les logos Vite et Vue pour en savoir plus",
|
|
329
|
+
es: "Haga clic en los logotipos de Vite y Vue para obtener más información",
|
|
330
|
+
}),
|
|
331
|
+
es: "Haga clic en los logotipos de Vite y Vue para obtener más información",
|
|
332
|
+
}),
|
|
333
|
+
},
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
module.exports = appContent;
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
```json fileName="src/helloWorld.content.json" contentDeclarationFormat="json"
|
|
340
|
+
{
|
|
341
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
342
|
+
"key": "helloworld",
|
|
343
|
+
"content": {
|
|
344
|
+
"count": {
|
|
345
|
+
"nodeType": "translation",
|
|
346
|
+
"translation": {
|
|
347
|
+
"en": "count is ",
|
|
348
|
+
"id": "jumlah adalah ",
|
|
349
|
+
"fr": "le compte est ",
|
|
350
|
+
"es": "el recuento es "
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"edit": {
|
|
354
|
+
"nodeType": "translation",
|
|
355
|
+
"translation": {
|
|
356
|
+
"en": "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
357
|
+
"id": "Edit <code>components/HelloWorld.vue</code> dan simpan untuk menguji HMR",
|
|
358
|
+
"fr": "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
359
|
+
"es": "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR"
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"checkOut": {
|
|
363
|
+
"nodeType": "translation",
|
|
364
|
+
"translation": {
|
|
365
|
+
"en": "Check out ",
|
|
366
|
+
"fr": "Vérifiez ",
|
|
367
|
+
"id": "Periksa ",
|
|
368
|
+
"es": "Compruebe "
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
"officialStarter": {
|
|
372
|
+
"nodeType": "translation",
|
|
373
|
+
"translation": {
|
|
374
|
+
"en": "the official Vue + Vite starter",
|
|
375
|
+
"fr": "le starter officiel Vue + Vite",
|
|
376
|
+
"id": "starter resmi Vue + Vite",
|
|
377
|
+
"es": "el starter oficial Vue + Vite"
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
"learnMore": {
|
|
381
|
+
"nodeType": "translation",
|
|
382
|
+
"translation": {
|
|
383
|
+
"en": "Learn more about IDE Support for Vue in the ",
|
|
384
|
+
"fr": "En savoir plus sur le support IDE pour Vue dans le ",
|
|
385
|
+
"id": "Pelajari lebih lanjut tentang Dukungan IDE untuk Vue di ",
|
|
386
|
+
"es": "Aprenda más sobre el soporte IDE para Vue en el "
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
"vueDocs": {
|
|
390
|
+
"nodeType": "translation",
|
|
391
|
+
"translation": {
|
|
392
|
+
"id": "Panduan Skalabilitas Dokumen Vue",
|
|
393
|
+
"en": "Vue Docs Scaling up Guide",
|
|
394
|
+
"fr": "Vue Docs Scaling up Guide",
|
|
395
|
+
"es": "Vue Docs Scaling up Guide"
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"readTheDocs": {
|
|
399
|
+
"nodeType": "translation",
|
|
400
|
+
"translation": {
|
|
401
|
+
"id": "Klik pada logo Vite dan Vue untuk mempelajari lebih lanjut",
|
|
402
|
+
"en": "Click on the Vite and Vue logos to learn more",
|
|
403
|
+
"fr": "Cliquez sur les logos Vite et Vue pour en savoir plus",
|
|
404
|
+
"es": "Haga clic en los logotipos de Vite y Vue para obtener más información"
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
> Deklarasi konten Anda dapat didefinisikan di mana saja dalam aplikasi Anda selama sudah dimasukkan ke dalam direktori `contentDir` (secara default, `./src`). Dan sesuai dengan ekstensi file deklarasi konten (secara default, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
|
|
412
|
+
|
|
413
|
+
> Untuk detail lebih lanjut, lihat [dokumentasi deklarasi konten](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/dictionary/content_file.md).
|
|
414
|
+
|
|
415
|
+
### Langkah 5: Gunakan Intlayer dalam Kode Anda
|
|
416
|
+
|
|
417
|
+
Untuk memanfaatkan fitur internasionalisasi Intlayer di seluruh aplikasi Vue Anda, pertama-tama Anda perlu mendaftarkan instance singleton Intlayer di file utama Anda. Langkah ini sangat penting karena menyediakan konteks internasionalisasi ke semua komponen dalam aplikasi Anda, sehingga terjemahan dapat diakses di mana saja dalam pohon komponen Anda.
|
|
418
|
+
|
|
419
|
+
```javascript fileName=main.js
|
|
420
|
+
import { createApp } from "vue";
|
|
421
|
+
import { installIntlayer } from "vue-intlayer";
|
|
422
|
+
import App from "./App.vue";
|
|
423
|
+
import "./style.css";
|
|
424
|
+
|
|
425
|
+
const app = createApp(App);
|
|
426
|
+
|
|
427
|
+
// Menyuntikkan provider di tingkat atas
|
|
428
|
+
installIntlayer(app);
|
|
429
|
+
|
|
430
|
+
// Memasang aplikasi
|
|
431
|
+
app.mount("#app");
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
Akses kamus konten Anda di seluruh aplikasi dengan membuat komponen Vue utama dan menggunakan composable `useIntlayer`:
|
|
435
|
+
|
|
436
|
+
```vue fileName="src/HelloWord.vue"
|
|
437
|
+
<script setup lang="ts">
|
|
438
|
+
import { ref } from "vue";
|
|
439
|
+
import { useIntlayer } from "vue-intlayer";
|
|
440
|
+
|
|
441
|
+
defineProps({
|
|
442
|
+
msg: String,
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
const {
|
|
446
|
+
count,
|
|
447
|
+
edit,
|
|
448
|
+
checkOut,
|
|
449
|
+
officialStarter,
|
|
450
|
+
learnMore,
|
|
451
|
+
vueDocs,
|
|
452
|
+
readTheDocs,
|
|
453
|
+
} = useIntlayer("helloworld");
|
|
454
|
+
const countRef = ref(0);
|
|
455
|
+
</script>
|
|
456
|
+
|
|
457
|
+
<template>
|
|
458
|
+
<h1>{{ msg }}</h1>
|
|
459
|
+
|
|
460
|
+
<div class="card">
|
|
461
|
+
<button type="button" @click="countRef++">
|
|
462
|
+
<count />
|
|
463
|
+
{{ countRef }}
|
|
464
|
+
</button>
|
|
465
|
+
<p v-html="edit"></p>
|
|
466
|
+
</div>
|
|
467
|
+
|
|
468
|
+
<p>
|
|
469
|
+
<checkOut />
|
|
470
|
+
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
|
|
471
|
+
>create-vue</a
|
|
472
|
+
>, <officialStarter />
|
|
473
|
+
</p>
|
|
474
|
+
<p>
|
|
475
|
+
<learnMore />
|
|
476
|
+
<a
|
|
477
|
+
href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
|
|
478
|
+
target="_blank"
|
|
479
|
+
><vueDocs /></a
|
|
480
|
+
>.
|
|
481
|
+
</p>
|
|
482
|
+
<p class="read-the-docs"><readTheDocs /></p>
|
|
483
|
+
<p class="read-the-docs">{{ readTheDocs }}</p>
|
|
484
|
+
</template>
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
#### Mengakses Konten di Intlayer
|
|
488
|
+
|
|
489
|
+
Intlayer menawarkan berbagai API untuk mengakses konten Anda:
|
|
490
|
+
|
|
491
|
+
- **Sintaks berbasis Komponen** (direkomendasikan):
|
|
492
|
+
Gunakan sintaks `<myContent />`, atau `<Component :is="myContent" />` untuk merender konten sebagai Node Intlayer. Ini terintegrasi dengan mulus dengan [Visual Editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/intlayer_visual_editor.md) dan [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/intlayer_CMS.md).
|
|
493
|
+
|
|
494
|
+
- **Sintaks berbasis String**:
|
|
495
|
+
Gunakan `{{ myContent }}` untuk merender konten sebagai teks biasa, tanpa dukungan Visual Editor.
|
|
496
|
+
|
|
497
|
+
- **Sintaks HTML mentah**:
|
|
498
|
+
Gunakan `<div v-html="myContent" />` untuk merender konten sebagai HTML mentah, tanpa dukungan Visual Editor.
|
|
499
|
+
|
|
500
|
+
- **Sintaks destrukturisasi**:
|
|
501
|
+
Composable `useIntlayer` mengembalikan sebuah Proxy dengan konten. Proxy ini dapat didestrukturisasi untuk mengakses konten sambil mempertahankan reaktivitas.
|
|
502
|
+
- Gunakan `const content = useIntlayer("myContent");` dan `{{ content.myContent }}` / `<content.myContent />`.
|
|
503
|
+
- Atau gunakan `const { myContent } = useIntlayer("myContent");` dan `{{ myContent }}` / `<myContent/>` untuk mendestrukturisasi konten.
|
|
504
|
+
|
|
505
|
+
### (Opsional) Langkah 6: Ubah bahasa konten Anda
|
|
506
|
+
|
|
507
|
+
Untuk mengubah bahasa konten Anda, Anda dapat menggunakan fungsi `setLocale` yang disediakan oleh composable `useLocale`. Fungsi ini memungkinkan Anda untuk mengatur locale aplikasi dan memperbarui konten sesuai dengan locale tersebut.
|
|
508
|
+
|
|
509
|
+
Buat sebuah komponen untuk beralih antar bahasa:
|
|
510
|
+
|
|
511
|
+
```vue fileName="src/components/LocaleSwitcher.vue"
|
|
512
|
+
<template>
|
|
513
|
+
<div class="locale-switcher">
|
|
514
|
+
<select v-model="selectedLocale" @change="changeLocale">
|
|
515
|
+
<option v-for="loc in availableLocales" :key="loc" :value="loc">
|
|
516
|
+
{{ getLocaleName(loc) }}
|
|
517
|
+
</option>
|
|
518
|
+
</select>
|
|
519
|
+
</div>
|
|
520
|
+
</template>
|
|
521
|
+
|
|
522
|
+
<script setup lang="ts">
|
|
523
|
+
import { ref, watch } from "vue";
|
|
524
|
+
import { getLocaleName } from "intlayer";
|
|
525
|
+
import { useLocale } from "vue-intlayer";
|
|
526
|
+
|
|
527
|
+
// Mendapatkan informasi locale dan fungsi setLocale
|
|
528
|
+
const { locale, availableLocales, setLocale } = useLocale();
|
|
529
|
+
|
|
530
|
+
// Melacak locale yang dipilih dengan ref
|
|
531
|
+
const selectedLocale = ref(locale.value);
|
|
532
|
+
|
|
533
|
+
// Memperbarui locale saat pilihan berubah
|
|
534
|
+
const changeLocale = () => setLocale(selectedLocale.value);
|
|
535
|
+
|
|
536
|
+
// Menjaga selectedLocale agar tetap sinkron dengan locale global
|
|
537
|
+
watch(
|
|
538
|
+
() => locale.value,
|
|
539
|
+
(newLocale) => {
|
|
540
|
+
selectedLocale.value = newLocale;
|
|
541
|
+
}
|
|
542
|
+
);
|
|
543
|
+
</script>
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
Kemudian, gunakan komponen ini di App.vue Anda:
|
|
547
|
+
|
|
548
|
+
```vue fileName="src/App.vue"
|
|
549
|
+
<script setup lang="ts">
|
|
550
|
+
import { useIntlayer } from "vue-intlayer";
|
|
551
|
+
import HelloWorld from "@components/HelloWorld.vue";
|
|
552
|
+
import LocaleSwitcher from "@components/LocaleSwitcher.vue";
|
|
553
|
+
import { ref, watch } from "vue";
|
|
554
|
+
|
|
555
|
+
const content = useIntlayer("app"); // Buat file deklarasi intlayer terkait
|
|
556
|
+
</script>
|
|
557
|
+
|
|
558
|
+
<template>
|
|
559
|
+
<div>
|
|
560
|
+
<LocaleSwitcher />
|
|
561
|
+
<a href="https://vite.dev" target="_blank">
|
|
562
|
+
<img src="/vite.svg" class="logo" :alt="content.viteLogo" />
|
|
563
|
+
</a>
|
|
564
|
+
<a href="https://vuejs.org/" target="_blank">
|
|
565
|
+
<img src="./assets/vue.svg" class="logo vue" :alt="content.vueLogo" />
|
|
566
|
+
</a>
|
|
567
|
+
</div>
|
|
568
|
+
<HelloWorld :msg="content.title" />
|
|
569
|
+
</template>
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### (Opsional) Langkah 7: Tambahkan Routing yang Dilokalkan ke aplikasi Anda
|
|
573
|
+
|
|
574
|
+
Menambahkan routing yang dilokalkan dalam aplikasi Vue biasanya melibatkan penggunaan Vue Router dengan prefix locale. Ini membuat rute unik untuk setiap bahasa, yang berguna untuk SEO dan URL yang ramah SEO.
|
|
575
|
+
|
|
576
|
+
Contoh:
|
|
577
|
+
|
|
578
|
+
```plaintext
|
|
579
|
+
- https://example.com/about
|
|
580
|
+
- https://example.com/es/about
|
|
581
|
+
- https://example.com/fr/about
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
Pertama, instal Vue Router:
|
|
585
|
+
|
|
586
|
+
```bash packageManager="npm"
|
|
587
|
+
npm install intlayer vue-router
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
```bash packageManager="pnpm"
|
|
591
|
+
pnpm add intlayer vue-router
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
```bash packageManager="yarn"
|
|
595
|
+
yarn add intlayer vue-router
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
Lalu, buat konfigurasi router yang menangani routing berbasis locale:
|
|
599
|
+
|
|
600
|
+
```js fileName="src/router/index.ts"
|
|
601
|
+
import {
|
|
602
|
+
configuration,
|
|
603
|
+
getPathWithoutLocale,
|
|
604
|
+
localeFlatMap,
|
|
605
|
+
type Locales,
|
|
606
|
+
} from 'intlayer';
|
|
607
|
+
import { createIntlayerClient } from 'vue-intlayer';
|
|
608
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
609
|
+
import HomeView from './views/home/HomeView.vue';
|
|
610
|
+
import RootView from './views/root/Root.vue';
|
|
611
|
+
|
|
612
|
+
// Mendapatkan konfigurasi internasionalisasi
|
|
613
|
+
const { internationalization, middleware } = configuration;
|
|
614
|
+
const { defaultLocale } = internationalization;
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Mendeklarasikan routes dengan path dan metadata spesifik locale.
|
|
618
|
+
*/
|
|
619
|
+
const routes = localeFlatMap((localizedData) => [
|
|
620
|
+
{
|
|
621
|
+
path: `${localizedData.urlPrefix}/`,
|
|
622
|
+
name: `Root-${localizedData.locale}`,
|
|
623
|
+
component: RootView,
|
|
624
|
+
meta: {
|
|
625
|
+
locale: localizedData.locale,
|
|
626
|
+
},
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
path: `${localizedData.urlPrefix}/home`,
|
|
630
|
+
name: `Home-${localizedData.locale}`,
|
|
631
|
+
component: HomeView,
|
|
632
|
+
meta: {
|
|
633
|
+
locale: localizedData.locale,
|
|
634
|
+
},
|
|
635
|
+
},
|
|
636
|
+
]);
|
|
637
|
+
|
|
638
|
+
// Buat instance router
|
|
639
|
+
export const router = createRouter({
|
|
640
|
+
history: createWebHistory(),
|
|
641
|
+
routes,
|
|
642
|
+
});
|
|
643
|
+
|
|
644
|
+
// Tambahkan guard navigasi untuk penanganan locale
|
|
645
|
+
router.beforeEach((to, _from, next) => {
|
|
646
|
+
const client = createIntlayerClient();
|
|
647
|
+
|
|
648
|
+
const metaLocale = to.meta.locale as Locales | undefined;
|
|
649
|
+
|
|
650
|
+
if (metaLocale) {
|
|
651
|
+
// Gunakan kembali locale yang didefinisikan di meta route
|
|
652
|
+
client.setLocale(metaLocale);
|
|
653
|
+
next();
|
|
654
|
+
} else {
|
|
655
|
+
// Cadangan: tidak ada locale di meta, kemungkinan route tidak cocok
|
|
656
|
+
// Opsional: tangani 404 atau redirect ke locale default
|
|
657
|
+
client.setLocale(defaultLocale);
|
|
658
|
+
|
|
659
|
+
if (middleware.prefixDefault) {
|
|
660
|
+
next(`/${defaultLocale}${getPathWithoutLocale(to.path)}`);
|
|
661
|
+
} else {
|
|
662
|
+
next(getPathWithoutLocale(to.path));
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
> Nama digunakan untuk mengidentifikasi route dalam router. Nama ini harus unik di seluruh route untuk menghindari konflik dan memastikan navigasi serta linking yang tepat.
|
|
669
|
+
|
|
670
|
+
Kemudian, daftarkan router di file main.js Anda:
|
|
671
|
+
|
|
672
|
+
```js fileName="src/main.ts"
|
|
673
|
+
import { createApp } from "vue";
|
|
674
|
+
import App from "./App.vue";
|
|
675
|
+
import { router } from "./router";
|
|
676
|
+
import "./style.css";
|
|
677
|
+
|
|
678
|
+
const app = createApp(App);
|
|
679
|
+
|
|
680
|
+
// Tambahkan router ke aplikasi
|
|
681
|
+
app.use(router);
|
|
682
|
+
|
|
683
|
+
// Pasang aplikasi
|
|
684
|
+
app.mount("#app");
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
Kemudian perbarui file `App.vue` Anda untuk merender komponen RouterView. Komponen ini akan menampilkan komponen yang cocok untuk rute saat ini.
|
|
688
|
+
|
|
689
|
+
```vue fileName="src/App.vue"
|
|
690
|
+
<script setup lang="ts">
|
|
691
|
+
import LocaleSwitcher from "@components/LocaleSwitcher.vue";
|
|
692
|
+
</script>
|
|
693
|
+
|
|
694
|
+
<template>
|
|
695
|
+
<nav>
|
|
696
|
+
<LocaleSwitcher />
|
|
697
|
+
</nav>
|
|
698
|
+
<RouterView />
|
|
699
|
+
</template>
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
Secara paralel, Anda juga dapat menggunakan `intlayerMiddleware` untuk menambahkan routing sisi server ke aplikasi Anda. Plugin ini secara otomatis akan mendeteksi locale saat ini berdasarkan URL dan mengatur cookie locale yang sesuai. Jika tidak ada locale yang ditentukan, plugin akan menentukan locale yang paling tepat berdasarkan preferensi bahasa browser pengguna. Jika tidak ada locale yang terdeteksi, maka akan mengarahkan ulang ke locale default.
|
|
703
|
+
|
|
704
|
+
> Perlu dicatat bahwa untuk menggunakan `intlayerMiddleware` dalam produksi, Anda perlu memindahkan paket `vite-intlayer` dari `devDependencies` ke `dependencies`.
|
|
705
|
+
|
|
706
|
+
```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
|
|
707
|
+
import { defineConfig } from "vite";
|
|
708
|
+
import vue from "@vitejs/plugin-vue";
|
|
709
|
+
import { intlayer, intlayerMiddleware } from "vite-intlayer";
|
|
710
|
+
|
|
711
|
+
// https://vitejs.dev/config/
|
|
712
|
+
export default defineConfig({
|
|
713
|
+
plugins: [vue(), intlayer(), intlayerMiddleware()],
|
|
714
|
+
});
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
```javascript {3,7} fileName="vite.config.mjs" codeFormat="esm"
|
|
718
|
+
import { defineConfig } from "vite";
|
|
719
|
+
import vue from "@vitejs/plugin-vue";
|
|
720
|
+
import { intlayer, intlayerMiddleware } from "vite-intlayer";
|
|
721
|
+
|
|
722
|
+
// https://vitejs.dev/config/
|
|
723
|
+
export default defineConfig({
|
|
724
|
+
plugins: [vue(), intlayer(), intlayerMiddleware()],
|
|
725
|
+
});
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
```javascript {3,7} fileName="vite.config.cjs" codeFormat="commonjs"
|
|
729
|
+
const { defineConfig } = require("vite");
|
|
730
|
+
const vue = require("@vitejs/plugin-vue");
|
|
731
|
+
const { intlayer, intlayerMiddleware } = require("vite-intlayer");
|
|
732
|
+
|
|
733
|
+
// https://vitejs.dev/config/
|
|
734
|
+
module.exports = defineConfig({
|
|
735
|
+
plugins: [vue(), intlayer(), intlayerMiddleware()],
|
|
736
|
+
});
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
### (Opsional) Langkah 8: Ubah URL saat locale berubah
|
|
740
|
+
|
|
741
|
+
Untuk secara otomatis memperbarui URL ketika pengguna mengganti bahasa, Anda dapat memodifikasi komponen `LocaleSwitcher` untuk menggunakan Vue Router:
|
|
742
|
+
|
|
743
|
+
```vue fileName="src/components/LocaleSwitcher.vue"
|
|
744
|
+
<template>
|
|
745
|
+
<div class="locale-switcher">
|
|
746
|
+
<select v-model="selectedLocale" @change="changeLocale">
|
|
747
|
+
<option v-for="loc in availableLocales" :key="loc" :value="loc">
|
|
748
|
+
{{ getLocaleName(loc) }}
|
|
749
|
+
</option>
|
|
750
|
+
</select>
|
|
751
|
+
</div>
|
|
752
|
+
</template>
|
|
753
|
+
|
|
754
|
+
<script setup lang="ts">
|
|
755
|
+
import { ref, watch } from "vue";
|
|
756
|
+
import { useRouter } from "vue-router";
|
|
757
|
+
import { Locales, getLocaleName, getLocalizedUrl } from "intlayer";
|
|
758
|
+
import { useLocale } from "vue-intlayer";
|
|
759
|
+
|
|
760
|
+
// Mendapatkan Vue Router
|
|
761
|
+
const router = useRouter();
|
|
762
|
+
|
|
763
|
+
// Mendapatkan informasi locale dan fungsi setLocale
|
|
764
|
+
const { locale, availableLocales, setLocale } = useLocale({
|
|
765
|
+
onLocaleChange: (newLocale) => {
|
|
766
|
+
// Mendapatkan rute saat ini dan membuat URL yang dilokalkan
|
|
767
|
+
const currentPath = router.currentRoute.value.fullPath;
|
|
768
|
+
const localizedPath = getLocalizedUrl(currentPath, newLocale);
|
|
769
|
+
|
|
770
|
+
// Navigasi ke rute yang dilokalkan tanpa memuat ulang halaman
|
|
771
|
+
router.push(localizedPath);
|
|
772
|
+
},
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
// Melacak locale yang dipilih dengan ref
|
|
776
|
+
const selectedLocale = ref(locale.value);
|
|
777
|
+
|
|
778
|
+
// Memperbarui locale saat pilihan berubah
|
|
779
|
+
const changeLocale = () => {
|
|
780
|
+
setLocale(selectedLocale.value);
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
// Menjaga selectedLocale tetap sinkron dengan locale global
|
|
784
|
+
watch(
|
|
785
|
+
() => locale.value,
|
|
786
|
+
(newLocale) => {
|
|
787
|
+
selectedLocale.value = newLocale;
|
|
788
|
+
}
|
|
789
|
+
);
|
|
790
|
+
</script>
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
Tip: Untuk SEO dan aksesibilitas yang lebih baik, gunakan tag seperti `<a href="/fr/home" hreflang="fr">` untuk menautkan ke halaman yang dilokalkan, seperti yang ditunjukkan pada Langkah 10. Ini memungkinkan mesin pencari menemukan dan mengindeks URL spesifik bahasa dengan benar. Untuk mempertahankan perilaku SPA, Anda dapat mencegah navigasi default dengan @click.prevent, mengubah locale menggunakan useLocale, dan menavigasi secara programatik menggunakan Vue Router.
|
|
794
|
+
|
|
795
|
+
```html
|
|
796
|
+
<ol class="divide-text/20 divide-y divide-dashed overflow-y-auto p-1">
|
|
797
|
+
<li>
|
|
798
|
+
<a
|
|
799
|
+
hreflang="x-default"
|
|
800
|
+
aria-label="Beralih ke Bahasa Inggris"
|
|
801
|
+
target="_self"
|
|
802
|
+
aria-current="page"
|
|
803
|
+
href="/doc/get-started"
|
|
804
|
+
>
|
|
805
|
+
<div>
|
|
806
|
+
<span dir="ltr" lang="en">English</span>
|
|
807
|
+
<span>Bahasa Inggris</span>
|
|
808
|
+
<span>EN</span>
|
|
809
|
+
</div>
|
|
810
|
+
</a>
|
|
811
|
+
</li>
|
|
812
|
+
<li>
|
|
813
|
+
<a
|
|
814
|
+
hreflang="es"
|
|
815
|
+
aria-label="Beralih ke Bahasa Spanyol"
|
|
816
|
+
target="_self"
|
|
817
|
+
href="/es/doc/get-started"
|
|
818
|
+
>
|
|
819
|
+
<div>
|
|
820
|
+
<span dir="ltr" lang="es">Español</span>
|
|
821
|
+
<span>Bahasa Spanyol</span>
|
|
822
|
+
<span>ES</span>
|
|
823
|
+
</div>
|
|
824
|
+
</a>
|
|
825
|
+
</li>
|
|
826
|
+
</ol>
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
### (Opsional) Langkah 9: Ganti Atribut Bahasa dan Arah pada Tag HTML
|
|
830
|
+
|
|
831
|
+
Ketika aplikasi Anda mendukung beberapa bahasa, sangat penting untuk memperbarui atribut `lang` dan `dir` pada tag `<html>` agar sesuai dengan locale saat ini. Melakukan hal ini memastikan:
|
|
832
|
+
|
|
833
|
+
- **Aksesibilitas**: Pembaca layar dan teknologi bantu bergantung pada atribut `lang` yang benar untuk mengucapkan dan menginterpretasikan konten dengan akurat.
|
|
834
|
+
- **Perenderan Teks**: Atribut `dir` (arah) memastikan teks dirender dalam urutan yang tepat (misalnya, kiri-ke-kanan untuk bahasa Inggris, kanan-ke-kiri untuk bahasa Arab atau Ibrani), yang sangat penting untuk keterbacaan.
|
|
835
|
+
- **SEO**: Mesin pencari menggunakan atribut `lang` untuk menentukan bahasa halaman Anda, membantu menyajikan konten lokal yang tepat dalam hasil pencarian.
|
|
836
|
+
|
|
837
|
+
Dengan memperbarui atribut ini secara dinamis saat locale berubah, Anda menjamin pengalaman yang konsisten dan dapat diakses bagi pengguna di semua bahasa yang didukung.
|
|
838
|
+
|
|
839
|
+
```js fileName="src/composables/useI18nHTMLAttributes.ts"
|
|
840
|
+
import { watch } from "vue";
|
|
841
|
+
import { useLocale } from "vue-intlayer";
|
|
842
|
+
import { getHTMLTextDir } from "intlayer";
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Composable yang memperbarui atribut `lang` dan `dir` elemen HTML <html>
|
|
846
|
+
* berdasarkan locale saat ini.
|
|
847
|
+
*
|
|
848
|
+
* @example
|
|
849
|
+
* // Di App.vue Anda atau komponen global
|
|
850
|
+
* import { useI18nHTMLAttributes } from './composables/useI18nHTMLAttributes'
|
|
851
|
+
*
|
|
852
|
+
* useI18nHTMLAttributes()
|
|
853
|
+
*/
|
|
854
|
+
export const useI18nHTMLAttributes = () => {
|
|
855
|
+
const { locale } = useLocale();
|
|
856
|
+
|
|
857
|
+
// Memperbarui atribut HTML setiap kali locale berubah
|
|
858
|
+
watch(
|
|
859
|
+
() => locale.value,
|
|
860
|
+
(newLocale) => {
|
|
861
|
+
if (!newLocale) return;
|
|
862
|
+
|
|
863
|
+
// Perbarui atribut bahasa
|
|
864
|
+
document.documentElement.lang = newLocale;
|
|
865
|
+
|
|
866
|
+
// Atur arah teks (ltr untuk sebagian besar bahasa, rtl untuk Arab, Ibrani, dll.)
|
|
867
|
+
document.documentElement.dir = getHTMLTextDir(newLocale);
|
|
868
|
+
},
|
|
869
|
+
{ immediate: true }
|
|
870
|
+
);
|
|
871
|
+
};
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
Gunakan composable ini di `App.vue` Anda atau komponen global:
|
|
875
|
+
|
|
876
|
+
```vue fileName="src/App.vue"
|
|
877
|
+
<script setup lang="ts">
|
|
878
|
+
import { useI18nHTMLAttributes } from "@composables/useI18nHTMLAttributes";
|
|
879
|
+
|
|
880
|
+
// Terapkan atribut HTML berdasarkan locale saat ini
|
|
881
|
+
useI18nHTMLAttributes();
|
|
882
|
+
</script>
|
|
883
|
+
|
|
884
|
+
<template>
|
|
885
|
+
<!-- Template aplikasi Anda -->
|
|
886
|
+
</template>
|
|
887
|
+
```
|
|
888
|
+
|
|
889
|
+
### (Opsional) Langkah 10: Membuat Komponen Link yang Dilokalkan
|
|
890
|
+
|
|
891
|
+
Untuk memastikan navigasi aplikasi Anda menghormati locale saat ini, Anda dapat membuat komponen `Link` kustom. Komponen ini secara otomatis menambahkan prefix bahasa saat ini pada URL internal, sehingga. Misalnya, ketika pengguna berbahasa Prancis mengklik tautan ke halaman "About", mereka akan diarahkan ke `/fr/about` alih-alih `/about`.
|
|
892
|
+
|
|
893
|
+
Perilaku ini berguna untuk beberapa alasan:
|
|
894
|
+
|
|
895
|
+
- **SEO dan Pengalaman Pengguna**: URL yang dilokalkan membantu mesin pencari mengindeks halaman spesifik bahasa dengan benar dan menyediakan konten kepada pengguna dalam bahasa pilihan mereka.
|
|
896
|
+
- **Konsistensi**: Dengan menggunakan tautan yang dilokalkan di seluruh aplikasi Anda, Anda menjamin navigasi tetap dalam locale saat ini, mencegah perubahan bahasa yang tidak diinginkan.
|
|
897
|
+
- **Maintainability**: Memusatkan logika lokalisasi dalam satu komponen menyederhanakan pengelolaan URL, sehingga codebase Anda lebih mudah dipelihara dan dikembangkan seiring pertumbuhan aplikasi Anda.
|
|
898
|
+
|
|
899
|
+
```vue fileName="src/components/Link.vue"
|
|
900
|
+
<template>
|
|
901
|
+
<a :href="localizedHref" v-bind="$attrs">
|
|
902
|
+
<slot />
|
|
903
|
+
</a>
|
|
904
|
+
</template>
|
|
905
|
+
|
|
906
|
+
<script setup lang="ts">
|
|
907
|
+
import { computed } from "vue";
|
|
908
|
+
import { getLocalizedUrl } from "intlayer";
|
|
909
|
+
import { useLocale } from "vue-intlayer";
|
|
910
|
+
|
|
911
|
+
const props = defineProps({
|
|
912
|
+
href: {
|
|
913
|
+
type: String,
|
|
914
|
+
required: true,
|
|
915
|
+
},
|
|
916
|
+
});
|
|
917
|
+
|
|
918
|
+
const { locale } = useLocale();
|
|
919
|
+
|
|
920
|
+
// Periksa apakah link bersifat eksternal
|
|
921
|
+
const isExternalLink = computed(() => /^https?:\/\//.test(props.href || ""));
|
|
922
|
+
|
|
923
|
+
// Buat href yang dilokalisasi untuk link internal
|
|
924
|
+
const localizedHref = computed(() =>
|
|
925
|
+
isExternalLink.value ? props.href : getLocalizedUrl(props.href, locale.value)
|
|
926
|
+
);
|
|
927
|
+
</script>
|
|
928
|
+
```
|
|
929
|
+
|
|
930
|
+
Untuk digunakan dengan Vue Router, buat versi khusus router:
|
|
931
|
+
|
|
932
|
+
```vue fileName="src/components/RouterLink.vue"
|
|
933
|
+
<template>
|
|
934
|
+
<router-link :to="localizedTo" v-bind="$attrs">
|
|
935
|
+
<slot />
|
|
936
|
+
</router-link>
|
|
937
|
+
</template>
|
|
938
|
+
|
|
939
|
+
<script setup lang="ts">
|
|
940
|
+
import { computed } from "vue";
|
|
941
|
+
import { getLocalizedUrl } from "intlayer";
|
|
942
|
+
import { useLocale } from "vue-intlayer";
|
|
943
|
+
|
|
944
|
+
const props = defineProps({
|
|
945
|
+
to: {
|
|
946
|
+
type: [String, Object],
|
|
947
|
+
required: true,
|
|
948
|
+
},
|
|
949
|
+
});
|
|
950
|
+
|
|
951
|
+
const { locale } = useLocale();
|
|
952
|
+
|
|
953
|
+
// Membuat properti to yang sudah dilokalkan untuk router-link
|
|
954
|
+
const localizedTo = computed(() => {
|
|
955
|
+
if (typeof props.to === "string") {
|
|
956
|
+
return getLocalizedUrl(props.to, locale.value);
|
|
957
|
+
} else {
|
|
958
|
+
// Jika 'to' adalah objek, lokalisa properti path
|
|
959
|
+
return {
|
|
960
|
+
...props.to,
|
|
961
|
+
path: getLocalizedUrl(props.to.path ?? "/", locale.value),
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
</script>
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
Gunakan komponen-komponen ini dalam aplikasi Anda:
|
|
969
|
+
|
|
970
|
+
```vue fileName="src/App.vue"
|
|
971
|
+
<template>
|
|
972
|
+
<div>
|
|
973
|
+
<!-- Vue router -->
|
|
974
|
+
<RouterLink to="/">Root</RouterLink>
|
|
975
|
+
<RouterLink to="/home">Home</RouterLink>
|
|
976
|
+
<!-- Lainnya -->
|
|
977
|
+
<Link href="/">Root</Link>
|
|
978
|
+
<Link href="/home">Home</Link>
|
|
979
|
+
</div>
|
|
980
|
+
</template>
|
|
981
|
+
|
|
982
|
+
<script setup lang="ts">
|
|
983
|
+
import Link from "@components/Link.vue";
|
|
984
|
+
import RouterLink from "@components/RouterLink.vue";
|
|
985
|
+
</script>
|
|
986
|
+
```
|
|
987
|
+
|
|
988
|
+
### (Opsional) Langkah 11: Render Markdown
|
|
989
|
+
|
|
990
|
+
Intlayer mendukung rendering konten Markdown langsung di aplikasi Vue Anda. Secara default, Markdown diperlakukan sebagai teks biasa. Untuk mengubah Markdown menjadi HTML kaya, Anda dapat mengintegrasikan [markdown-it](https://github.com/markdown-it/markdown-it), sebuah parser Markdown.
|
|
991
|
+
|
|
992
|
+
Ini sangat berguna ketika terjemahan Anda mencakup konten yang diformat seperti daftar, tautan, atau penekanan.
|
|
993
|
+
|
|
994
|
+
Secara default Intlayer merender markdown sebagai string. Namun Intlayer juga menyediakan cara untuk merender markdown menjadi HTML menggunakan fungsi `installIntlayerMarkdown`.
|
|
995
|
+
|
|
996
|
+
> Untuk melihat cara mendeklarasikan konten markdown menggunakan paket `intlayer`, lihat [dokumen markdown](https://github.com/aymericzip/intlayer/tree/main/docs/id/dictionary/markdown.md).
|
|
997
|
+
|
|
998
|
+
```ts fileName="main.ts"
|
|
999
|
+
import MarkdownIt from "markdown-it";
|
|
1000
|
+
import { createApp, h } from "vue";
|
|
1001
|
+
import { installIntlayer, installIntlayerMarkdown } from "vue-intlayer";
|
|
1002
|
+
|
|
1003
|
+
const app = createApp(App);
|
|
1004
|
+
|
|
1005
|
+
installIntlayer(app);
|
|
1006
|
+
|
|
1007
|
+
const md = new MarkdownIt({
|
|
1008
|
+
html: true, // mengizinkan tag HTML
|
|
1009
|
+
linkify: true, // otomatis membuat tautan URL
|
|
1010
|
+
typographer: true, // mengaktifkan tanda kutip pintar, tanda hubung, dll.
|
|
1011
|
+
});
|
|
1012
|
+
|
|
1013
|
+
// Beritahu Intlayer untuk menggunakan md.render() setiap kali perlu mengubah markdown menjadi HTML
|
|
1014
|
+
installIntlayerMarkdown(app, (markdown) => {
|
|
1015
|
+
const html = md.render(markdown);
|
|
1016
|
+
return h("div", { innerHTML: html });
|
|
1017
|
+
});
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1020
|
+
Setelah terdaftar, Anda dapat menggunakan sintaks berbasis komponen untuk menampilkan konten Markdown secara langsung:
|
|
1021
|
+
|
|
1022
|
+
```vue
|
|
1023
|
+
<template>
|
|
1024
|
+
<div>
|
|
1025
|
+
<myMarkdownContent />
|
|
1026
|
+
</div>
|
|
1027
|
+
</template>
|
|
1028
|
+
|
|
1029
|
+
<script setup lang="ts">
|
|
1030
|
+
import { useIntlayer } from "vue-intlayer";
|
|
1031
|
+
|
|
1032
|
+
const { myMarkdownContent } = useIntlayer("my-component");
|
|
1033
|
+
</script>
|
|
1034
|
+
```
|
|
1035
|
+
|
|
1036
|
+
### Konfigurasi TypeScript
|
|
1037
|
+
|
|
1038
|
+
Intlayer menggunakan module augmentation untuk mendapatkan manfaat dari TypeScript dan membuat codebase Anda lebih kuat.
|
|
1039
|
+
|
|
1040
|
+

|
|
1041
|
+
|
|
1042
|
+

|
|
1043
|
+
|
|
1044
|
+
Pastikan konfigurasi TypeScript Anda menyertakan tipe yang dihasilkan secara otomatis.
|
|
1045
|
+
|
|
1046
|
+
```json5 fileName="tsconfig.json"
|
|
1047
|
+
{
|
|
1048
|
+
// ... Konfigurasi TypeScript Anda yang sudah ada
|
|
1049
|
+
"include": [
|
|
1050
|
+
// ... Konfigurasi TypeScript Anda yang sudah ada
|
|
1051
|
+
".intlayer/**/*.ts", // Sertakan tipe yang dihasilkan secara otomatis
|
|
1052
|
+
],
|
|
1053
|
+
}
|
|
1054
|
+
```
|
|
1055
|
+
|
|
1056
|
+
### Konfigurasi Git
|
|
1057
|
+
|
|
1058
|
+
Disarankan untuk mengabaikan file-file yang dihasilkan oleh Intlayer. Ini memungkinkan Anda untuk menghindari meng-commit file tersebut ke repository Git Anda.
|
|
1059
|
+
|
|
1060
|
+
Untuk melakukan ini, Anda dapat menambahkan instruksi berikut ke dalam file `.gitignore` Anda:
|
|
1061
|
+
|
|
1062
|
+
```plaintext
|
|
1063
|
+
# Abaikan file yang dihasilkan oleh Intlayer
|
|
1064
|
+
.intlayer
|
|
1065
|
+
```
|
|
1066
|
+
|
|
1067
|
+
### Ekstensi VS Code
|
|
1068
|
+
|
|
1069
|
+
Untuk meningkatkan pengalaman pengembangan Anda dengan Intlayer, Anda dapat menginstal **Ekstensi Intlayer VS Code** resmi.
|
|
1070
|
+
|
|
1071
|
+
[Pasang dari VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
1072
|
+
|
|
1073
|
+
Ekstensi ini menyediakan:
|
|
1074
|
+
|
|
1075
|
+
- **Autocompletion** untuk kunci terjemahan.
|
|
1076
|
+
- **Deteksi kesalahan secara real-time** untuk terjemahan yang hilang.
|
|
1077
|
+
- **Pratinjau inline** dari konten terjemahan.
|
|
1078
|
+
- **Aksi cepat** untuk dengan mudah membuat dan memperbarui terjemahan.
|
|
1079
|
+
|
|
1080
|
+
Untuk informasi lebih lanjut tentang cara menggunakan ekstensi ini, lihat dokumentasi [Intlayer VS Code Extension](https://intlayer.org/doc/vs-code-extension).
|
|
1081
|
+
|
|
1082
|
+
---
|
|
1083
|
+
|
|
1084
|
+
### Melangkah Lebih Jauh
|
|
1085
|
+
|
|
1086
|
+
Untuk melangkah lebih jauh, Anda dapat mengimplementasikan [editor visual](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/intlayer_visual_editor.md) atau mengeksternalisasi konten Anda menggunakan [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/id/intlayer_CMS.md).
|
|
1087
|
+
|
|
1088
|
+
---
|