@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,758 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-11-01
|
|
3
|
+
updatedAt: 2025-11-01
|
|
4
|
+
title: Come internazionalizzare la tua applicazione Next.js usando next-intl
|
|
5
|
+
description: Configura l'i18n con next-intl - migliori pratiche e consigli SEO per app Next.js multilingue, coprendo internazionalizzazione, organizzazione dei contenuti e configurazione tecnica.
|
|
6
|
+
slugs:
|
|
7
|
+
- blog
|
|
8
|
+
- nextjs-internationalization-using-next-intl
|
|
9
|
+
applicationTemplate: https://github.com/aymericzip/next-intl-template
|
|
10
|
+
history:
|
|
11
|
+
- version: 7.0.0
|
|
12
|
+
date: 2025-11-01
|
|
13
|
+
changes: Versione iniziale
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Come internazionalizzare la tua applicazione Next.js usando next-intl nel 2025
|
|
17
|
+
|
|
18
|
+
## Indice
|
|
19
|
+
|
|
20
|
+
<TOC/>
|
|
21
|
+
|
|
22
|
+
## Cos'è next-intl?
|
|
23
|
+
|
|
24
|
+
**next-intl** è una popolare libreria di internazionalizzazione (i18n) progettata specificamente per Next.js App Router. Fornisce un modo fluido per costruire applicazioni Next.js multilingue con eccellente supporto TypeScript e ottimizzazioni integrate.
|
|
25
|
+
|
|
26
|
+
> Se preferisci, puoi anche fare riferimento alla [guida next-i18next](https://github.com/aymericzip/intlayer/blob/main/docs/blog/it/i18n_using_next-i18next.md), oppure utilizzare direttamente [Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/intlayer_with_next-intl.md).
|
|
27
|
+
|
|
28
|
+
> Vedi il confronto in [next-i18next vs next-intl vs Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/blog/it/next-i18next_vs_next-intl_vs_intlayer.md).
|
|
29
|
+
|
|
30
|
+
## Pratiche da seguire
|
|
31
|
+
|
|
32
|
+
Prima di entrare nell'implementazione, ecco alcune pratiche che dovresti seguire:
|
|
33
|
+
|
|
34
|
+
- **Imposta gli attributi HTML `lang` e `dir`**
|
|
35
|
+
Nel tuo layout, calcola `dir` usando `getLocaleDirection(locale)` e imposta `<html lang={locale} dir={dir}>` per una corretta accessibilità e SEO.
|
|
36
|
+
- **Dividi i messaggi per namespace**
|
|
37
|
+
Organizza i file JSON per locale e namespace (es. `common.json`, `about.json`) per caricare solo ciò di cui hai bisogno.
|
|
38
|
+
- **Minimizza il payload client**
|
|
39
|
+
Nelle pagine, invia solo i namespace richiesti a `NextIntlClientProvider` (es. `pick(messages, ['common', 'about'])`).
|
|
40
|
+
- **Preferisci pagine statiche**
|
|
41
|
+
Usa pagine statiche il più possibile per migliori prestazioni e SEO.
|
|
42
|
+
- **I18n nei componenti server**
|
|
43
|
+
I componenti server, come le pagine o tutti i componenti non contrassegnati come `client`, sono statici e possono essere prerenderizzati durante la fase di build. Quindi dovremo passare loro le funzioni di traduzione come props.
|
|
44
|
+
- **Configura i tipi TypeScript**
|
|
45
|
+
Per i tuoi locali, per garantire la sicurezza dei tipi in tutta l'applicazione.
|
|
46
|
+
- **Proxy per il reindirizzamento**
|
|
47
|
+
Usa un proxy per gestire il rilevamento della lingua e il routing, e reindirizzare l'utente all'URL con il prefisso della lingua appropriata.
|
|
48
|
+
- **Internazionalizzazione dei tuoi metadata, sitemap, robots.txt**
|
|
49
|
+
Internazionalizza i tuoi metadata, sitemap, robots.txt usando la funzione `generateMetadata` fornita da Next.js per garantire una migliore scoperta da parte dei motori di ricerca in tutte le lingue.
|
|
50
|
+
- **Localizza i Link**
|
|
51
|
+
Localizza i Link usando il componente `Link` per reindirizzare l'utente all'URL con il prefisso della lingua appropriata. È importante garantire la scoperta delle tue pagine in tutte le lingue.
|
|
52
|
+
- **Automatizza test e traduzioni**
|
|
53
|
+
Automatizzare test e traduzioni aiuta a risparmiare tempo nella manutenzione della tua applicazione multilingue.
|
|
54
|
+
|
|
55
|
+
> Consulta la nostra documentazione che elenca tutto ciò che devi sapere sull'internazionalizzazione e SEO: [Internationalization (i18n) with next-intl](https://github.com/aymericzip/intlayer/blob/main/docs/blog/it/internationalization_and_SEO.md).
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Guida passo-passo per configurare next-intl in un'applicazione Next.js
|
|
60
|
+
|
|
61
|
+
<iframe
|
|
62
|
+
src="https://stackblitz.com/github/aymericzip/next-intl-template?embed=1&ctl=1&file=src/i18n.ts"
|
|
63
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
64
|
+
title="Demo CodeSandbox - Come internazionalizzare la tua applicazione usando Intlayer"
|
|
65
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
66
|
+
loading="lazy"
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
> Vedi [Application Template](https://github.com/aymericzip/next-intl-template) su GitHub.
|
|
70
|
+
|
|
71
|
+
Ecco la struttura del progetto che andremo a creare:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
.
|
|
75
|
+
├── global.ts
|
|
76
|
+
├── locales
|
|
77
|
+
│ ├── en
|
|
78
|
+
│ │ ├── common.json
|
|
79
|
+
│ │ └── about.json
|
|
80
|
+
│ ├── fr
|
|
81
|
+
│ │ ├── common.json
|
|
82
|
+
│ │ └── about.json
|
|
83
|
+
│ └── es
|
|
84
|
+
│ ├── common.json
|
|
85
|
+
│ └── about.json
|
|
86
|
+
└── src # Src è opzionale
|
|
87
|
+
├── proxy.ts
|
|
88
|
+
├── app
|
|
89
|
+
│ ├── i18n.ts
|
|
90
|
+
│ └── [locale]
|
|
91
|
+
│ ├── layout.tsx
|
|
92
|
+
│ ├── (home) # / (Gruppo di Rotte per non inquinare tutte le pagine con risorse home)
|
|
93
|
+
│ │ ├── layout.tsx
|
|
94
|
+
│ │ └── page.tsx
|
|
95
|
+
│ └── about # /about
|
|
96
|
+
│ ├── layout.tsx
|
|
97
|
+
│ └── page.tsx
|
|
98
|
+
└── components
|
|
99
|
+
├── ClientComponent.tsx
|
|
100
|
+
└── ServerComponent.tsx
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Passo 1: Installa le Dipendenze
|
|
104
|
+
|
|
105
|
+
Installa i pacchetti necessari usando npm:
|
|
106
|
+
|
|
107
|
+
```bash packageManager="npm"
|
|
108
|
+
npm install next-intl
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
```bash packageManager="pnpm"
|
|
112
|
+
pnpm add next-intl
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```bash packageManager="yarn"
|
|
116
|
+
yarn add next-intl
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
- **next-intl**: La libreria principale per l'internazionalizzazione del Next.js App Router che fornisce hook, funzioni server e provider client per la gestione delle traduzioni.
|
|
120
|
+
|
|
121
|
+
### Passo 2: Configura il tuo Progetto
|
|
122
|
+
|
|
123
|
+
Crea un file di configurazione che definisce le tue localizzazioni supportate e configura la richiesta di next-intl. Questo file funge da fonte unica di verità per la tua configurazione i18n e garantisce la sicurezza dei tipi in tutta la tua applicazione.
|
|
124
|
+
|
|
125
|
+
Centralizzare la configurazione delle localizzazioni previene incoerenze e rende più semplice aggiungere o rimuovere localizzazioni in futuro. La funzione `getRequestConfig` viene eseguita ad ogni richiesta e carica solo le traduzioni necessarie per ogni pagina, abilitando il code-splitting e riducendo la dimensione del bundle.
|
|
126
|
+
|
|
127
|
+
```tsx fileName="src/i18n.ts"
|
|
128
|
+
import { notFound } from "next/navigation";
|
|
129
|
+
import createMiddleware from "next-intl/middleware";
|
|
130
|
+
import { createNavigation } from "next-intl/navigation";
|
|
131
|
+
|
|
132
|
+
// Definisci le localizzazioni supportate con sicurezza dei tipi
|
|
133
|
+
export const locales = ["en", "fr", "es"] as const;
|
|
134
|
+
export type Locale = (typeof locales)[number];
|
|
135
|
+
export const defaultLocale: Locale = "en";
|
|
136
|
+
|
|
137
|
+
export function isRTL(locale: Locale | (string & {})) {
|
|
138
|
+
// Verifica se la lingua è scritta da destra a sinistra
|
|
139
|
+
return /^(ar|fa|he|iw|ur|ps|sd|ug|yi|ckb|ku)(-|$)/i.test(locale);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Carica i messaggi dinamicamente per locale per abilitare il code-splitting
|
|
143
|
+
// Promise.all carica i namespace in parallelo per migliorare le prestazioni
|
|
144
|
+
async function loadMessages(locale: Locale) {
|
|
145
|
+
// Carica solo i namespace necessari per il tuo layout/pagine
|
|
146
|
+
const [common, home, about] = await Promise.all([
|
|
147
|
+
import(`../locales/${locale}/common.json`).then((m) => m.default),
|
|
148
|
+
import(`../locales/${locale}/home.json`).then((m) => m.default),
|
|
149
|
+
import(`../locales/${locale}/about.json`).then((m) => m.default),
|
|
150
|
+
// ... I futuri file JSON dovrebbero essere aggiunti qui
|
|
151
|
+
]);
|
|
152
|
+
|
|
153
|
+
return { common, home, about } as const;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Helper per generare URL localizzati (es. /about vs /fr/about)
|
|
157
|
+
export function localizedPath(locale: string, path: string) {
|
|
158
|
+
return locale === defaultLocale ? path : `/${locale}${path}`;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// getRequestConfig viene eseguito ad ogni richiesta e fornisce i messaggi ai componenti server
|
|
162
|
+
// Qui è dove next-intl si integra con il rendering server-side di Next.js
|
|
163
|
+
export default async function getRequestConfig({
|
|
164
|
+
requestLocale,
|
|
165
|
+
}: {
|
|
166
|
+
requestLocale: Promise<string | undefined>;
|
|
167
|
+
}) {
|
|
168
|
+
const requested: Locale = ((await requestLocale) as Locale) ?? defaultLocale;
|
|
169
|
+
|
|
170
|
+
if (!locales.includes(requested)) notFound();
|
|
171
|
+
|
|
172
|
+
return {
|
|
173
|
+
locale: requested,
|
|
174
|
+
messages: await loadMessages(requested),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function getCookie(locale: Locale) {
|
|
179
|
+
return [
|
|
180
|
+
`NEXT_LOCALE=${locale}`,
|
|
181
|
+
"Path=/",
|
|
182
|
+
`Max-Age=${60 * 60 * 24 * 365}`, // 1 anno
|
|
183
|
+
"SameSite=Lax",
|
|
184
|
+
].join("; ");
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const routingOptions = {
|
|
188
|
+
locales,
|
|
189
|
+
defaultLocale,
|
|
190
|
+
localePrefix: "as-needed", // Cambia il percorso /en/... in /...
|
|
191
|
+
// Opzionale: percorsi localizzati
|
|
192
|
+
// pathnames: {
|
|
193
|
+
// '/': '/',
|
|
194
|
+
// '/about': {en: '/about', fr: '/a-propos', es: '/acerca-de'},
|
|
195
|
+
// '/blog/[slug]': '/blog/[slug]'
|
|
196
|
+
// }
|
|
197
|
+
// localeDetection: true, // previene i redirect da "/" a "/en" basati sui cookie
|
|
198
|
+
} as const;
|
|
199
|
+
|
|
200
|
+
export const { Link, redirect, usePathname, useRouter, getPathname } =
|
|
201
|
+
createNavigation(routingOptions);
|
|
202
|
+
|
|
203
|
+
export const proxy = createMiddleware(routingOptions);
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Passo 3: Definire le Rotte Dinamiche per le Locali
|
|
207
|
+
|
|
208
|
+
Configura il routing dinamico per le localizzazioni creando una cartella `[locale]` nella tua cartella app. Questo permette a Next.js di gestire il routing basato sulla localizzazione dove ogni locale diventa un segmento dell'URL (es. `/en/about`, `/fr/about`).
|
|
209
|
+
|
|
210
|
+
L'uso di rotte dinamiche consente a Next.js di generare pagine statiche per tutte le localizzazioni al momento della build, migliorando le prestazioni e la SEO. Il componente layout imposta gli attributi HTML `lang` e `dir` in base al locale, cosa cruciale per l'accessibilità e la comprensione da parte dei motori di ricerca.
|
|
211
|
+
|
|
212
|
+
```tsx fileName="src/app/[locale]/layout.tsx"
|
|
213
|
+
import type { ReactNode } from "react";
|
|
214
|
+
import { locales } from "@/i18n";
|
|
215
|
+
import { getLocaleDirection, setRequestLocale } from "next-intl/server";
|
|
216
|
+
|
|
217
|
+
// Pre-generare pagine statiche per tutte le localizzazioni al momento della build (SSG)
|
|
218
|
+
// Questo migliora le prestazioni e la SEO
|
|
219
|
+
export function generateStaticParams() {
|
|
220
|
+
return locales.map((locale) => ({ locale }));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export default function LocaleLayout({
|
|
224
|
+
children,
|
|
225
|
+
params,
|
|
226
|
+
}: {
|
|
227
|
+
children: ReactNode;
|
|
228
|
+
params: Promise<{ locale: string }>;
|
|
229
|
+
}) {
|
|
230
|
+
// Nel Next.js App Router, params è una Promise (può essere awaitata)
|
|
231
|
+
// Questo permette di risolvere segmenti di route dinamici in modo asincrono
|
|
232
|
+
const { locale } = await params;
|
|
233
|
+
|
|
234
|
+
// Critico: setRequestLocale indica a next-intl quale locale usare per questa richiesta
|
|
235
|
+
// Senza questo, getTranslations() non saprà quale locale usare nei componenti server
|
|
236
|
+
setRequestLocale(locale);
|
|
237
|
+
|
|
238
|
+
// Ottieni la direzione del testo (LTR/RTL) per un corretto rendering HTML
|
|
239
|
+
const dir = getLocaleDirection(locale);
|
|
240
|
+
|
|
241
|
+
return (
|
|
242
|
+
<html lang={locale} dir={dir}>
|
|
243
|
+
<body>{children}</body>
|
|
244
|
+
</html>
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
```tsx fileName="src/app/[locale]/about/page.tsx"
|
|
250
|
+
import { getTranslations, getMessages, getFormatter } from "next-intl/server";
|
|
251
|
+
import { NextIntlClientProvider } from "next-intl";
|
|
252
|
+
import pick from "lodash/pick";
|
|
253
|
+
import ServerComponent from "@/components/ServerComponent";
|
|
254
|
+
import ClientComponent from "@/components/ClientComponent";
|
|
255
|
+
|
|
256
|
+
export default async function AboutPage({
|
|
257
|
+
params,
|
|
258
|
+
}: {
|
|
259
|
+
params: Promise<{ locale: string }>;
|
|
260
|
+
}) {
|
|
261
|
+
const { locale } = await params;
|
|
262
|
+
|
|
263
|
+
// I messaggi vengono caricati lato server. Invia solo ciò che è necessario al client.
|
|
264
|
+
// Questo minimizza il bundle JavaScript inviato al browser
|
|
265
|
+
const messages = await getMessages();
|
|
266
|
+
const clientMessages = pick(messages, ["common", "about"]);
|
|
267
|
+
|
|
268
|
+
// Traduzioni/formattazioni strettamente lato server
|
|
269
|
+
// Questi vengono eseguiti sul server e possono essere passati come props ai componenti
|
|
270
|
+
const tAbout = await getTranslations("about");
|
|
271
|
+
const tCounter = await getTranslations("about.counter");
|
|
272
|
+
const format = await getFormatter();
|
|
273
|
+
|
|
274
|
+
const initialFormattedCount = format.number(0);
|
|
275
|
+
|
|
276
|
+
return (
|
|
277
|
+
// NextIntlClientProvider rende le traduzioni disponibili ai componenti client
|
|
278
|
+
// Passa solo i namespace che i tuoi componenti client effettivamente usano
|
|
279
|
+
<NextIntlClientProvider locale={locale} messages={clientMessages}>
|
|
280
|
+
<main>
|
|
281
|
+
<h1>{tAbout("title")}</h1>
|
|
282
|
+
<ClientComponent />
|
|
283
|
+
<ServerComponent
|
|
284
|
+
formattedCount={initialFormattedCount}
|
|
285
|
+
label={tCounter("label")}
|
|
286
|
+
increment={tCounter("increment")}
|
|
287
|
+
/>
|
|
288
|
+
</main>
|
|
289
|
+
</NextIntlClientProvider>
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Passo 4: Crea i Tuoi File di Traduzione
|
|
295
|
+
|
|
296
|
+
Crea file JSON per ogni locale e namespace. Questa struttura ti permette di organizzare le traduzioni in modo logico e caricare solo ciò di cui hai bisogno per ogni pagina.
|
|
297
|
+
|
|
298
|
+
Organizzare le traduzioni per namespace (ad esempio, `common.json`, `about.json`) consente il code splitting e riduce la dimensione del bundle. Carichi solo le traduzioni necessarie per ogni pagina, migliorando le prestazioni.
|
|
299
|
+
|
|
300
|
+
```json fileName="locales/en/common.json"
|
|
301
|
+
{
|
|
302
|
+
"welcome": "Welcome",
|
|
303
|
+
"greeting": "Hello, world!"
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
```json fileName="locales/fr/common.json"
|
|
308
|
+
{
|
|
309
|
+
"welcome": "Bienvenue",
|
|
310
|
+
"greeting": "Bonjour le monde!"
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
```json fileName="locales/en/about.json"
|
|
315
|
+
{
|
|
316
|
+
"title": "About",
|
|
317
|
+
"description": "About page description",
|
|
318
|
+
"counter": {
|
|
319
|
+
"label": "Counter",
|
|
320
|
+
"increment": "Increment"
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
```json fileName="locales/fr/about.json"
|
|
326
|
+
{
|
|
327
|
+
"title": "À propos",
|
|
328
|
+
"description": "Description de la page À propos",
|
|
329
|
+
"counter": {
|
|
330
|
+
"label": "Compteur",
|
|
331
|
+
"increment": "Incrémenter"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Passo 5: Utilizza le Traduzioni nelle Tue Pagine
|
|
337
|
+
|
|
338
|
+
Crea un componente pagina che carica le traduzioni sul server e le passa sia ai componenti server che client. Questo garantisce che le traduzioni siano caricate prima del rendering e previene il lampeggiamento del contenuto.
|
|
339
|
+
|
|
340
|
+
Il caricamento delle traduzioni lato server migliora la SEO e previene il FOUC (Flash of Untranslated Content). Utilizzando `pick` per inviare solo i namespace necessari al provider client, minimizziamo il bundle JavaScript inviato al browser.
|
|
341
|
+
|
|
342
|
+
```tsx fileName="src/app/[locale]/about/page.tsx"
|
|
343
|
+
import { getTranslations, getMessages, getFormatter } from "next-intl/server";
|
|
344
|
+
import { NextIntlClientProvider } from "next-intl";
|
|
345
|
+
import pick from "lodash/pick";
|
|
346
|
+
import ServerComponent from "@/components/ServerComponent";
|
|
347
|
+
import ClientComponent from "@/components/ClientComponent";
|
|
348
|
+
|
|
349
|
+
export default async function AboutPage({
|
|
350
|
+
params,
|
|
351
|
+
}: {
|
|
352
|
+
params: Promise<{ locale: string }>;
|
|
353
|
+
}) {
|
|
354
|
+
const { locale } = await params;
|
|
355
|
+
|
|
356
|
+
// I messaggi vengono caricati lato server. Invia solo ciò che è necessario al client.
|
|
357
|
+
// Questo minimizza il bundle JavaScript inviato al browser
|
|
358
|
+
const messages = await getMessages();
|
|
359
|
+
const clientMessages = pick(messages, ["common", "about"]);
|
|
360
|
+
|
|
361
|
+
// Traduzioni/formattazioni strettamente lato server
|
|
362
|
+
// Queste vengono eseguite sul server e possono essere passate come props ai componenti
|
|
363
|
+
const tAbout = await getTranslations("about");
|
|
364
|
+
const tCounter = await getTranslations("about.counter");
|
|
365
|
+
const format = await getFormatter();
|
|
366
|
+
|
|
367
|
+
const initialFormattedCount = format.number(0);
|
|
368
|
+
|
|
369
|
+
return (
|
|
370
|
+
// NextIntlClientProvider rende le traduzioni disponibili ai componenti client
|
|
371
|
+
// Passa solo i namespace che i tuoi componenti client effettivamente usano
|
|
372
|
+
<NextIntlClientProvider locale={locale} messages={clientMessages}>
|
|
373
|
+
<main>
|
|
374
|
+
<h1>{tAbout("title")}</h1>
|
|
375
|
+
<ClientComponent />
|
|
376
|
+
<ServerComponent
|
|
377
|
+
formattedCount={initialFormattedCount}
|
|
378
|
+
label={tCounter("label")}
|
|
379
|
+
increment={tCounter("increment")}
|
|
380
|
+
/>
|
|
381
|
+
</main>
|
|
382
|
+
</NextIntlClientProvider>
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### Passo 6: Usa le Traduzioni nei Componenti Client
|
|
388
|
+
|
|
389
|
+
I componenti client possono utilizzare gli hook `useTranslations` e `useFormatter` per accedere alle traduzioni e alle funzioni di formattazione. Questi hook leggono dal contesto `NextIntlClientProvider`.
|
|
390
|
+
|
|
391
|
+
I componenti client necessitano degli hook di React per accedere alle traduzioni. Gli hook `useTranslations` e `useFormatter` si integrano perfettamente con next-intl e forniscono aggiornamenti reattivi quando la locale cambia.
|
|
392
|
+
|
|
393
|
+
> Non dimenticare di aggiungere i namespace richiesti ai messaggi client della pagina (includi solo i namespace di cui i tuoi componenti client hanno effettivamente bisogno).
|
|
394
|
+
|
|
395
|
+
```tsx fileName="src/components/ClientComponent.tsx"
|
|
396
|
+
"use client";
|
|
397
|
+
|
|
398
|
+
import React, { useState } from "react";
|
|
399
|
+
import { useTranslations, useFormatter } from "next-intl";
|
|
400
|
+
|
|
401
|
+
const ClientComponent = () => {
|
|
402
|
+
// Ambito direttamente sull'oggetto annidato
|
|
403
|
+
// useTranslations/useFormatter sono hook che leggono dal contesto NextIntlClientProvider
|
|
404
|
+
// Funzionano solo se il componente è racchiuso in NextIntlClientProvider
|
|
405
|
+
const t = useTranslations("about.counter");
|
|
406
|
+
const format = useFormatter();
|
|
407
|
+
const [count, setCount] = useState(0);
|
|
408
|
+
|
|
409
|
+
return (
|
|
410
|
+
<div>
|
|
411
|
+
<p>{format.number(count)}</p>
|
|
412
|
+
<button
|
|
413
|
+
aria-label={t("label")}
|
|
414
|
+
onClick={() => setCount((count) => count + 1)}
|
|
415
|
+
>
|
|
416
|
+
{t("increment")}
|
|
417
|
+
</button>
|
|
418
|
+
</div>
|
|
419
|
+
);
|
|
420
|
+
};
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### Passo 7: Usare le Traduzioni nei Componenti Server
|
|
424
|
+
|
|
425
|
+
I componenti server non possono usare React hooks, quindi ricevono traduzioni e formatter tramite props dai loro componenti genitori. Questo approccio mantiene i componenti server sincroni e permette loro di essere annidati all'interno di componenti client.
|
|
426
|
+
|
|
427
|
+
I componenti server che potrebbero essere nidificati all'interno di confini client devono essere sincroni. Passando stringhe tradotte e valori formattati come props, evitiamo operazioni asincrone e garantiamo un rendering corretto. Pre-calcola traduzioni e formattazioni nel componente pagina genitore.
|
|
428
|
+
|
|
429
|
+
```tsx fileName="src/components/ServerComponent.tsx"
|
|
430
|
+
// I componenti server nidificati all'interno di componenti client devono essere sincroni
|
|
431
|
+
// React non può serializzare funzioni async attraverso il confine server/client
|
|
432
|
+
// Soluzione: pre-calcolare traduzioni/formati nel genitore e passarli come props
|
|
433
|
+
type ServerComponentProps = {
|
|
434
|
+
formattedCount: string; // conteggio formattato
|
|
435
|
+
label: string; // etichetta
|
|
436
|
+
increment: string; // incremento
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
const ServerComponent = ({
|
|
440
|
+
formattedCount,
|
|
441
|
+
label,
|
|
442
|
+
increment,
|
|
443
|
+
}: ServerComponentProps) => {
|
|
444
|
+
return (
|
|
445
|
+
<div>
|
|
446
|
+
<p>{formattedCount}</p>
|
|
447
|
+
<button aria-label={label}>{increment}</button>
|
|
448
|
+
</div>
|
|
449
|
+
);
|
|
450
|
+
};
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
> Nella tua pagina/layout, usa `getTranslations` e `getFormatter` da `next-intl/server` per pre-calcolare traduzioni e formattazioni, quindi passale come props ai componenti server.
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
### (Opzionale) Passo 8: Cambiare la lingua del tuo contenuto
|
|
458
|
+
|
|
459
|
+
Per cambiare la lingua del tuo contenuto con next-intl, rendi i link consapevoli della locale che puntano allo stesso pathname cambiando la locale. Il provider riscrive automaticamente gli URL, quindi devi solo indirizzare la rotta corrente.
|
|
460
|
+
|
|
461
|
+
```tsx fileName="src/components/LocaleSwitcher.tsx"
|
|
462
|
+
"use client";
|
|
463
|
+
|
|
464
|
+
import Link from "next/link";
|
|
465
|
+
import { usePathname } from "next/navigation";
|
|
466
|
+
import { useLocale } from "next-intl";
|
|
467
|
+
import { defaultLocale, getCookie, type Locale, locales } from "@/i18n";
|
|
468
|
+
|
|
469
|
+
const getLocaleLabel = (locale: Locale): string => {
|
|
470
|
+
try {
|
|
471
|
+
const displayNames = new Intl.DisplayNames([locale], { type: "language" });
|
|
472
|
+
return displayNames.of(locale) ?? locale.toUpperCase();
|
|
473
|
+
} catch {
|
|
474
|
+
return locale.toUpperCase();
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
const localeFlags: Record<Locale, string> = {
|
|
479
|
+
en: "🇬🇧",
|
|
480
|
+
fr: "🇫🇷",
|
|
481
|
+
es: "🇪🇸",
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
export default function LocaleSwitcher() {
|
|
485
|
+
const activeLocale = useLocale();
|
|
486
|
+
const pathname = usePathname();
|
|
487
|
+
|
|
488
|
+
// Rimuove il prefisso della lingua dal pathname per ottenere il percorso base
|
|
489
|
+
const getBasePath = (path: string) => {
|
|
490
|
+
for (const locale of locales) {
|
|
491
|
+
if (path.startsWith(`/${locale}`)) {
|
|
492
|
+
return path.slice(locale.length + 1) || "/";
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
return path;
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
const basePath = getBasePath(pathname);
|
|
499
|
+
|
|
500
|
+
return (
|
|
501
|
+
<nav aria-label="Selettore della lingua">
|
|
502
|
+
<div>
|
|
503
|
+
{(locales as readonly Locale[]).map((locale) => {
|
|
504
|
+
const isActive = locale === activeLocale;
|
|
505
|
+
// Costruisci l'href in base al fatto che sia la lingua predefinita
|
|
506
|
+
const href =
|
|
507
|
+
locale === defaultLocale ? basePath : `/${locale}${basePath}`;
|
|
508
|
+
return (
|
|
509
|
+
<Link
|
|
510
|
+
key={locale}
|
|
511
|
+
href={href}
|
|
512
|
+
aria-current={isActive ? "page" : undefined}
|
|
513
|
+
onClick={() => {
|
|
514
|
+
document.cookie = getCookie(locale);
|
|
515
|
+
}}
|
|
516
|
+
>
|
|
517
|
+
<span>{localeFlags[locale]}</span>
|
|
518
|
+
<span>{getLocaleLabel(locale)}</span>
|
|
519
|
+
<span>{locale.toUpperCase()}</span>
|
|
520
|
+
</Link>
|
|
521
|
+
);
|
|
522
|
+
})}
|
|
523
|
+
</div>
|
|
524
|
+
</nav>
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
### (Opzionale) Passo 9: Usa il componente Link localizzato
|
|
530
|
+
|
|
531
|
+
`next-intl` fornisce un sottopacchetto `next-intl/navigation` che contiene un componente Link localizzato che applica automaticamente la locale attiva. Lo abbiamo già estratto per te nel file `@/i18n`, quindi puoi usarlo così:
|
|
532
|
+
|
|
533
|
+
```tsx fileName="src/components/MyComponent.tsx"
|
|
534
|
+
import { Link } from "@/i18n";
|
|
535
|
+
|
|
536
|
+
return <Link href="/about">t("about.title")</Link>;
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
### (Opzionale) Passo 10: Accedi alla locale attiva all'interno delle Server Actions
|
|
540
|
+
|
|
541
|
+
Le Server Actions possono leggere la locale corrente usando `next-intl/server`. Questo è utile per inviare email localizzate o memorizzare le preferenze linguistiche insieme ai dati inviati.
|
|
542
|
+
|
|
543
|
+
```ts fileName="src/app/actions/get-current-locale.ts"
|
|
544
|
+
"use server";
|
|
545
|
+
|
|
546
|
+
import { getLocale } from "next-intl/server";
|
|
547
|
+
|
|
548
|
+
export async function getCurrentLocale() {
|
|
549
|
+
return getLocale();
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
export async function handleContactForm(formData: FormData) {
|
|
553
|
+
const locale = await getCurrentLocale();
|
|
554
|
+
|
|
555
|
+
// Usa la locale per selezionare template, etichette di analytics, ecc.
|
|
556
|
+
console.log(`Modulo di contatto ricevuto dalla locale ${locale}`);
|
|
557
|
+
}
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
> `getLocale` legge la locale impostata dal proxy di `next-intl`, quindi funziona ovunque sul server: Route Handlers, Server Actions e funzioni edge.
|
|
561
|
+
|
|
562
|
+
### (Opzionale) Passo 11: Internazionalizza i tuoi Metadata
|
|
563
|
+
|
|
564
|
+
Tradurre i contenuti è importante, ma l'obiettivo principale dell'internazionalizzazione è rendere il tuo sito web più visibile al mondo. L'i18n è una leva incredibile per migliorare la visibilità del tuo sito web attraverso una corretta SEO.
|
|
565
|
+
|
|
566
|
+
I metadata opportunamente internazionalizzati aiutano i motori di ricerca a capire quali lingue sono disponibili sulle tue pagine. Questo include l'impostazione dei meta tag hreflang, la traduzione di titoli e descrizioni, e l'assicurarsi che gli URL canonici siano correttamente impostati per ogni locale.
|
|
567
|
+
|
|
568
|
+
```tsx fileName="src/app/[locale]/about/layout.tsx"
|
|
569
|
+
import type { Metadata } from "next";
|
|
570
|
+
import { locales, defaultLocale, localizedPath } from "@/i18n";
|
|
571
|
+
import { getTranslations } from "next-intl/server";
|
|
572
|
+
|
|
573
|
+
// generateMetadata viene eseguito per ogni locale, generando metadata ottimizzati per la SEO
|
|
574
|
+
// Questo aiuta i motori di ricerca a comprendere le versioni alternative in altre lingue
|
|
575
|
+
export async function generateMetadata({
|
|
576
|
+
params,
|
|
577
|
+
}: {
|
|
578
|
+
params: { locale: string };
|
|
579
|
+
}): Promise<Metadata> {
|
|
580
|
+
const { locale } = params;
|
|
581
|
+
const t = await getTranslations({ locale, namespace: "about" });
|
|
582
|
+
|
|
583
|
+
const url = "/about";
|
|
584
|
+
const languages = Object.fromEntries(
|
|
585
|
+
locales.map((locale) => [locale, localizedPath(locale, url)])
|
|
586
|
+
);
|
|
587
|
+
|
|
588
|
+
return {
|
|
589
|
+
title: t("title"),
|
|
590
|
+
description: t("description"),
|
|
591
|
+
alternates: {
|
|
592
|
+
canonical: localizedPath(locale, url),
|
|
593
|
+
languages: { ...languages, "x-default": url },
|
|
594
|
+
},
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
// ... Resto del codice della pagina
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
### (Opzionale) Passo 12: Internazionalizza la tua Sitemap
|
|
602
|
+
|
|
603
|
+
Genera una sitemap che includa tutte le versioni locali delle tue pagine. Questo aiuta i motori di ricerca a scoprire e indicizzare tutte le versioni linguistiche dei tuoi contenuti.
|
|
604
|
+
|
|
605
|
+
Una sitemap correttamente internazionalizzata assicura che i motori di ricerca possano trovare e indicizzare tutte le versioni linguistiche delle tue pagine. Questo migliora la visibilità nei risultati di ricerca internazionali.
|
|
606
|
+
|
|
607
|
+
```tsx fileName="src/app/sitemap.ts"
|
|
608
|
+
import type { MetadataRoute } from "next";
|
|
609
|
+
import { defaultLocale, locales } from "@/i18n";
|
|
610
|
+
|
|
611
|
+
const origin = "https://example.com";
|
|
612
|
+
|
|
613
|
+
const formatterLocalizedPath = (locale: string, path: string) =>
|
|
614
|
+
locale === defaultLocale ? `${origin}${path}` : `${origin}/${locale}${path}`;
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Ottieni una mappa di tutte le localizzazioni e i loro percorsi localizzati
|
|
618
|
+
*
|
|
619
|
+
* Esempio di output:
|
|
620
|
+
* {
|
|
621
|
+
* "en": "https://example.com",
|
|
622
|
+
* "fr": "https://example.com/fr",
|
|
623
|
+
* "es": "https://example.com/es",
|
|
624
|
+
* "x-default": "https://example.com"
|
|
625
|
+
* }
|
|
626
|
+
*/
|
|
627
|
+
const getLocalizedMap = (path: string) =>
|
|
628
|
+
Object.fromEntries([
|
|
629
|
+
...locales.map((locale) => [locale, formatterLocalizedPath(locale, path)]),
|
|
630
|
+
["x-default", formatterLocalizedPath(defaultLocale, path)],
|
|
631
|
+
]);
|
|
632
|
+
|
|
633
|
+
// Genera una sitemap con tutte le varianti locali per una migliore SEO
|
|
634
|
+
// Il campo alternates informa i motori di ricerca sulle versioni linguistiche
|
|
635
|
+
export default function sitemap(): MetadataRoute.Sitemap {
|
|
636
|
+
return [
|
|
637
|
+
{
|
|
638
|
+
url: formatterLocalizedPath(defaultLocale, "/"),
|
|
639
|
+
lastModified: new Date(),
|
|
640
|
+
changeFrequency: "monthly",
|
|
641
|
+
priority: 1.0,
|
|
642
|
+
alternates: { languages: getLocalizedMap("/") },
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
url: formatterLocalizedPath(defaultLocale, "/about"),
|
|
646
|
+
lastModified: new Date(),
|
|
647
|
+
changeFrequency: "monthly",
|
|
648
|
+
priority: 0.7,
|
|
649
|
+
alternates: { languages: getLocalizedMap("/about") },
|
|
650
|
+
},
|
|
651
|
+
];
|
|
652
|
+
}
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
### (Opzionale) Passo 13: Internazionalizza il tuo robots.txt
|
|
656
|
+
|
|
657
|
+
Crea un file robots.txt che gestisca correttamente tutte le versioni locali delle tue rotte protette. Questo assicura che i motori di ricerca non indicizzino pagine di amministrazione o dashboard in nessuna lingua.
|
|
658
|
+
|
|
659
|
+
Configurare correttamente robots.txt per tutte le localizzazioni impedisce ai motori di ricerca di indicizzare pagine sensibili quando le tue rotte sono diverse per ogni locale.
|
|
660
|
+
|
|
661
|
+
```tsx fileName="src/app/robots.ts"
|
|
662
|
+
import type { MetadataRoute } from "next";
|
|
663
|
+
import { locales, defaultLocale } from "@/i18n";
|
|
664
|
+
|
|
665
|
+
const origin = "https://example.com";
|
|
666
|
+
// Genera i percorsi per tutte le localizzazioni (es. /admin, /fr/admin, /es/admin)
|
|
667
|
+
const withAllLocales = (path: string) => [
|
|
668
|
+
path,
|
|
669
|
+
...locales
|
|
670
|
+
.filter((locale) => locale !== defaultLocale)
|
|
671
|
+
.map((locale) => "/" + locale + path),
|
|
672
|
+
];
|
|
673
|
+
|
|
674
|
+
export default function robots(): MetadataRoute.Robots {
|
|
675
|
+
const disallow = [
|
|
676
|
+
...withAllLocales("/dashboard"),
|
|
677
|
+
...withAllLocales("/admin"),
|
|
678
|
+
];
|
|
679
|
+
|
|
680
|
+
return {
|
|
681
|
+
rules: { userAgent: "*", allow: ["/"], disallow },
|
|
682
|
+
host: origin,
|
|
683
|
+
sitemap: origin + "/sitemap.xml",
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
### (Opzionale) Passo 14: Configurare un Proxy per il Routing della Locale
|
|
689
|
+
|
|
690
|
+
Crea un proxy per rilevare automaticamente la locale preferita dall'utente e reindirizzarlo all'URL con il prefisso della locale appropriata. next-intl fornisce una funzione proxy comoda che gestisce questo automaticamente.
|
|
691
|
+
|
|
692
|
+
Il proxy garantisce che gli utenti vengano automaticamente reindirizzati alla loro lingua preferita quando visitano il tuo sito. Inoltre, salva la preferenza dell'utente per le visite future, migliorando l'esperienza utente.
|
|
693
|
+
|
|
694
|
+
```ts fileName="src/proxy.ts"
|
|
695
|
+
import { proxy } from "@/i18n";
|
|
696
|
+
|
|
697
|
+
// Il middleware viene eseguito prima delle route, gestendo il rilevamento della locale e il routing
|
|
698
|
+
// localeDetection: true utilizza l'header Accept-Language per rilevare automaticamente la locale
|
|
699
|
+
export default proxy;
|
|
700
|
+
|
|
701
|
+
export const config = {
|
|
702
|
+
// Salta API, internals di Next e asset statici
|
|
703
|
+
// Regex: corrisponde a tutte le route tranne quelle che iniziano con api, _next, o che contengono un punto (file)
|
|
704
|
+
matcher: ["/((?!api|_next|.*\\..*).*)"],
|
|
705
|
+
};
|
|
706
|
+
```
|
|
707
|
+
|
|
708
|
+
### (Opzionale) Passo 15: Configurare i tipi TypeScript per la Locale
|
|
709
|
+
|
|
710
|
+
Configurare TypeScript ti aiuterà ad ottenere l'autocompletamento e la sicurezza dei tipi per le tue chiavi.
|
|
711
|
+
|
|
712
|
+
Per questo, puoi creare un file global.ts nella radice del tuo progetto e aggiungere il seguente codice:
|
|
713
|
+
|
|
714
|
+
```ts fileName="global.ts"
|
|
715
|
+
import type { locales } from "@/i18n";
|
|
716
|
+
|
|
717
|
+
type Messages = {
|
|
718
|
+
common: typeof import("./locales/en/common.json");
|
|
719
|
+
home: typeof import("./locales/en/home.json");
|
|
720
|
+
about: typeof import("./locales/en/about.json");
|
|
721
|
+
// ... Anche i futuri file JSON dovrebbero essere aggiunti qui
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
declare module "next-intl" {
|
|
725
|
+
interface AppConfig {
|
|
726
|
+
Locale: (typeof locales)[number];
|
|
727
|
+
Messages: Messages;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
Questo codice utilizzerà l'Aumento del Modulo (Module Augmentation) per aggiungere le locales e i messaggi al tipo AppConfig di next-intl.
|
|
733
|
+
|
|
734
|
+
### (Opzionale) Passo 15: Automatizza le tue traduzioni usando Intlayer
|
|
735
|
+
|
|
736
|
+
Intlayer è una libreria **gratuita** e **open-source** progettata per assistere il processo di localizzazione nella tua applicazione. Mentre next-intl gestisce il caricamento e la gestione delle traduzioni, Intlayer aiuta ad automatizzare il flusso di lavoro delle traduzioni.
|
|
737
|
+
|
|
738
|
+
Gestire le traduzioni manualmente può richiedere molto tempo ed essere soggetto a errori. Intlayer automatizza il testing, la generazione e la gestione delle traduzioni, facendoti risparmiare tempo e garantendo coerenza in tutta la tua applicazione.
|
|
739
|
+
|
|
740
|
+
Intlayer ti permette di:
|
|
741
|
+
|
|
742
|
+
- **Dichiarare i tuoi contenuti dove vuoi nella tua codebase**
|
|
743
|
+
Intlayer consente di dichiarare i tuoi contenuti dove vuoi nella tua codebase utilizzando file `.content.{ts|js|json}`. Questo permette una migliore organizzazione dei contenuti, garantendo una maggiore leggibilità e manutenibilità della tua codebase.
|
|
744
|
+
|
|
745
|
+
- **Testare le traduzioni mancanti**
|
|
746
|
+
Intlayer fornisce funzioni di test che possono essere integrate nella tua pipeline CI/CD o nei tuoi test unitari. Scopri di più su [testare le tue traduzioni](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/testing.md).
|
|
747
|
+
|
|
748
|
+
- **Automatizza le tue traduzioni**,
|
|
749
|
+
Intlayer fornisce una CLI e un'estensione per VSCode per automatizzare le tue traduzioni. Può essere integrato nella tua pipeline CI/CD. Scopri di più su [automatizzare le tue traduzioni](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/intlayer_cli.md).
|
|
750
|
+
Puoi usare la tua **chiave API personale e il provider AI di tua scelta**. Fornisce inoltre traduzioni contestuali, vedi [riempi contenuto](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/autoFill.md).
|
|
751
|
+
|
|
752
|
+
- **Connetti contenuti esterni**
|
|
753
|
+
Intlayer ti permette di collegare i tuoi contenuti a un sistema di gestione dei contenuti esterno (CMS). Per recuperarli in modo ottimizzato e inserirli nelle tue risorse JSON. Scopri di più su [recupero di contenuti esterni](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/dictionary/function_fetching.md).
|
|
754
|
+
|
|
755
|
+
- **Editor visuale**
|
|
756
|
+
Intlayer offre un editor visuale gratuito per modificare i tuoi contenuti utilizzando un editor visuale. Scopri di più su [modifica visuale delle tue traduzioni](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/intlayer_visual_editor.md).
|
|
757
|
+
|
|
758
|
+
E altro ancora. Per scoprire tutte le funzionalità offerte da Intlayer, consulta la [documentazione sull'interesse di Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/interest_of_intlayer.md).
|