@intlayer/docs 5.5.8
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/LICENSE +202 -0
- package/ar/CI_CD.md +149 -0
- package/ar/autoFill.md +157 -0
- package/ar/concept/content/file.md +1 -0
- package/ar/configuration.md +492 -0
- package/ar/dictionary/condition.md +213 -0
- package/ar/dictionary/content_extention_customization.md +81 -0
- package/ar/dictionary/enumeration.md +221 -0
- package/ar/dictionary/file.md +209 -0
- package/ar/dictionary/function_fetching.md +190 -0
- package/ar/dictionary/get_started.md +490 -0
- package/ar/dictionary/insertion.md +161 -0
- package/ar/dictionary/markdown.md +343 -0
- package/ar/dictionary/nesting.md +249 -0
- package/ar/dictionary/translation.md +307 -0
- package/ar/header.md +7 -0
- package/ar/how_works_intlayer.md +219 -0
- package/ar/index.md +125 -0
- package/ar/interest_of_intlayer.md +132 -0
- package/ar/intlayer_CMS.md +328 -0
- package/ar/intlayer_cli.md +258 -0
- package/ar/intlayer_visual_editor.md +210 -0
- package/ar/intlayer_with_angular.md +3 -0
- package/ar/intlayer_with_create_react_app.md +1196 -0
- package/ar/intlayer_with_express.md +270 -0
- package/ar/intlayer_with_lynx+react.md +482 -0
- package/ar/intlayer_with_nextjs_14.md +1260 -0
- package/ar/intlayer_with_nextjs_15.md +1311 -0
- package/ar/intlayer_with_nextjs_page_router.md +1099 -0
- package/ar/intlayer_with_react_native+expo.md +539 -0
- package/ar/intlayer_with_vite+preact.md +1679 -0
- package/ar/intlayer_with_vite+react.md +1582 -0
- package/ar/intlayer_with_vite+solid.md +3 -0
- package/ar/intlayer_with_vite+svelte.md +3 -0
- package/ar/intlayer_with_vite+vue.md +989 -0
- package/ar/introduction.md +190 -0
- package/ar/mcp_server.md +150 -0
- package/ar/packages/@intlayer/api/index.md +31 -0
- package/ar/packages/@intlayer/chokidar/index.md +31 -0
- package/ar/packages/@intlayer/cli/index.md +1 -0
- package/ar/packages/@intlayer/config/index.md +116 -0
- package/ar/packages/@intlayer/core/index.md +25 -0
- package/ar/packages/@intlayer/design-system/index.md +21 -0
- package/ar/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/ar/packages/@intlayer/editor/index.md +21 -0
- package/ar/packages/@intlayer/editor-react/index.md +21 -0
- package/ar/packages/@intlayer/webpack/index.md +35 -0
- package/ar/packages/angular-intlayer/index.md +3 -0
- package/ar/packages/express-intlayer/index.md +232 -0
- package/ar/packages/express-intlayer/t.md +448 -0
- package/ar/packages/intlayer/getConfiguration.md +120 -0
- package/ar/packages/intlayer/getEnumeration.md +138 -0
- package/ar/packages/intlayer/getHTMLTextDir.md +97 -0
- package/ar/packages/intlayer/getLocaleLang.md +61 -0
- package/ar/packages/intlayer/getLocaleName.md +93 -0
- package/ar/packages/intlayer/getLocalizedUrl.md +221 -0
- package/ar/packages/intlayer/getMultilingualUrls.md +198 -0
- package/ar/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/ar/packages/intlayer/getTranslation.md +175 -0
- package/ar/packages/intlayer/getTranslationContent.md +175 -0
- package/ar/packages/intlayer/index.md +254 -0
- package/ar/packages/intlayer-cli/index.md +41 -0
- package/ar/packages/intlayer-editor/index.md +113 -0
- package/ar/packages/lynx-intlayer/index.md +58 -0
- package/ar/packages/next-intlayer/index.md +267 -0
- package/ar/packages/next-intlayer/t.md +341 -0
- package/ar/packages/next-intlayer/useDictionary.md +248 -0
- package/ar/packages/next-intlayer/useIntlayer.md +237 -0
- package/ar/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/ar/packages/next-intlayer/useLocale.md +105 -0
- package/ar/packages/preact-intlayer/index.md +3 -0
- package/ar/packages/react-intlayer/index.md +261 -0
- package/ar/packages/react-intlayer/t.md +283 -0
- package/ar/packages/react-intlayer/useDictionary.md +268 -0
- package/ar/packages/react-intlayer/useIntlayer.md +225 -0
- package/ar/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/ar/packages/react-intlayer/useLocale.md +184 -0
- package/ar/packages/react-native-intlayer/index.md +57 -0
- package/ar/packages/react-scripts-intlayer/index.md +57 -0
- package/ar/packages/solid-intlayer/index.md +3 -0
- package/ar/packages/svelte-intlayer/index.md +3 -0
- package/ar/packages/vite-intlayer/index.md +53 -0
- package/ar/packages/vue-intlayer/index.md +3 -0
- package/ar/per_locale_file.md +298 -0
- package/ar/privacy_notice.md +61 -0
- package/ar/roadmap.md +208 -0
- package/ar/terms_of_service.md +33 -0
- package/ar/vs_code_extension.md +139 -0
- package/de/CI_CD.md +149 -0
- package/de/angular-intlayer/index.md +3 -0
- package/de/autoFill.md +157 -0
- package/de/configuration.md +501 -0
- package/de/dictionary/condition.md +213 -0
- package/de/dictionary/content_extention_customization.md +81 -0
- package/de/dictionary/enumeration.md +221 -0
- package/de/dictionary/file.md +207 -0
- package/de/dictionary/function_fetching.md +190 -0
- package/de/dictionary/get_started.md +466 -0
- package/de/dictionary/insertion.md +167 -0
- package/de/dictionary/markdown.md +345 -0
- package/de/dictionary/nesting.md +252 -0
- package/de/dictionary/translation.md +287 -0
- package/de/header.md +5 -0
- package/de/how_works_intlayer.md +216 -0
- package/de/index.md +125 -0
- package/de/insertion.md +0 -0
- package/de/interest_of_intlayer.md +132 -0
- package/de/intlayer_CMS.md +334 -0
- package/de/intlayer_cli.md +274 -0
- package/de/intlayer_visual_editor.md +210 -0
- package/de/intlayer_with_angular.md +3 -0
- package/de/intlayer_with_create_react_app.md +1200 -0
- package/de/intlayer_with_express.md +268 -0
- package/de/intlayer_with_lynx+react.md +482 -0
- package/de/intlayer_with_nextjs_14.md +1258 -0
- package/de/intlayer_with_nextjs_15.md +1306 -0
- package/de/intlayer_with_nextjs_page_router.md +1087 -0
- package/de/intlayer_with_react_native+expo.md +539 -0
- package/de/intlayer_with_vite+preact.md +1701 -0
- package/de/intlayer_with_vite+react.md +1584 -0
- package/de/intlayer_with_vite+solid.md +3 -0
- package/de/intlayer_with_vite+svelte.md +3 -0
- package/de/intlayer_with_vite+vue.md +989 -0
- package/de/introduction.md +186 -0
- package/de/mcp_server.md +150 -0
- package/de/packages/@intlayer/api/index.md +31 -0
- package/de/packages/@intlayer/chokidar/index.md +31 -0
- package/de/packages/@intlayer/cli/index.md +21 -0
- package/de/packages/@intlayer/config/index.md +116 -0
- package/de/packages/@intlayer/core/index.md +25 -0
- package/de/packages/@intlayer/design-system/index.md +21 -0
- package/de/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/de/packages/@intlayer/editor/index.md +21 -0
- package/de/packages/@intlayer/editor-react/index.md +21 -0
- package/de/packages/@intlayer/webpack/index.md +35 -0
- package/de/packages/angular-intlayer/index.md +31 -0
- package/de/packages/express-intlayer/index.md +229 -0
- package/de/packages/express-intlayer/t.md +432 -0
- package/de/packages/intlayer/getConfiguration.md +120 -0
- package/de/packages/intlayer/getEnumeration.md +140 -0
- package/de/packages/intlayer/getHTMLTextDir.md +97 -0
- package/de/packages/intlayer/getLocaleLang.md +57 -0
- package/de/packages/intlayer/getLocaleName.md +93 -0
- package/de/packages/intlayer/getLocalizedUrl.md +221 -0
- package/de/packages/intlayer/getMultilingualUrls.md +198 -0
- package/de/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/de/packages/intlayer/getTranslation.md +166 -0
- package/de/packages/intlayer/getTranslationContent.md +166 -0
- package/de/packages/intlayer/index.md +478 -0
- package/de/packages/intlayer-cli/index.md +41 -0
- package/de/packages/intlayer-editor/index.md +113 -0
- package/de/packages/lynx-intlayer/index.md +58 -0
- package/de/packages/next-intlayer/index.md +263 -0
- package/de/packages/next-intlayer/t.md +325 -0
- package/de/packages/next-intlayer/useDictionary.md +242 -0
- package/de/packages/next-intlayer/useIntlayer.md +237 -0
- package/de/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/de/packages/next-intlayer/useLocale.md +105 -0
- package/de/packages/preact-intlayer/index.md +3 -0
- package/de/packages/react-intlayer/index.md +260 -0
- package/de/packages/react-intlayer/t.md +277 -0
- package/de/packages/react-intlayer/useDictionary.md +260 -0
- package/de/packages/react-intlayer/useIntlayer.md +225 -0
- package/de/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/de/packages/react-intlayer/useLocale.md +184 -0
- package/de/packages/react-native-intlayer/index.md +57 -0
- package/de/packages/react-scripts-intlayer/index.md +57 -0
- package/de/packages/solid-intlayer/index.md +3 -0
- package/de/packages/svelte-intlayer/index.md +3 -0
- package/de/packages/vite-intlayer/index.md +53 -0
- package/de/packages/vue-intlayer/index.md +3 -0
- package/de/per_locale_file.md +298 -0
- package/de/privacy_notice.md +61 -0
- package/de/roadmap.md +206 -0
- package/de/terms_of_service.md +33 -0
- package/de/vs_code_extension.md +139 -0
- package/en/CI_CD.md +149 -0
- package/en/autoFill.md +157 -0
- package/en/configuration.md +506 -0
- package/en/dictionary/condition.md +213 -0
- package/en/dictionary/content_extention_customization.md +81 -0
- package/en/dictionary/enumeration.md +221 -0
- package/en/dictionary/file.md +198 -0
- package/en/dictionary/function_fetching.md +190 -0
- package/en/dictionary/get_started.md +504 -0
- package/en/dictionary/insertion.md +167 -0
- package/en/dictionary/markdown.md +355 -0
- package/en/dictionary/nesting.md +249 -0
- package/en/dictionary/translation.md +285 -0
- package/en/frequent_questions/build_dictionaries.md +37 -0
- package/en/frequent_questions/domain_routing.md +92 -0
- package/en/frequent_questions/esbuild_error.md +9 -0
- package/en/frequent_questions/get_locale_cookie.md +121 -0
- package/en/frequent_questions/intlayer_command_undefined.md +135 -0
- package/en/frequent_questions/locale_incorect_in_url.md +52 -0
- package/en/frequent_questions/static_rendering.md +24 -0
- package/en/frequent_questions/unknown_command.md +76 -0
- package/en/header.md +5 -0
- package/en/how_works_intlayer.md +219 -0
- package/en/index.md +139 -0
- package/en/interest_of_intlayer.md +133 -0
- package/en/intlayer_CMS.md +334 -0
- package/en/intlayer_cli.md +309 -0
- package/en/intlayer_visual_editor.md +244 -0
- package/en/intlayer_with_angular.md +139 -0
- package/en/intlayer_with_create_react_app.md +1209 -0
- package/en/intlayer_with_express.md +391 -0
- package/en/intlayer_with_lynx+react.md +483 -0
- package/en/intlayer_with_nextjs_14.md +1298 -0
- package/en/intlayer_with_nextjs_15.md +1347 -0
- package/en/intlayer_with_nextjs_page_router.md +1126 -0
- package/en/intlayer_with_react_native+expo.md +630 -0
- package/en/intlayer_with_vite+preact.md +1659 -0
- package/en/intlayer_with_vite+react.md +1605 -0
- package/en/intlayer_with_vite+solid.md +254 -0
- package/en/intlayer_with_vite+svelte.md +254 -0
- package/en/intlayer_with_vite+vue.md +1000 -0
- package/en/introduction.md +185 -0
- package/en/mcp_server.md +150 -0
- package/en/packages/@intlayer/api/index.md +31 -0
- package/en/packages/@intlayer/chokidar/index.md +31 -0
- package/en/packages/@intlayer/cli/index.md +21 -0
- package/en/packages/@intlayer/config/index.md +116 -0
- package/en/packages/@intlayer/core/index.md +25 -0
- package/en/packages/@intlayer/design-system/index.md +21 -0
- package/en/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/en/packages/@intlayer/editor/index.md +21 -0
- package/en/packages/@intlayer/editor-react/index.md +21 -0
- package/en/packages/@intlayer/webpack/index.md +35 -0
- package/en/packages/angular-intlayer/index.md +31 -0
- package/en/packages/express-intlayer/index.md +229 -0
- package/en/packages/express-intlayer/t.md +432 -0
- package/en/packages/intlayer/getConfiguration.md +120 -0
- package/en/packages/intlayer/getEnumeration.md +138 -0
- package/en/packages/intlayer/getHTMLTextDir.md +97 -0
- package/en/packages/intlayer/getLocaleLang.md +57 -0
- package/en/packages/intlayer/getLocaleName.md +93 -0
- package/en/packages/intlayer/getLocalizedUrl.md +221 -0
- package/en/packages/intlayer/getMultilingualUrls.md +198 -0
- package/en/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/en/packages/intlayer/getTranslation.md +166 -0
- package/en/packages/intlayer/getTranslationContent.md +166 -0
- package/en/packages/intlayer/index.md +476 -0
- package/en/packages/intlayer-cli/index.md +41 -0
- package/en/packages/intlayer-editor/index.md +113 -0
- package/en/packages/lynx-intlayer/index.md +60 -0
- package/en/packages/next-intlayer/index.md +263 -0
- package/en/packages/next-intlayer/t.md +326 -0
- package/en/packages/next-intlayer/useDictionary.md +242 -0
- package/en/packages/next-intlayer/useIntlayer.md +237 -0
- package/en/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/en/packages/next-intlayer/useLocale.md +105 -0
- package/en/packages/preact-intlayer/index.md +31 -0
- package/en/packages/react-intlayer/index.md +257 -0
- package/en/packages/react-intlayer/t.md +277 -0
- package/en/packages/react-intlayer/useDictionary.md +260 -0
- package/en/packages/react-intlayer/useIntlayer.md +225 -0
- package/en/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/en/packages/react-intlayer/useLocale.md +184 -0
- package/en/packages/react-native-intlayer/index.md +59 -0
- package/en/packages/react-scripts-intlayer/index.md +57 -0
- package/en/packages/solid-intlayer/index.md +31 -0
- package/en/packages/svelte-intlayer/index.md +31 -0
- package/en/packages/vite-intlayer/index.md +53 -0
- package/en/packages/vue-intlayer/index.md +31 -0
- package/en/per_locale_file.md +297 -0
- package/en/privacy_notice.md +61 -0
- package/en/roadmap.md +270 -0
- package/en/t.md +163 -0
- package/en/terms_of_service.md +33 -0
- package/en/vs_code_extension.md +129 -0
- package/en-GB/CI_CD.md +149 -0
- package/en-GB/autoFill.md +0 -0
- package/en-GB/configuration.md +490 -0
- package/en-GB/dictionary/condition.md +213 -0
- package/en-GB/dictionary/content_extention_customization.md +83 -0
- package/en-GB/dictionary/enumeration.md +221 -0
- package/en-GB/dictionary/file.md +201 -0
- package/en-GB/dictionary/function_fetching.md +190 -0
- package/en-GB/dictionary/get_started.md +466 -0
- package/en-GB/dictionary/insertion.md +167 -0
- package/en-GB/dictionary/markdown.md +343 -0
- package/en-GB/dictionary/nesting.md +249 -0
- package/en-GB/dictionary/translation.md +285 -0
- package/en-GB/header.md +1 -0
- package/en-GB/how_works_intlayer.md +217 -0
- package/en-GB/index.md +142 -0
- package/en-GB/interest_of_intlayer.md +123 -0
- package/en-GB/intlayer_CMS.md +334 -0
- package/en-GB/intlayer_cli.md +239 -0
- package/en-GB/intlayer_visual_editor.md +210 -0
- package/en-GB/intlayer_with_angular.md +3 -0
- package/en-GB/intlayer_with_create_react_app.md +1192 -0
- package/en-GB/intlayer_with_express.md +267 -0
- package/en-GB/intlayer_with_lynx+react.md +484 -0
- package/en-GB/intlayer_with_nextjs_14.md +1267 -0
- package/en-GB/intlayer_with_nextjs_15.md +1308 -0
- package/en-GB/intlayer_with_nextjs_page_router.md +1087 -0
- package/en-GB/intlayer_with_react_native+expo.md +539 -0
- package/en-GB/intlayer_with_vite+preact.md +1648 -0
- package/en-GB/intlayer_with_vite+react.md +1430 -0
- package/en-GB/intlayer_with_vite+solid.md +3 -0
- package/en-GB/intlayer_with_vite+svelte.md +3 -0
- package/en-GB/intlayer_with_vite+vue.md +993 -0
- package/en-GB/introduction.md +201 -0
- package/en-GB/mcp_server.md +150 -0
- package/en-GB/packages/@intlayer/api/index.md +31 -0
- package/en-GB/packages/@intlayer/chokidar/index.md +31 -0
- package/en-GB/packages/@intlayer/cli/index.md +21 -0
- package/en-GB/packages/@intlayer/config/index.md +116 -0
- package/en-GB/packages/@intlayer/core/index.md +25 -0
- package/en-GB/packages/@intlayer/design-system/index.md +21 -0
- package/en-GB/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/en-GB/packages/@intlayer/editor/index.md +21 -0
- package/en-GB/packages/@intlayer/editor-react/index.md +21 -0
- package/en-GB/packages/@intlayer/webpack/index.md +35 -0
- package/en-GB/packages/angular-intlayer/index.md +3 -0
- package/en-GB/packages/express-intlayer/index.md +229 -0
- package/en-GB/packages/express-intlayer/t.md +432 -0
- package/en-GB/packages/intlayer/getConfiguration.md +120 -0
- package/en-GB/packages/intlayer/getEnumeration.md +140 -0
- package/en-GB/packages/intlayer/getHTMLTextDir.md +97 -0
- package/en-GB/packages/intlayer/getLocaleLang.md +57 -0
- package/en-GB/packages/intlayer/getLocaleName.md +93 -0
- package/en-GB/packages/intlayer/getLocalizedUrl.md +221 -0
- package/en-GB/packages/intlayer/getMultilingualUrls.md +198 -0
- package/en-GB/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/en-GB/packages/intlayer/getTranslation.md +166 -0
- package/en-GB/packages/intlayer/getTranslationContent.md +166 -0
- package/en-GB/packages/intlayer/index.md +476 -0
- package/en-GB/packages/intlayer-cli/index.md +41 -0
- package/en-GB/packages/intlayer-editor/index.md +113 -0
- package/en-GB/packages/lynx-intlayer/index.md +58 -0
- package/en-GB/packages/next-intlayer/index.md +263 -0
- package/en-GB/packages/next-intlayer/t.md +326 -0
- package/en-GB/packages/next-intlayer/useDictionary.md +242 -0
- package/en-GB/packages/next-intlayer/useIntlayer.md +237 -0
- package/en-GB/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/en-GB/packages/next-intlayer/useLocale.md +105 -0
- package/en-GB/packages/preact-intlayer/index.md +3 -0
- package/en-GB/packages/react-intlayer/index.md +257 -0
- package/en-GB/packages/react-intlayer/t.md +277 -0
- package/en-GB/packages/react-intlayer/useDictionary.md +260 -0
- package/en-GB/packages/react-intlayer/useIntlayer.md +225 -0
- package/en-GB/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/en-GB/packages/react-intlayer/useLocale.md +184 -0
- package/en-GB/packages/react-native-intlayer/index.md +57 -0
- package/en-GB/packages/react-scripts-intlayer/index.md +57 -0
- package/en-GB/packages/solid-intlayer/index.md +3 -0
- package/en-GB/packages/svelte-intlayer/index.md +3 -0
- package/en-GB/packages/vite-intlayer/index.md +53 -0
- package/en-GB/packages/vue-intlayer/index.md +3 -0
- package/en-GB/per_locale_file.md +298 -0
- package/en-GB/privacy_notice.md +57 -0
- package/en-GB/roadmap.md +206 -0
- package/en-GB/terms_of_service.md +33 -0
- package/en-GB/vs_code_extension.md +139 -0
- package/es/CI_CD.md +149 -0
- package/es/autoFill.md +157 -0
- package/es/configuration.md +503 -0
- package/es/dictionary/condition.md +213 -0
- package/es/dictionary/content_extention_customization.md +81 -0
- package/es/dictionary/enumeration.md +221 -0
- package/es/dictionary/file.md +206 -0
- package/es/dictionary/function_fetching.md +190 -0
- package/es/dictionary/get_started.md +466 -0
- package/es/dictionary/insertion.md +161 -0
- package/es/dictionary/markdown.md +338 -0
- package/es/dictionary/nesting.md +249 -0
- package/es/dictionary/translation.md +287 -0
- package/es/header.md +5 -0
- package/es/how_works_intlayer.md +217 -0
- package/es/index.md +122 -0
- package/es/interest_of_intlayer.md +132 -0
- package/es/intlayer_CMS.md +334 -0
- package/es/intlayer_cli.md +274 -0
- package/es/intlayer_visual_editor.md +210 -0
- package/es/intlayer_with_angular.md +3 -0
- package/es/intlayer_with_create_react_app.md +1192 -0
- package/es/intlayer_with_express.md +276 -0
- package/es/intlayer_with_lynx+react.md +475 -0
- package/es/intlayer_with_nextjs_14.md +1258 -0
- package/es/intlayer_with_nextjs_15.md +1308 -0
- package/es/intlayer_with_nextjs_page_router.md +1088 -0
- package/es/intlayer_with_react_native+expo.md +180 -0
- package/es/intlayer_with_vite+preact.md +1637 -0
- package/es/intlayer_with_vite+react.md +1592 -0
- package/es/intlayer_with_vite+solid.md +3 -0
- package/es/intlayer_with_vite+svelte.md +3 -0
- package/es/intlayer_with_vite+vue.md +947 -0
- package/es/introduction.md +184 -0
- package/es/mcp_server.md +150 -0
- package/es/packages/@intlayer/api/index.md +31 -0
- package/es/packages/@intlayer/chokidar/index.md +31 -0
- package/es/packages/@intlayer/cli/index.md +21 -0
- package/es/packages/@intlayer/config/index.md +116 -0
- package/es/packages/@intlayer/core/index.md +25 -0
- package/es/packages/@intlayer/design-system/index.md +21 -0
- package/es/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/es/packages/@intlayer/editor/index.md +21 -0
- package/es/packages/@intlayer/editor-react/index.md +21 -0
- package/es/packages/@intlayer/webpack/index.md +35 -0
- package/es/packages/angular-intlayer/index.md +3 -0
- package/es/packages/express-intlayer/index.md +229 -0
- package/es/packages/express-intlayer/t.md +432 -0
- package/es/packages/intlayer/getConfiguration.md +120 -0
- package/es/packages/intlayer/getEnumeration.md +138 -0
- package/es/packages/intlayer/getHTMLTextDir.md +97 -0
- package/es/packages/intlayer/getLocaleLang.md +57 -0
- package/es/packages/intlayer/getLocaleName.md +93 -0
- package/es/packages/intlayer/getLocalizedUrl.md +221 -0
- package/es/packages/intlayer/getMultilingualUrls.md +198 -0
- package/es/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/es/packages/intlayer/getTranslation.md +166 -0
- package/es/packages/intlayer/getTranslationContent.md +166 -0
- package/es/packages/intlayer/index.md +478 -0
- package/es/packages/intlayer-cli/index.md +41 -0
- package/es/packages/intlayer-editor/index.md +115 -0
- package/es/packages/lynx-intlayer/index.md +58 -0
- package/es/packages/next-intlayer/index.md +263 -0
- package/es/packages/next-intlayer/t.md +325 -0
- package/es/packages/next-intlayer/useDictionary.md +242 -0
- package/es/packages/next-intlayer/useIntlayer.md +237 -0
- package/es/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/es/packages/next-intlayer/useLocale.md +105 -0
- package/es/packages/preact-intlayer/index.md +3 -0
- package/es/packages/react-intlayer/index.md +263 -0
- package/es/packages/react-intlayer/t.md +277 -0
- package/es/packages/react-intlayer/useDictionary.md +270 -0
- package/es/packages/react-intlayer/useIntlayer.md +225 -0
- package/es/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/es/packages/react-intlayer/useLocale.md +184 -0
- package/es/packages/react-native-intlayer/index.md +57 -0
- package/es/packages/react-scripts-intlayer/index.md +57 -0
- package/es/packages/solid-intlayer/index.md +3 -0
- package/es/packages/svelte-intlayer/index.md +5 -0
- package/es/packages/vite-intlayer/index.md +53 -0
- package/es/packages/vue-intlayer/index.md +3 -0
- package/es/per_locale_file.md +293 -0
- package/es/privacy_notice.md +61 -0
- package/es/roadmap.md +157 -0
- package/es/terms_of_service.md +33 -0
- package/es/vs_code_extension.md +139 -0
- package/fr/CI_CD.md +149 -0
- package/fr/autoFill.md +157 -0
- package/fr/configuration.md +481 -0
- package/fr/dictionary/condition.md +213 -0
- package/fr/dictionary/content_extention_customization.md +81 -0
- package/fr/dictionary/enumeration.md +221 -0
- package/fr/dictionary/file.md +206 -0
- package/fr/dictionary/function_fetching.md +190 -0
- package/fr/dictionary/get_started.md +466 -0
- package/fr/dictionary/insertion.md +161 -0
- package/fr/dictionary/markdown.md +335 -0
- package/fr/dictionary/nesting.md +249 -0
- package/fr/dictionary/translation.md +287 -0
- package/fr/header.md +5 -0
- package/fr/how_works_intlayer.md +217 -0
- package/fr/index.md +122 -0
- package/fr/interest_of_intlayer.md +132 -0
- package/fr/intlayer_CMS.md +334 -0
- package/fr/intlayer_cli.md +274 -0
- package/fr/intlayer_visual_editor.md +210 -0
- package/fr/intlayer_with_angular.md +3 -0
- package/fr/intlayer_with_create_react_app.md +1192 -0
- package/fr/intlayer_with_express.md +270 -0
- package/fr/intlayer_with_lynx+react.md +466 -0
- package/fr/intlayer_with_nextjs_14.md +1258 -0
- package/fr/intlayer_with_nextjs_15.md +1308 -0
- package/fr/intlayer_with_nextjs_page_router.md +1085 -0
- package/fr/intlayer_with_react_native+expo.md +535 -0
- package/fr/intlayer_with_vite+preact.md +1621 -0
- package/fr/intlayer_with_vite+react.md +1589 -0
- package/fr/intlayer_with_vite+solid.md +3 -0
- package/fr/intlayer_with_vite+svelte.md +3 -0
- package/fr/intlayer_with_vite+vue.md +947 -0
- package/fr/introduction.md +190 -0
- package/fr/mcp_server.md +152 -0
- package/fr/packages/@intlayer/api/index.md +31 -0
- package/fr/packages/@intlayer/chokidar/index.md +31 -0
- package/fr/packages/@intlayer/cli/index.md +21 -0
- package/fr/packages/@intlayer/config/index.md +116 -0
- package/fr/packages/@intlayer/core/index.md +25 -0
- package/fr/packages/@intlayer/design-system/index.md +21 -0
- package/fr/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/fr/packages/@intlayer/editor/index.md +21 -0
- package/fr/packages/@intlayer/editor-react/index.md +21 -0
- package/fr/packages/@intlayer/webpack/index.md +35 -0
- package/fr/packages/angular-intlayer/index.md +3 -0
- package/fr/packages/express-intlayer/index.md +238 -0
- package/fr/packages/express-intlayer/t.md +432 -0
- package/fr/packages/intlayer/getConfiguration.md +120 -0
- package/fr/packages/intlayer/getEnumeration.md +138 -0
- package/fr/packages/intlayer/getHTMLTextDir.md +97 -0
- package/fr/packages/intlayer/getLocaleLang.md +57 -0
- package/fr/packages/intlayer/getLocaleName.md +93 -0
- package/fr/packages/intlayer/getLocalizedUrl.md +221 -0
- package/fr/packages/intlayer/getMultilingualUrls.md +198 -0
- package/fr/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/fr/packages/intlayer/getTranslation.md +166 -0
- package/fr/packages/intlayer/getTranslationContent.md +166 -0
- package/fr/packages/intlayer/index.md +476 -0
- package/fr/packages/intlayer-cli/index.md +41 -0
- package/fr/packages/intlayer-editor/index.md +115 -0
- package/fr/packages/lynx-intlayer/index.md +58 -0
- package/fr/packages/next-intlayer/index.md +266 -0
- package/fr/packages/next-intlayer/t.md +325 -0
- package/fr/packages/next-intlayer/useDictionary.md +242 -0
- package/fr/packages/next-intlayer/useIntlayer.md +237 -0
- package/fr/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/fr/packages/next-intlayer/useLocale.md +105 -0
- package/fr/packages/preact-intlayer/index.md +3 -0
- package/fr/packages/react-intlayer/index.md +257 -0
- package/fr/packages/react-intlayer/t.md +277 -0
- package/fr/packages/react-intlayer/useDictionary.md +269 -0
- package/fr/packages/react-intlayer/useIntlayer.md +234 -0
- package/fr/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/fr/packages/react-intlayer/useLocale.md +184 -0
- package/fr/packages/react-native-intlayer/index.md +57 -0
- package/fr/packages/react-scripts-intlayer/index.md +57 -0
- package/fr/packages/solid-intlayer/index.md +3 -0
- package/fr/packages/svelte-intlayer/index.md +3 -0
- package/fr/packages/vite-intlayer/index.md +53 -0
- package/fr/packages/vue-intlayer/index.md +3 -0
- package/fr/per_locale_file.md +297 -0
- package/fr/privacy_notice.md +57 -0
- package/fr/roadmap.md +206 -0
- package/fr/terms_of_service.md +33 -0
- package/fr/vs_code_extension.md +139 -0
- package/hi/CI_CD.md +149 -0
- package/hi/autoFill.md +157 -0
- package/hi/configuration.md +509 -0
- package/hi/dictionary/condition.md +213 -0
- package/hi/dictionary/content_extention_customization.md +81 -0
- package/hi/dictionary/enumeration.md +221 -0
- package/hi/dictionary/file.md +209 -0
- package/hi/dictionary/function_fetching.md +188 -0
- package/hi/dictionary/get_started.md +490 -0
- package/hi/dictionary/insertion.md +167 -0
- package/hi/dictionary/markdown.md +344 -0
- package/hi/dictionary/nesting.md +249 -0
- package/hi/dictionary/translation.md +307 -0
- package/hi/header.md +7 -0
- package/hi/how_works_intlayer.md +217 -0
- package/hi/index.md +125 -0
- package/hi/interest_of_intlayer.md +132 -0
- package/hi/intlayer_CMS.md +334 -0
- package/hi/intlayer_cli.md +274 -0
- package/hi/intlayer_visual_editor.md +210 -0
- package/hi/intlayer_with_angular.md +3 -0
- package/hi/intlayer_with_create_react_app.md +1395 -0
- package/hi/intlayer_with_express.md +273 -0
- package/hi/intlayer_with_lynx+react.md +456 -0
- package/hi/intlayer_with_nextjs_14.md +1283 -0
- package/hi/intlayer_with_nextjs_15.md +1319 -0
- package/hi/intlayer_with_nextjs_page_router.md +1097 -0
- package/hi/intlayer_with_react_native+expo.md +554 -0
- package/hi/intlayer_with_vite+preact.md +1538 -0
- package/hi/intlayer_with_vite+react.md +1540 -0
- package/hi/intlayer_with_vite+solid.md +3 -0
- package/hi/intlayer_with_vite+svelte.md +3 -0
- package/hi/intlayer_with_vite+vue.md +840 -0
- package/hi/introduction.md +190 -0
- package/hi/mcp_server.md +150 -0
- package/hi/packages/@intlayer/api/index.md +31 -0
- package/hi/packages/@intlayer/chokidar/index.md +31 -0
- package/hi/packages/@intlayer/cli/index.md +21 -0
- package/hi/packages/@intlayer/config/index.md +116 -0
- package/hi/packages/@intlayer/core/index.md +25 -0
- package/hi/packages/@intlayer/design-system/index.md +21 -0
- package/hi/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/hi/packages/@intlayer/editor/index.md +21 -0
- package/hi/packages/@intlayer/editor-react/index.md +21 -0
- package/hi/packages/@intlayer/webpack/index.md +35 -0
- package/hi/packages/angular-intlayer/index.md +3 -0
- package/hi/packages/express-intlayer/index.md +232 -0
- package/hi/packages/express-intlayer/t.md +445 -0
- package/hi/packages/intlayer/getConfiguration.md +120 -0
- package/hi/packages/intlayer/getEnumeration.md +138 -0
- package/hi/packages/intlayer/getHTMLTextDir.md +97 -0
- package/hi/packages/intlayer/getLocaleLang.md +57 -0
- package/hi/packages/intlayer/getLocaleName.md +93 -0
- package/hi/packages/intlayer/getLocalizedUrl.md +221 -0
- package/hi/packages/intlayer/getMultilingualUrls.md +198 -0
- package/hi/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/hi/packages/intlayer/getTranslation.md +175 -0
- package/hi/packages/intlayer/getTranslationContent.md +175 -0
- package/hi/packages/intlayer/index.md +314 -0
- package/hi/packages/intlayer-cli/index.md +41 -0
- package/hi/packages/intlayer-editor/index.md +113 -0
- package/hi/packages/lynx-intlayer/index.md +58 -0
- package/hi/packages/next-intlayer/index.md +270 -0
- package/hi/packages/next-intlayer/t.md +337 -0
- package/hi/packages/next-intlayer/useDictionary.md +248 -0
- package/hi/packages/next-intlayer/useIntlayer.md +237 -0
- package/hi/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/hi/packages/next-intlayer/useLocale.md +105 -0
- package/hi/packages/preact-intlayer/index.md +3 -0
- package/hi/packages/react-intlayer/index.md +261 -0
- package/hi/packages/react-intlayer/t.md +283 -0
- package/hi/packages/react-intlayer/useDictionary.md +268 -0
- package/hi/packages/react-intlayer/useIntlayer.md +225 -0
- package/hi/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/hi/packages/react-intlayer/useLocale.md +184 -0
- package/hi/packages/react-native-intlayer/index.md +57 -0
- package/hi/packages/react-scripts-intlayer/index.md +57 -0
- package/hi/packages/solid-intlayer/index.md +3 -0
- package/hi/packages/svelte-intlayer/index.md +3 -0
- package/hi/packages/vite-intlayer/index.md +53 -0
- package/hi/packages/vue-intlayer/index.md +3 -0
- package/hi/per_locale_file.md +298 -0
- package/hi/privacy_notice.md +61 -0
- package/hi/roadmap.md +206 -0
- package/hi/terms_of_service.md +33 -0
- package/hi/vs_code_extension.md +139 -0
- package/index.cjs +1265 -0
- package/index.d.ts +100 -0
- package/it/CI_CD.md +149 -0
- package/it/autoFill.md +157 -0
- package/it/configuration.md +503 -0
- package/it/dictionary/condition.md +213 -0
- package/it/dictionary/content_extention_customization.md +81 -0
- package/it/dictionary/enumeration.md +221 -0
- package/it/dictionary/file.md +207 -0
- package/it/dictionary/function_fetching.md +190 -0
- package/it/dictionary/get_started.md +466 -0
- package/it/dictionary/insertion.md +161 -0
- package/it/dictionary/markdown.md +343 -0
- package/it/dictionary/nesting.md +249 -0
- package/it/dictionary/translation.md +287 -0
- package/it/header.md +7 -0
- package/it/how_works_intlayer.md +217 -0
- package/it/index.md +125 -0
- package/it/interest_of_intlayer.md +132 -0
- package/it/intlayer_CMS.md +334 -0
- package/it/intlayer_cli.md +274 -0
- package/it/intlayer_visual_editor.md +210 -0
- package/it/intlayer_with_angular.md +3 -0
- package/it/intlayer_with_create_react_app.md +413 -0
- package/it/intlayer_with_express.md +267 -0
- package/it/intlayer_with_lynx+react.md +482 -0
- package/it/intlayer_with_nextjs_14.md +1269 -0
- package/it/intlayer_with_nextjs_15.md +1319 -0
- package/it/intlayer_with_nextjs_page_router.md +1095 -0
- package/it/intlayer_with_react_native+expo.md +261 -0
- package/it/intlayer_with_vite+preact.md +1681 -0
- package/it/intlayer_with_vite+react.md +1580 -0
- package/it/intlayer_with_vite+solid.md +3 -0
- package/it/intlayer_with_vite+svelte.md +3 -0
- package/it/intlayer_with_vite+vue.md +989 -0
- package/it/introduction.md +192 -0
- package/it/mcp_server.md +152 -0
- package/it/packages/@intlayer/api/index.md +31 -0
- package/it/packages/@intlayer/chokidar/index.md +31 -0
- package/it/packages/@intlayer/cli/index.md +21 -0
- package/it/packages/@intlayer/config/index.md +116 -0
- package/it/packages/@intlayer/core/index.md +25 -0
- package/it/packages/@intlayer/design-system/index.md +21 -0
- package/it/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/it/packages/@intlayer/editor/index.md +21 -0
- package/it/packages/@intlayer/editor-react/index.md +21 -0
- package/it/packages/@intlayer/webpack/index.md +35 -0
- package/it/packages/angular-intlayer/index.md +3 -0
- package/it/packages/express-intlayer/index.md +229 -0
- package/it/packages/express-intlayer/t.md +432 -0
- package/it/packages/intlayer/getConfiguration.md +120 -0
- package/it/packages/intlayer/getEnumeration.md +138 -0
- package/it/packages/intlayer/getHTMLTextDir.md +97 -0
- package/it/packages/intlayer/getLocaleLang.md +57 -0
- package/it/packages/intlayer/getLocaleName.md +93 -0
- package/it/packages/intlayer/getLocalizedUrl.md +221 -0
- package/it/packages/intlayer/getMultilingualUrls.md +200 -0
- package/it/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/it/packages/intlayer/getTranslation.md +166 -0
- package/it/packages/intlayer/getTranslationContent.md +166 -0
- package/it/packages/intlayer/index.md +479 -0
- package/it/packages/intlayer-cli/index.md +41 -0
- package/it/packages/intlayer-editor/index.md +113 -0
- package/it/packages/lynx-intlayer/index.md +58 -0
- package/it/packages/next-intlayer/index.md +267 -0
- package/it/packages/next-intlayer/t.md +326 -0
- package/it/packages/next-intlayer/useDictionary.md +242 -0
- package/it/packages/next-intlayer/useIntlayer.md +237 -0
- package/it/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/it/packages/next-intlayer/useLocale.md +105 -0
- package/it/packages/preact-intlayer/index.md +3 -0
- package/it/packages/react-intlayer/index.md +260 -0
- package/it/packages/react-intlayer/t.md +277 -0
- package/it/packages/react-intlayer/useDictionary.md +260 -0
- package/it/packages/react-intlayer/useIntlayer.md +225 -0
- package/it/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/it/packages/react-intlayer/useLocale.md +184 -0
- package/it/packages/react-native-intlayer/index.md +57 -0
- package/it/packages/react-scripts-intlayer/index.md +57 -0
- package/it/packages/solid-intlayer/index.md +5 -0
- package/it/packages/svelte-intlayer/index.md +3 -0
- package/it/packages/vite-intlayer/index.md +53 -0
- package/it/packages/vue-intlayer/index.md +5 -0
- package/it/per_locale_file.md +298 -0
- package/it/privacy_notice.md +61 -0
- package/it/roadmap.md +206 -0
- package/it/terms_of_service.md +33 -0
- package/it/vs_code_extension.md +139 -0
- package/ja/CI_CD.md +149 -0
- package/ja/autoFill.md +157 -0
- package/ja/configuration.md +507 -0
- package/ja/dictionary/condition.md +213 -0
- package/ja/dictionary/content_extention_customization.md +81 -0
- package/ja/dictionary/enumeration.md +221 -0
- package/ja/dictionary/file.md +209 -0
- package/ja/dictionary/function_fetching.md +190 -0
- package/ja/dictionary/get_started.md +466 -0
- package/ja/dictionary/insertion.md +161 -0
- package/ja/dictionary/markdown.md +343 -0
- package/ja/dictionary/nesting.md +249 -0
- package/ja/dictionary/translation.md +287 -0
- package/ja/header.md +7 -0
- package/ja/how_works_intlayer.md +217 -0
- package/ja/index.md +125 -0
- package/ja/interest_of_intlayer.md +132 -0
- package/ja/intlayer_CMS.md +334 -0
- package/ja/intlayer_cli.md +274 -0
- package/ja/intlayer_visual_editor.md +213 -0
- package/ja/intlayer_with_angular.md +3 -0
- package/ja/intlayer_with_create_react_app.md +1186 -0
- package/ja/intlayer_with_express.md +267 -0
- package/ja/intlayer_with_lynx+react.md +482 -0
- package/ja/intlayer_with_nextjs_14.md +1256 -0
- package/ja/intlayer_with_nextjs_15.md +1308 -0
- package/ja/intlayer_with_nextjs_page_router.md +1085 -0
- package/ja/intlayer_with_react_native+expo.md +537 -0
- package/ja/intlayer_with_vite+preact.md +1601 -0
- package/ja/intlayer_with_vite+react.md +1555 -0
- package/ja/intlayer_with_vite+solid.md +3 -0
- package/ja/intlayer_with_vite+svelte.md +3 -0
- package/ja/intlayer_with_vite+vue.md +990 -0
- package/ja/introduction.md +186 -0
- package/ja/mcp_server.md +150 -0
- package/ja/packages/@intlayer/api/index.md +31 -0
- package/ja/packages/@intlayer/chokidar/index.md +31 -0
- package/ja/packages/@intlayer/cli/index.md +21 -0
- package/ja/packages/@intlayer/config/index.md +116 -0
- package/ja/packages/@intlayer/core/index.md +25 -0
- package/ja/packages/@intlayer/design-system/index.md +21 -0
- package/ja/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/ja/packages/@intlayer/editor/index.md +21 -0
- package/ja/packages/@intlayer/editor-react/index.md +21 -0
- package/ja/packages/@intlayer/webpack/index.md +35 -0
- package/ja/packages/angular-intlayer/index.md +3 -0
- package/ja/packages/express-intlayer/index.md +229 -0
- package/ja/packages/express-intlayer/t.md +432 -0
- package/ja/packages/intlayer/getConfiguration.md +120 -0
- package/ja/packages/intlayer/getEnumeration.md +140 -0
- package/ja/packages/intlayer/getHTMLTextDir.md +97 -0
- package/ja/packages/intlayer/getLocaleLang.md +59 -0
- package/ja/packages/intlayer/getLocaleName.md +93 -0
- package/ja/packages/intlayer/getLocalizedUrl.md +221 -0
- package/ja/packages/intlayer/getMultilingualUrls.md +198 -0
- package/ja/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/ja/packages/intlayer/getTranslation.md +166 -0
- package/ja/packages/intlayer/getTranslationContent.md +166 -0
- package/ja/packages/intlayer/index.md +479 -0
- package/ja/packages/intlayer-cli/index.md +41 -0
- package/ja/packages/intlayer-editor/index.md +115 -0
- package/ja/packages/lynx-intlayer/index.md +58 -0
- package/ja/packages/next-intlayer/index.md +263 -0
- package/ja/packages/next-intlayer/t.md +326 -0
- package/ja/packages/next-intlayer/useDictionary.md +242 -0
- package/ja/packages/next-intlayer/useIntlayer.md +237 -0
- package/ja/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/ja/packages/next-intlayer/useLocale.md +105 -0
- package/ja/packages/preact-intlayer/index.md +3 -0
- package/ja/packages/react-intlayer/index.md +257 -0
- package/ja/packages/react-intlayer/t.md +277 -0
- package/ja/packages/react-intlayer/useDictionary.md +260 -0
- package/ja/packages/react-intlayer/useIntlayer.md +225 -0
- package/ja/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/ja/packages/react-intlayer/useLocale.md +184 -0
- package/ja/packages/react-native-intlayer/index.md +57 -0
- package/ja/packages/react-scripts-intlayer/index.md +57 -0
- package/ja/packages/solid-intlayer/index.md +3 -0
- package/ja/packages/svelte-intlayer/index.md +3 -0
- package/ja/packages/vite-intlayer/index.md +53 -0
- package/ja/packages/vue-intlayer/index.md +3 -0
- package/ja/per_locale_file.md +298 -0
- package/ja/privacy_notice.md +57 -0
- package/ja/roadmap.md +206 -0
- package/ja/terms_of_service.md +33 -0
- package/ja/vs_code_extension.md +139 -0
- package/ko/CI_CD.md +149 -0
- package/ko/autoFill.md +157 -0
- package/ko/configuration.md +507 -0
- package/ko/dictionary/condition.md +213 -0
- package/ko/dictionary/content_extention_customization.md +81 -0
- package/ko/dictionary/enumeration.md +221 -0
- package/ko/dictionary/file.md +207 -0
- package/ko/dictionary/function_fetching.md +190 -0
- package/ko/dictionary/get_started.md +466 -0
- package/ko/dictionary/insertion.md +167 -0
- package/ko/dictionary/markdown.md +343 -0
- package/ko/dictionary/nesting.md +249 -0
- package/ko/dictionary/translation.md +287 -0
- package/ko/header.md +7 -0
- package/ko/how_works_intlayer.md +216 -0
- package/ko/index.md +125 -0
- package/ko/interest_of_intlayer.md +132 -0
- package/ko/intlayer_CMS.md +334 -0
- package/ko/intlayer_cli.md +274 -0
- package/ko/intlayer_visual_editor.md +210 -0
- package/ko/intlayer_with_angular.md +3 -0
- package/ko/intlayer_with_create_react_app.md +1186 -0
- package/ko/intlayer_with_express.md +267 -0
- package/ko/intlayer_with_lynx+react.md +482 -0
- package/ko/intlayer_with_nextjs_14.md +1267 -0
- package/ko/intlayer_with_nextjs_15.md +1319 -0
- package/ko/intlayer_with_nextjs_page_router.md +1097 -0
- package/ko/intlayer_with_react_native+expo.md +537 -0
- package/ko/intlayer_with_vite+preact.md +1682 -0
- package/ko/intlayer_with_vite+react.md +1582 -0
- package/ko/intlayer_with_vite+solid.md +3 -0
- package/ko/intlayer_with_vite+svelte.md +3 -0
- package/ko/intlayer_with_vite+vue.md +988 -0
- package/ko/introduction.md +186 -0
- package/ko/mcp_server.md +150 -0
- package/ko/packages/@intlayer/api/index.md +31 -0
- package/ko/packages/@intlayer/chokidar/index.md +31 -0
- package/ko/packages/@intlayer/cli/index.md +21 -0
- package/ko/packages/@intlayer/config/index.md +116 -0
- package/ko/packages/@intlayer/core/index.md +25 -0
- package/ko/packages/@intlayer/design-system/index.md +21 -0
- package/ko/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/ko/packages/@intlayer/editor/index.md +21 -0
- package/ko/packages/@intlayer/editor-react/index.md +21 -0
- package/ko/packages/@intlayer/webpack/index.md +35 -0
- package/ko/packages/angular-intlayer/index.md +5 -0
- package/ko/packages/express-intlayer/index.md +229 -0
- package/ko/packages/express-intlayer/t.md +432 -0
- package/ko/packages/intlayer/getConfiguration.md +120 -0
- package/ko/packages/intlayer/getEnumeration.md +138 -0
- package/ko/packages/intlayer/getHTMLTextDir.md +97 -0
- package/ko/packages/intlayer/getLocaleLang.md +57 -0
- package/ko/packages/intlayer/getLocaleName.md +93 -0
- package/ko/packages/intlayer/getLocalizedUrl.md +221 -0
- package/ko/packages/intlayer/getMultilingualUrls.md +198 -0
- package/ko/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/ko/packages/intlayer/getTranslation.md +166 -0
- package/ko/packages/intlayer/getTranslationContent.md +166 -0
- package/ko/packages/intlayer/index.md +480 -0
- package/ko/packages/intlayer-cli/index.md +41 -0
- package/ko/packages/intlayer-editor/index.md +113 -0
- package/ko/packages/lynx-intlayer/index.md +58 -0
- package/ko/packages/next-intlayer/index.md +267 -0
- package/ko/packages/next-intlayer/t.md +337 -0
- package/ko/packages/next-intlayer/useDictionary.md +242 -0
- package/ko/packages/next-intlayer/useIntlayer.md +237 -0
- package/ko/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/ko/packages/next-intlayer/useLocale.md +105 -0
- package/ko/packages/preact-intlayer/index.md +3 -0
- package/ko/packages/react-intlayer/index.md +260 -0
- package/ko/packages/react-intlayer/t.md +277 -0
- package/ko/packages/react-intlayer/useDictionary.md +268 -0
- package/ko/packages/react-intlayer/useIntlayer.md +225 -0
- package/ko/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/ko/packages/react-intlayer/useLocale.md +184 -0
- package/ko/packages/react-native-intlayer/index.md +57 -0
- package/ko/packages/react-scripts-intlayer/index.md +57 -0
- package/ko/packages/solid-intlayer/index.md +3 -0
- package/ko/packages/svelte-intlayer/index.md +3 -0
- package/ko/packages/vite-intlayer/index.md +53 -0
- package/ko/packages/vue-intlayer/index.md +3 -0
- package/ko/per_locale_file.md +300 -0
- package/ko/privacy_notice.md +61 -0
- package/ko/roadmap.md +206 -0
- package/ko/terms_of_service.md +33 -0
- package/ko/vs_code_extension.md +139 -0
- package/package.json +96 -0
- package/pt/CI_CD.md +149 -0
- package/pt/autoFill.md +157 -0
- package/pt/configuration.md +503 -0
- package/pt/dictionary/condition.md +213 -0
- package/pt/dictionary/content_extention_customization.md +81 -0
- package/pt/dictionary/enumeration.md +221 -0
- package/pt/dictionary/file.md +210 -0
- package/pt/dictionary/function_fetching.md +190 -0
- package/pt/dictionary/get_started.md +490 -0
- package/pt/dictionary/insertion.md +161 -0
- package/pt/dictionary/markdown.md +339 -0
- package/pt/dictionary/nesting.md +249 -0
- package/pt/dictionary/translation.md +322 -0
- package/pt/header.md +7 -0
- package/pt/how_works_intlayer.md +216 -0
- package/pt/index.md +125 -0
- package/pt/interest_of_intlayer.md +132 -0
- package/pt/intlayer_CMS.md +334 -0
- package/pt/intlayer_cli.md +274 -0
- package/pt/intlayer_visual_editor.md +210 -0
- package/pt/intlayer_with_angular.md +3 -0
- package/pt/intlayer_with_create_react_app.md +1204 -0
- package/pt/intlayer_with_express.md +270 -0
- package/pt/intlayer_with_lynx+react.md +467 -0
- package/pt/intlayer_with_nextjs_14.md +1269 -0
- package/pt/intlayer_with_nextjs_15.md +1319 -0
- package/pt/intlayer_with_nextjs_page_router.md +1109 -0
- package/pt/intlayer_with_react_native+expo.md +259 -0
- package/pt/intlayer_with_vite+preact.md +1663 -0
- package/pt/intlayer_with_vite+react.md +1621 -0
- package/pt/intlayer_with_vite+solid.md +3 -0
- package/pt/intlayer_with_vite+svelte.md +3 -0
- package/pt/intlayer_with_vite+vue.md +989 -0
- package/pt/introduction.md +193 -0
- package/pt/mcp_server.md +150 -0
- package/pt/packages/@intlayer/api/index.md +31 -0
- package/pt/packages/@intlayer/chokidar/index.md +31 -0
- package/pt/packages/@intlayer/cli/index.md +21 -0
- package/pt/packages/@intlayer/config/index.md +116 -0
- package/pt/packages/@intlayer/core/index.md +25 -0
- package/pt/packages/@intlayer/design-system/index.md +21 -0
- package/pt/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/pt/packages/@intlayer/editor/index.md +21 -0
- package/pt/packages/@intlayer/editor-react/index.md +21 -0
- package/pt/packages/@intlayer/webpack/index.md +35 -0
- package/pt/packages/angular-intlayer/index.md +3 -0
- package/pt/packages/express-intlayer/index.md +232 -0
- package/pt/packages/express-intlayer/t.md +267 -0
- package/pt/packages/intlayer/getConfiguration.md +120 -0
- package/pt/packages/intlayer/getEnumeration.md +138 -0
- package/pt/packages/intlayer/getHTMLTextDir.md +97 -0
- package/pt/packages/intlayer/getLocaleLang.md +57 -0
- package/pt/packages/intlayer/getLocaleName.md +93 -0
- package/pt/packages/intlayer/getLocalizedUrl.md +221 -0
- package/pt/packages/intlayer/getMultilingualUrls.md +198 -0
- package/pt/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/pt/packages/intlayer/getTranslation.md +175 -0
- package/pt/packages/intlayer/getTranslationContent.md +177 -0
- package/pt/packages/intlayer/index.md +484 -0
- package/pt/packages/intlayer-cli/index.md +41 -0
- package/pt/packages/intlayer-editor/index.md +113 -0
- package/pt/packages/lynx-intlayer/index.md +58 -0
- package/pt/packages/next-intlayer/index.md +270 -0
- package/pt/packages/next-intlayer/t.md +341 -0
- package/pt/packages/next-intlayer/useDictionary.md +248 -0
- package/pt/packages/next-intlayer/useIntlayer.md +237 -0
- package/pt/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/pt/packages/next-intlayer/useLocale.md +105 -0
- package/pt/packages/preact-intlayer/index.md +3 -0
- package/pt/packages/react-intlayer/index.md +261 -0
- package/pt/packages/react-intlayer/t.md +289 -0
- package/pt/packages/react-intlayer/useDictionary.md +268 -0
- package/pt/packages/react-intlayer/useIntlayer.md +225 -0
- package/pt/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/pt/packages/react-intlayer/useLocale.md +184 -0
- package/pt/packages/react-native-intlayer/index.md +57 -0
- package/pt/packages/react-scripts-intlayer/index.md +57 -0
- package/pt/packages/solid-intlayer/index.md +3 -0
- package/pt/packages/svelte-intlayer/index.md +3 -0
- package/pt/packages/vite-intlayer/index.md +53 -0
- package/pt/packages/vue-intlayer/index.md +3 -0
- package/pt/per_locale_file.md +298 -0
- package/pt/privacy_notice.md +61 -0
- package/pt/roadmap.md +206 -0
- package/pt/terms_of_service.md +33 -0
- package/pt/vs_code_extension.md +139 -0
- package/ru/CI_CD.md +149 -0
- package/ru/autoFill.md +157 -0
- package/ru/configuration.md +507 -0
- package/ru/dictionary/condition.md +213 -0
- package/ru/dictionary/content_extention_customization.md +81 -0
- package/ru/dictionary/enumeration.md +221 -0
- package/ru/dictionary/file.md +209 -0
- package/ru/dictionary/function_fetching.md +188 -0
- package/ru/dictionary/get_started.md +311 -0
- package/ru/dictionary/insertion.md +161 -0
- package/ru/dictionary/markdown.md +339 -0
- package/ru/dictionary/nesting.md +249 -0
- package/ru/dictionary/translation.md +322 -0
- package/ru/environment/angular.md +3 -0
- package/ru/header.md +7 -0
- package/ru/how_works_intlayer.md +217 -0
- package/ru/index.md +125 -0
- package/ru/interest_of_intlayer.md +132 -0
- package/ru/intlayer_CMS.md +334 -0
- package/ru/intlayer_cli.md +274 -0
- package/ru/intlayer_visual_editor.md +210 -0
- package/ru/intlayer_with_angular.md +3 -0
- package/ru/intlayer_with_create_react_app.md +1196 -0
- package/ru/intlayer_with_express.md +273 -0
- package/ru/intlayer_with_lynx+react.md +482 -0
- package/ru/intlayer_with_nextjs_14.md +1274 -0
- package/ru/intlayer_with_nextjs_15.md +1318 -0
- package/ru/intlayer_with_nextjs_page_router.md +1100 -0
- package/ru/intlayer_with_react_native+expo.md +537 -0
- package/ru/intlayer_with_vite+preact.md +1663 -0
- package/ru/intlayer_with_vite+react.md +1546 -0
- package/ru/intlayer_with_vite+solid.md +3 -0
- package/ru/intlayer_with_vite+svelte.md +3 -0
- package/ru/intlayer_with_vite+vue.md +987 -0
- package/ru/introduction.md +190 -0
- package/ru/mcp_server.md +152 -0
- package/ru/packages/@intlayer/api/index.md +31 -0
- package/ru/packages/@intlayer/chokidar/index.md +31 -0
- package/ru/packages/@intlayer/cli/index.md +23 -0
- package/ru/packages/@intlayer/config/index.md +116 -0
- package/ru/packages/@intlayer/core/index.md +25 -0
- package/ru/packages/@intlayer/design-system/index.md +21 -0
- package/ru/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/ru/packages/@intlayer/editor/index.md +21 -0
- package/ru/packages/@intlayer/editor-react/index.md +21 -0
- package/ru/packages/@intlayer/webpack/index.md +35 -0
- package/ru/packages/angular-intlayer/index.md +3 -0
- package/ru/packages/express-intlayer/index.md +235 -0
- package/ru/packages/express-intlayer/t.md +445 -0
- package/ru/packages/intlayer/getConfiguration.md +120 -0
- package/ru/packages/intlayer/getEnumeration.md +140 -0
- package/ru/packages/intlayer/getHTMLTextDir.md +97 -0
- package/ru/packages/intlayer/getLocaleLang.md +59 -0
- package/ru/packages/intlayer/getLocaleName.md +93 -0
- package/ru/packages/intlayer/getLocalizedUrl.md +221 -0
- package/ru/packages/intlayer/getMultilingualUrls.md +198 -0
- package/ru/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/ru/packages/intlayer/getTranslation.md +177 -0
- package/ru/packages/intlayer/getTranslationContent.md +175 -0
- package/ru/packages/intlayer/index.md +275 -0
- package/ru/packages/intlayer-cli/index.md +41 -0
- package/ru/packages/intlayer-editor/index.md +115 -0
- package/ru/packages/lynx-intlayer/index.md +58 -0
- package/ru/packages/next-intlayer/index.md +267 -0
- package/ru/packages/next-intlayer/t.md +340 -0
- package/ru/packages/next-intlayer/useDictionary.md +248 -0
- package/ru/packages/next-intlayer/useIntlayer.md +237 -0
- package/ru/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/ru/packages/next-intlayer/useLocale.md +105 -0
- package/ru/packages/preact-intlayer/index.md +3 -0
- package/ru/packages/react-intlayer/index.md +261 -0
- package/ru/packages/react-intlayer/t.md +289 -0
- package/ru/packages/react-intlayer/useDictionary.md +268 -0
- package/ru/packages/react-intlayer/useIntlayer.md +225 -0
- package/ru/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/ru/packages/react-intlayer/useLocale.md +184 -0
- package/ru/packages/react-native-intlayer/index.md +57 -0
- package/ru/packages/react-scripts-intlayer/index.md +57 -0
- package/ru/packages/solid-intlayer/index.md +3 -0
- package/ru/packages/svelte-intlayer/index.md +3 -0
- package/ru/packages/vite-intlayer/index.md +53 -0
- package/ru/packages/vue-intlayer/index.md +3 -0
- package/ru/per_locale_file.md +298 -0
- package/ru/privacy_notice.md +61 -0
- package/ru/roadmap.md +206 -0
- package/ru/terms_of_service.md +33 -0
- package/ru/vs_code_extension.md +139 -0
- package/zh/CI_CD.md +149 -0
- package/zh/autoFill.md +157 -0
- package/zh/configuration.md +484 -0
- package/zh/dictionary/condition.md +213 -0
- package/zh/dictionary/content_extention_customization.md +81 -0
- package/zh/dictionary/enumeration.md +221 -0
- package/zh/dictionary/file.md +209 -0
- package/zh/dictionary/function_fetching.md +188 -0
- package/zh/dictionary/get_started.md +490 -0
- package/zh/dictionary/insertion.md +161 -0
- package/zh/dictionary/markdown.md +342 -0
- package/zh/dictionary/nesting.md +249 -0
- package/zh/dictionary/translation.md +287 -0
- package/zh/header.md +7 -0
- package/zh/how_works_intlayer.md +217 -0
- package/zh/index.md +125 -0
- package/zh/interest_of_intlayer.md +132 -0
- package/zh/intlayer_CMS.md +334 -0
- package/zh/intlayer_cli.md +274 -0
- package/zh/intlayer_visual_editor.md +210 -0
- package/zh/intlayer_with_angular.md +3 -0
- package/zh/intlayer_with_create_react_app.md +1196 -0
- package/zh/intlayer_with_express.md +267 -0
- package/zh/intlayer_with_lynx+react.md +484 -0
- package/zh/intlayer_with_nextjs_14.md +1286 -0
- package/zh/intlayer_with_nextjs_15.md +1322 -0
- package/zh/intlayer_with_nextjs_page_router.md +1097 -0
- package/zh/intlayer_with_react_native+expo.md +539 -0
- package/zh/intlayer_with_vite+preact.md +1681 -0
- package/zh/intlayer_with_vite+react.md +1577 -0
- package/zh/intlayer_with_vite+solid.md +3 -0
- package/zh/intlayer_with_vite+svelte.md +3 -0
- package/zh/intlayer_with_vite+vue.md +988 -0
- package/zh/introduction.md +186 -0
- package/zh/mcp_server.md +152 -0
- package/zh/packages/@intlayer/api/index.md +31 -0
- package/zh/packages/@intlayer/chokidar/index.md +31 -0
- package/zh/packages/@intlayer/cli/index.md +21 -0
- package/zh/packages/@intlayer/config/index.md +116 -0
- package/zh/packages/@intlayer/core/index.md +25 -0
- package/zh/packages/@intlayer/design-system/index.md +21 -0
- package/zh/packages/@intlayer/dictionary-entry/index.md +21 -0
- package/zh/packages/@intlayer/editor/index.md +21 -0
- package/zh/packages/@intlayer/editor-react/index.md +21 -0
- package/zh/packages/@intlayer/webpack/index.md +35 -0
- package/zh/packages/angular-intlayer/index.md +3 -0
- package/zh/packages/express-intlayer/index.md +229 -0
- package/zh/packages/express-intlayer/t.md +432 -0
- package/zh/packages/intlayer/getConfiguration.md +120 -0
- package/zh/packages/intlayer/getEnumeration.md +140 -0
- package/zh/packages/intlayer/getHTMLTextDir.md +97 -0
- package/zh/packages/intlayer/getLocaleLang.md +57 -0
- package/zh/packages/intlayer/getLocaleName.md +93 -0
- package/zh/packages/intlayer/getLocalizedUrl.md +221 -0
- package/zh/packages/intlayer/getMultilingualUrls.md +198 -0
- package/zh/packages/intlayer/getPathWithoutLocale.md +50 -0
- package/zh/packages/intlayer/getTranslation.md +166 -0
- package/zh/packages/intlayer/getTranslationContent.md +166 -0
- package/zh/packages/intlayer/index.md +360 -0
- package/zh/packages/intlayer-cli/index.md +41 -0
- package/zh/packages/intlayer-editor/index.md +113 -0
- package/zh/packages/lynx-intlayer/index.md +60 -0
- package/zh/packages/next-intlayer/index.md +267 -0
- package/zh/packages/next-intlayer/t.md +338 -0
- package/zh/packages/next-intlayer/useDictionary.md +242 -0
- package/zh/packages/next-intlayer/useIntlayer.md +237 -0
- package/zh/packages/next-intlayer/useIntlayerAsync.md +211 -0
- package/zh/packages/next-intlayer/useLocale.md +105 -0
- package/zh/packages/preact-intlayer/index.md +3 -0
- package/zh/packages/react-intlayer/index.md +257 -0
- package/zh/packages/react-intlayer/t.md +271 -0
- package/zh/packages/react-intlayer/useDictionary.md +260 -0
- package/zh/packages/react-intlayer/useIntlayer.md +225 -0
- package/zh/packages/react-intlayer/useIntlayerAsync.md +226 -0
- package/zh/packages/react-intlayer/useLocale.md +184 -0
- package/zh/packages/react-native-intlayer/index.md +57 -0
- package/zh/packages/react-scripts-intlayer/index.md +57 -0
- package/zh/packages/solid-intlayer/index.md +3 -0
- package/zh/packages/svelte-intlayer/index.md +3 -0
- package/zh/packages/vite-intlayer/index.md +53 -0
- package/zh/packages/vue-intlayer/index.md +3 -0
- package/zh/per_locale_file.md +298 -0
- package/zh/privacy_notice.md +61 -0
- package/zh/roadmap.md +206 -0
- package/zh/terms_of_service.md +33 -0
- package/zh/vs_code_extension.md +139 -0
|
@@ -0,0 +1,1126 @@
|
|
|
1
|
+
# Getting Started Internationalizing (i18n) with Intlayer and Next.js using Page Router
|
|
2
|
+
|
|
3
|
+
## What is Intlayer?
|
|
4
|
+
|
|
5
|
+
**Intlayer** is an innovative, open-source internationalization (i18n) library designed to simplify multilingual support in modern web applications. Intlayer seamlessly integrates with the latest **Next.js** framework, including its traditional **Page Router**.
|
|
6
|
+
|
|
7
|
+
With Intlayer, you can:
|
|
8
|
+
|
|
9
|
+
- **Easily manage translations** using declarative dictionaries at the component level.
|
|
10
|
+
- **Dynamically localize metadata**, routes, and content.
|
|
11
|
+
- **Ensure TypeScript support** with autogenerated types, improving autocompletion and error detection.
|
|
12
|
+
- **Benefit from advanced features**, like dynamic locale detection and switching.
|
|
13
|
+
|
|
14
|
+
> Intlayer is compatible with Next.js 12, 13, 14, and 15. If you are using Next.js App Router, refer to the [App Router guide](https://github.com/aymericzip/intlayer/blob/main/docs/en/intlayer_with_nextjs_14.md). For Next.js 15, follow this [guide](https://github.com/aymericzip/intlayer/blob/main/docs/en/intlayer_with_nextjs_15.md).
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Step-by-Step Guide to Set Up Intlayer in a Next.js Application Using Page Router
|
|
19
|
+
|
|
20
|
+
### Step 1: Install Dependencies
|
|
21
|
+
|
|
22
|
+
Install the necessary packages using your preferred package manager:
|
|
23
|
+
|
|
24
|
+
```bash packageManager="npm"
|
|
25
|
+
npm install intlayer next-intlayer
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```bash packageManager="pnpm"
|
|
29
|
+
pnpm add intlayer next-intlayer
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```bash packageManager="yarn"
|
|
33
|
+
yarn add intlayer next-intlayer
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- **intlayer**
|
|
37
|
+
|
|
38
|
+
The core package that provides internationalization tools for configuration management, translation, [content declaration](https://github.com/aymericzip/intlayer/blob/main/docs/en/dictionary/get_started.md), transpilation, and [CLI commands](https://github.com/aymericzip/intlayer/blob/main/docs/en/intlayer_cli.md).
|
|
39
|
+
|
|
40
|
+
- **next-intlayer**
|
|
41
|
+
|
|
42
|
+
The package that integrates Intlayer with Next.js. It provides context providers and hooks for Next.js internationalization. Additionally, it includes the Next.js plugin for integrating Intlayer with [Webpack](https://webpack.js.org/) or [Turbopack](https://nextjs.org/docs/app/api-reference/turbopack), as well as middleware for detecting the user's preferred locale, managing cookies, and handling URL redirection.
|
|
43
|
+
|
|
44
|
+
### Step 2: Configure Your Project
|
|
45
|
+
|
|
46
|
+
Create a configuration file to define the languages supported by your application:
|
|
47
|
+
|
|
48
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
49
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
50
|
+
|
|
51
|
+
const config: IntlayerConfig = {
|
|
52
|
+
internationalization: {
|
|
53
|
+
locales: [
|
|
54
|
+
Locales.ENGLISH,
|
|
55
|
+
Locales.FRENCH,
|
|
56
|
+
Locales.SPANISH,
|
|
57
|
+
// Add your other locales here
|
|
58
|
+
],
|
|
59
|
+
defaultLocale: Locales.ENGLISH,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default config;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
67
|
+
import { Locales } from "intlayer";
|
|
68
|
+
|
|
69
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
70
|
+
const config = {
|
|
71
|
+
internationalization: {
|
|
72
|
+
locales: [
|
|
73
|
+
Locales.ENGLISH,
|
|
74
|
+
Locales.FRENCH,
|
|
75
|
+
Locales.SPANISH,
|
|
76
|
+
// Add your other locales here
|
|
77
|
+
],
|
|
78
|
+
defaultLocale: Locales.ENGLISH,
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default config;
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
86
|
+
const { Locales } = require("intlayer");
|
|
87
|
+
|
|
88
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
89
|
+
const config = {
|
|
90
|
+
internationalization: {
|
|
91
|
+
locales: [
|
|
92
|
+
Locales.ENGLISH,
|
|
93
|
+
Locales.FRENCH,
|
|
94
|
+
Locales.SPANISH,
|
|
95
|
+
// Add your other locales here
|
|
96
|
+
],
|
|
97
|
+
defaultLocale: Locales.ENGLISH,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
module.exports = config;
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
> Through this configuration file, you can set up localized URLs, middleware redirection, cookie names, the location and extension of your content declarations, disable Intlayer logs in the console, and more. For a complete list of available parameters, refer to the [configuration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/en/configuration.md).
|
|
105
|
+
|
|
106
|
+
### Step 3: Integrate Intlayer with Next.js Configuration
|
|
107
|
+
|
|
108
|
+
Modify your Next.js configuration to incorporate Intlayer:
|
|
109
|
+
|
|
110
|
+
```typescript fileName="next.config.mjs"
|
|
111
|
+
import { withIntlayer } from "next-intlayer/server";
|
|
112
|
+
|
|
113
|
+
/** @type {import('next').NextConfig} */
|
|
114
|
+
const nextConfig = {
|
|
115
|
+
// Your existing Next.js configuration
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export default withIntlayer(nextConfig);
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
> The `withIntlayer()` Next.js plugin is used to integrate Intlayer with Next.js. It ensures the building of content declaration files and monitors them in development mode. It defines Intlayer environment variables within the [Webpack](https://webpack.js.org/) or [Turbopack](https://nextjs.org/docs/app/api-reference/turbopack) environments. Additionally, it provides aliases to optimize performance and ensures compatibility with server components.
|
|
122
|
+
|
|
123
|
+
### Step 4: Configure Middleware for Locale Detection
|
|
124
|
+
|
|
125
|
+
Set up middleware to automatically detect and handle the user's preferred locale:
|
|
126
|
+
|
|
127
|
+
```typescript fileName="src/middleware.ts" codeFormat="typescript"
|
|
128
|
+
export { intlayerMiddleware as middleware } from "next-intlayer/middleware";
|
|
129
|
+
|
|
130
|
+
export const config = {
|
|
131
|
+
matcher:
|
|
132
|
+
"/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
|
|
133
|
+
};
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```javascript fileName="src/middleware.mjs" codeFormat="esm"
|
|
137
|
+
export { intlayerMiddleware as middleware } from "next-intlayer/middleware";
|
|
138
|
+
|
|
139
|
+
export const config = {
|
|
140
|
+
matcher:
|
|
141
|
+
"/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
|
|
142
|
+
};
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
```javascript fileName="src/middleware.cjs" codeFormat="commonjs"
|
|
146
|
+
const { intlayerMiddleware } = require("next-intlayer/middleware");
|
|
147
|
+
|
|
148
|
+
const config = {
|
|
149
|
+
matcher:
|
|
150
|
+
"/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
module.exports = { middleware: intlayerMiddleware, config };
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
> Adapt the `matcher` parameter to match the routes of your application. For more details, refer to the [Next.js documentation on configuring the matcher](https://nextjs.org/docs/app/building-your-application/routing/middleware).
|
|
157
|
+
|
|
158
|
+
### Step 5: Define Dynamic Locale Routes
|
|
159
|
+
|
|
160
|
+
Implement dynamic routing to serve localized content based on the user's locale.
|
|
161
|
+
|
|
162
|
+
1. **Create Locale-Specific Pages:**
|
|
163
|
+
|
|
164
|
+
Rename your main page file to include the `[locale]` dynamic segment.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
mv src/pages/index.tsx src/pages/[locale]/index.tsx
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
2. **Update `_app.tsx` to Handle Localization:**
|
|
171
|
+
|
|
172
|
+
Modify your `_app.tsx` to include Intlayer providers.
|
|
173
|
+
|
|
174
|
+
```tsx fileName="src/pages/_app.tsx" codeFormat="typescript"
|
|
175
|
+
import type { FC } from "react";
|
|
176
|
+
import type { AppProps } from "next/app";
|
|
177
|
+
import { IntlayerClientProvider } from "next-intlayer";
|
|
178
|
+
|
|
179
|
+
const App = FC<AppProps>({ Component, pageProps }) => {
|
|
180
|
+
const { locale } = pageProps;
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<IntlayerClientProvider locale={locale}>
|
|
184
|
+
<Component {...pageProps} />
|
|
185
|
+
</IntlayerClientProvider>
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export default MyApp;
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
```jsx fileName="src/pages/_app.mjx" codeFormat="esm"
|
|
193
|
+
import { IntlayerClientProvider } from "next-intlayer";
|
|
194
|
+
|
|
195
|
+
const App = ({ Component, pageProps }) => (
|
|
196
|
+
<IntlayerClientProvider locale={locale}>
|
|
197
|
+
<Component {...pageProps} />
|
|
198
|
+
</IntlayerClientProvider>
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
export default App;
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
```jsx fileName="src/pages/_app.csx" codeFormat="commonjs"
|
|
205
|
+
const { IntlayerClientProvider } = require("next-intlayer");
|
|
206
|
+
|
|
207
|
+
const App = ({ Component, pageProps }) => (
|
|
208
|
+
<IntlayerClientProvider locale={locale}>
|
|
209
|
+
<Component {...pageProps} />
|
|
210
|
+
</IntlayerClientProvider>
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
module.exports = App;
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
3. **Set Up `getStaticPaths` and `getStaticProps`:**
|
|
217
|
+
|
|
218
|
+
In your `[locale]/index.tsx`, define the paths and props to handle different locales.
|
|
219
|
+
|
|
220
|
+
```tsx fileName="src/pages/[locale]/index.tsx" codeFormat="typescript"
|
|
221
|
+
import type { FC } from "react";
|
|
222
|
+
import type { GetStaticPaths, GetStaticProps } from "next";
|
|
223
|
+
import { type Locales, getConfiguration } from "intlayer";
|
|
224
|
+
|
|
225
|
+
const HomePage: FC = () => <div>{/* Your content here */}</div>;
|
|
226
|
+
|
|
227
|
+
export const getStaticPaths: GetStaticPaths = () => {
|
|
228
|
+
const { internationalization } = getConfiguration();
|
|
229
|
+
const { locales } = internationalization;
|
|
230
|
+
|
|
231
|
+
const paths = locales.map((locale) => ({
|
|
232
|
+
params: { locale },
|
|
233
|
+
}));
|
|
234
|
+
|
|
235
|
+
return { paths, fallback: false };
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export const getStaticProps: GetStaticProps = ({ params }) => {
|
|
239
|
+
const locale = params?.locale as string;
|
|
240
|
+
|
|
241
|
+
return {
|
|
242
|
+
props: {
|
|
243
|
+
locale,
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export default HomePage;
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
```jsx fileName="src/pages/[locale]/index.mjx" codeFormat="esm"
|
|
252
|
+
import { getConfiguration } from "intlayer";
|
|
253
|
+
import { ComponentExample } from "@components/ComponentExample";
|
|
254
|
+
|
|
255
|
+
const HomePage = () => <div>{/* Your content here */}</div>;
|
|
256
|
+
|
|
257
|
+
export const getStaticPaths = () => {
|
|
258
|
+
const { internationalization } = getConfiguration();
|
|
259
|
+
const { locales } = internationalization;
|
|
260
|
+
|
|
261
|
+
const paths = locales.map((locale) => ({
|
|
262
|
+
params: { locale },
|
|
263
|
+
}));
|
|
264
|
+
|
|
265
|
+
return { paths, fallback: false };
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export const getStaticProps = ({ params }) => {
|
|
269
|
+
const locale = params?.locale;
|
|
270
|
+
|
|
271
|
+
return {
|
|
272
|
+
props: {
|
|
273
|
+
locale,
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
```jsx fileName="src/pages/[locale]/index.csx" codeFormat="commonjs"
|
|
280
|
+
const { getConfiguration } = require("intlayer");
|
|
281
|
+
const { ComponentExample } = require("@components/ComponentExample");
|
|
282
|
+
|
|
283
|
+
const HomePage = () => <div>{/* Your content here */}</div>;
|
|
284
|
+
|
|
285
|
+
const getStaticPaths = async () => {
|
|
286
|
+
const { internationalization } = getConfiguration();
|
|
287
|
+
const { locales } = internationalization;
|
|
288
|
+
|
|
289
|
+
const paths = locales.map((locale) => ({
|
|
290
|
+
params: { locale },
|
|
291
|
+
}));
|
|
292
|
+
|
|
293
|
+
return { paths, fallback: false };
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
const getStaticProps = async ({ params }) => {
|
|
297
|
+
const locale = params?.locale;
|
|
298
|
+
|
|
299
|
+
return {
|
|
300
|
+
props: {
|
|
301
|
+
locale,
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
module.exports = {
|
|
307
|
+
getStaticProps,
|
|
308
|
+
getStaticPaths,
|
|
309
|
+
default: HomePage,
|
|
310
|
+
};
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
> `getStaticPaths` and `getStaticProps` ensure that your application pre-builds the necessary pages for all locales in Next.js Page Router. This approach reduces runtime computation and leads to an improved user experience. For more details, refer to the Next.js documentation on [`getStaticPaths`](https://nextjs.org/docs/pages/building-your-application/data-fetching/get-static-paths) and [`getStaticProps`](https://nextjs.org/docs/pages/building-your-application/data-fetching/get-static-props).
|
|
314
|
+
|
|
315
|
+
### Step 6: Declare Your Content
|
|
316
|
+
|
|
317
|
+
Create and manage your content declarations to store translations.
|
|
318
|
+
|
|
319
|
+
```tsx fileName="src/pages/[locale]/home.content.ts" contentDeclarationFormat="typescript"
|
|
320
|
+
import { t, type Dictionary } from "intlayer";
|
|
321
|
+
|
|
322
|
+
const homeContent = {
|
|
323
|
+
key: "home",
|
|
324
|
+
content: {
|
|
325
|
+
title: t({
|
|
326
|
+
en: "Welcome to My Website",
|
|
327
|
+
fr: "Bienvenue sur mon site Web",
|
|
328
|
+
es: "Bienvenido a mi sitio web",
|
|
329
|
+
}),
|
|
330
|
+
description: t({
|
|
331
|
+
en: "Get started by editing this page.",
|
|
332
|
+
fr: "Commencez par éditer cette page.",
|
|
333
|
+
es: "Comience por editar esta página.",
|
|
334
|
+
}),
|
|
335
|
+
},
|
|
336
|
+
} satisfies Dictionary;
|
|
337
|
+
|
|
338
|
+
export default homeContent;
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
```javascript fileName="src/pages/[locale]/home.content.mjs" contentDeclarationFormat="esm"
|
|
342
|
+
import { t } from "intlayer";
|
|
343
|
+
|
|
344
|
+
/** @type {import('intlayer').Dictionary} */
|
|
345
|
+
const homeContent = {
|
|
346
|
+
key: "home",
|
|
347
|
+
content: {
|
|
348
|
+
getStarted: {
|
|
349
|
+
main: t({
|
|
350
|
+
en: "Get started by editing this page.",
|
|
351
|
+
fr: "Commencez par éditer cette page.",
|
|
352
|
+
es: "Comience por editar esta página.",
|
|
353
|
+
}),
|
|
354
|
+
pageLink: "src/app/page.tsx",
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
export default homeContent;
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
```javascript fileName="src/pages/[locale]/home.content.cjs" contentDeclarationFormat="commonjs"
|
|
363
|
+
const { t } = require("intlayer");
|
|
364
|
+
|
|
365
|
+
/** @type {import('intlayer').Dictionary} */
|
|
366
|
+
const homeContent = {
|
|
367
|
+
key: "home",
|
|
368
|
+
content: {
|
|
369
|
+
getStarted: {
|
|
370
|
+
main: t({
|
|
371
|
+
en: "Get started by editing this page.",
|
|
372
|
+
fr: "Commencez par éditer cette page.",
|
|
373
|
+
es: "Comience por editar esta página.",
|
|
374
|
+
}),
|
|
375
|
+
pageLink: "src/app/page.tsx",
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
module.exports = homeContent;
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
```json fileName="src/pages/[locale]/home.content.json" contentDeclarationFormat="json"
|
|
384
|
+
{
|
|
385
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
386
|
+
"key": "home",
|
|
387
|
+
"content": {
|
|
388
|
+
"getStarted": {
|
|
389
|
+
"nodeType": "translation",
|
|
390
|
+
"translation": {
|
|
391
|
+
"en": "Get started by editing this page.",
|
|
392
|
+
"fr": "Commencez par éditer cette page.",
|
|
393
|
+
"es": "Comience por editar esta página."
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
"pageLink": {
|
|
397
|
+
"nodeType": "translation",
|
|
398
|
+
"translation": {
|
|
399
|
+
"en": "src/app/page.tsx",
|
|
400
|
+
"fr": "src/app/page.tsx",
|
|
401
|
+
"es": "src/app/page.tsx"
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
For more information on declaring content, refer to the [content declaration guide](https://github.com/aymericzip/intlayer/blob/main/docs/en/dictionary/get_started.md).
|
|
409
|
+
|
|
410
|
+
### Step 7: Utilize Content in Your Code
|
|
411
|
+
|
|
412
|
+
Access your content dictionaries throughout your application to display translated content.
|
|
413
|
+
|
|
414
|
+
```tsx {2,6} fileName="src/pages/[locale]/index.tsx" codeFormat="typescript"
|
|
415
|
+
import type { FC } from "react";
|
|
416
|
+
import { useIntlayer } from "next-intlayer";
|
|
417
|
+
import { ComponentExample } from "@components/ComponentExample";
|
|
418
|
+
|
|
419
|
+
const HomePage: FC = () => {
|
|
420
|
+
const content = useIntlayer("home");
|
|
421
|
+
|
|
422
|
+
return (
|
|
423
|
+
<div>
|
|
424
|
+
<h1>{content.title}</h1>
|
|
425
|
+
<p>{content.description}</p>
|
|
426
|
+
<ComponentExample />
|
|
427
|
+
{/* Additional components */}
|
|
428
|
+
</div>
|
|
429
|
+
);
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
// ... Rest of the code, including getStaticPaths and getStaticProps
|
|
433
|
+
|
|
434
|
+
export default HomePage;
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
```jsx {1,5} fileName="src/pages/[locale]/index.mjx" codeFormat="esm"
|
|
438
|
+
import { useIntlayer } from "next-intlayer";
|
|
439
|
+
import { ComponentExample } from "@components/ComponentExample";
|
|
440
|
+
|
|
441
|
+
const HomePage = () => {
|
|
442
|
+
const content = useIntlayer("home");
|
|
443
|
+
|
|
444
|
+
return (
|
|
445
|
+
<div>
|
|
446
|
+
<h1>{content.getStarted.main}</h1>
|
|
447
|
+
<code>{content.getStarted.pageLink}</code>
|
|
448
|
+
|
|
449
|
+
<ComponentExample />
|
|
450
|
+
{/* Additional components */}
|
|
451
|
+
</div>
|
|
452
|
+
);
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
// ... Rest of the code, including getStaticPaths and getStaticProps
|
|
456
|
+
|
|
457
|
+
export default HomePage;
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
```jsx {1,5} fileName="src/pages/[locale]/index.csx" codeFormat="commonjs"
|
|
461
|
+
const { useIntlayer } = require("next-intlayer");
|
|
462
|
+
const { ComponentExample } = require("@components/ComponentExample");
|
|
463
|
+
|
|
464
|
+
const HomePage = () => {
|
|
465
|
+
const content = useIntlayer("home");
|
|
466
|
+
|
|
467
|
+
return (
|
|
468
|
+
<div>
|
|
469
|
+
<h1>{content.getStarted.main}</h1>
|
|
470
|
+
<code>{content.getStarted.pageLink}</code>
|
|
471
|
+
|
|
472
|
+
<ComponentExample />
|
|
473
|
+
{/* Additional components */}
|
|
474
|
+
</div>
|
|
475
|
+
);
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
// ... Rest of the code, including getStaticPaths and getStaticProps
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
```tsx fileName="src/components/ComponentExample.tsx" codeFormat="typescript"
|
|
482
|
+
import type { FC } from "react";
|
|
483
|
+
import { useIntlayer } from "next-intlayer";
|
|
484
|
+
|
|
485
|
+
export const ComponentExample: FC = () => {
|
|
486
|
+
const content = useIntlayer("component-example"); // Ensure you have a corresponding content declaration
|
|
487
|
+
|
|
488
|
+
return (
|
|
489
|
+
<div>
|
|
490
|
+
<h2>{content.title}</h2>
|
|
491
|
+
<p>{content.content}</p>
|
|
492
|
+
</div>
|
|
493
|
+
);
|
|
494
|
+
};
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
```jsx fileName="src/components/ComponentExample.mjx" codeFormat="esm"
|
|
498
|
+
import { useIntlayer } from "next-intlayer";
|
|
499
|
+
|
|
500
|
+
const ComponentExample = () => {
|
|
501
|
+
const content = useIntlayer("component-example"); // Ensure you have a corresponding content declaration
|
|
502
|
+
|
|
503
|
+
return (
|
|
504
|
+
<div>
|
|
505
|
+
<h2>{content.title}</h2>
|
|
506
|
+
<p>{content.content}</p>
|
|
507
|
+
</div>
|
|
508
|
+
);
|
|
509
|
+
};
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
```jsx fileName="src/components/ComponentExample.csx" codeFormat="commonjs"
|
|
513
|
+
const { useIntlayer } = require("next-intlayer");
|
|
514
|
+
|
|
515
|
+
const ComponentExample = () => {
|
|
516
|
+
const content = useIntlayer("component-example"); // Ensure you have a corresponding content declaration
|
|
517
|
+
|
|
518
|
+
return (
|
|
519
|
+
<div>
|
|
520
|
+
<h2>{content.title}</h2>
|
|
521
|
+
<p>{content.content}</p>
|
|
522
|
+
</div>
|
|
523
|
+
);
|
|
524
|
+
};
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
> When using translations in `string` attributes (e.g., `alt`, `title`, `href`, `aria-label`), call the
|
|
528
|
+
|
|
529
|
+
> value of the function as follows:
|
|
530
|
+
|
|
531
|
+
> ```jsx
|
|
532
|
+
>
|
|
533
|
+
> ```
|
|
534
|
+
|
|
535
|
+
> <img src={content.image.src.value} alt={content.image.value} />
|
|
536
|
+
|
|
537
|
+
> ```
|
|
538
|
+
>
|
|
539
|
+
> ```
|
|
540
|
+
|
|
541
|
+
> To Learn more about the `useIntlayer` hook, refer to the [documentation](https://github.com/aymericzip/intlayer/blob/main/docs/en/packages/next-intlayer/useIntlayer.md).
|
|
542
|
+
|
|
543
|
+
### (Optional) Step 8: Internationalize Your Metadata
|
|
544
|
+
|
|
545
|
+
To internationalize metadata such as page titles and descriptions, use the `getStaticProps` function in conjunction with Intlayer's `getTranslation` function.
|
|
546
|
+
|
|
547
|
+
```tsx fileName="src/pages/[locale]/index.tsx" codeFormat="typescript"
|
|
548
|
+
import { GetStaticPaths, GetStaticProps } from "next";
|
|
549
|
+
import { type IConfigLocales, getTranslation, Locales } from "intlayer";
|
|
550
|
+
import { useIntlayer } from "next-intlayer";
|
|
551
|
+
|
|
552
|
+
interface HomePageProps {
|
|
553
|
+
locale: string;
|
|
554
|
+
metadata: Metadata;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
const HomePage = ({ metadata }: HomePageProps) => {
|
|
558
|
+
// Metadata can be used in the head or other components as needed
|
|
559
|
+
return (
|
|
560
|
+
<div>
|
|
561
|
+
<Head>
|
|
562
|
+
<title>{metadata.title}</title>
|
|
563
|
+
<meta name="description" content={metadata.description} />
|
|
564
|
+
</Head>
|
|
565
|
+
|
|
566
|
+
{/* Additional content */}
|
|
567
|
+
</div>
|
|
568
|
+
);
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
export const getStaticProps: GetStaticProps = async ({ params }) => {
|
|
572
|
+
const locale = params?.locale as string;
|
|
573
|
+
|
|
574
|
+
const t = <T,>(content: IConfigLocales<T>) => getTranslation(content, locale);
|
|
575
|
+
|
|
576
|
+
const metadata = {
|
|
577
|
+
title: t({
|
|
578
|
+
en: "My Website",
|
|
579
|
+
fr: "Mon Site Web",
|
|
580
|
+
es: "Mi Sitio Web",
|
|
581
|
+
}),
|
|
582
|
+
description: t({
|
|
583
|
+
en: "Welcome to my website.",
|
|
584
|
+
fr: "Bienvenue sur mon site Web.",
|
|
585
|
+
es: "Bienvenido a mi sitio web.",
|
|
586
|
+
}),
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
return {
|
|
590
|
+
props: {
|
|
591
|
+
locale,
|
|
592
|
+
metadata,
|
|
593
|
+
},
|
|
594
|
+
};
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
export default HomePage;
|
|
598
|
+
|
|
599
|
+
// ... Rest of the code including getStaticPaths
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
```jsx fileName="src/pages/[locale]/index.mjx" codeFormat="esm"
|
|
603
|
+
import { GetStaticPaths, GetStaticProps } from "next";
|
|
604
|
+
import { type IConfigLocales, getTranslation, Locales } from "intlayer";
|
|
605
|
+
import { useIntlayer } from "next-intlayer";
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
const HomePage = ({ metadata }) => {
|
|
610
|
+
// Metadata can be used in the head or other components as needed
|
|
611
|
+
return (
|
|
612
|
+
<div>
|
|
613
|
+
<Head>
|
|
614
|
+
<title>{metadata.title}</title>
|
|
615
|
+
<meta name="description" content={metadata.description} />
|
|
616
|
+
</Head>
|
|
617
|
+
|
|
618
|
+
{/* Additional content */}
|
|
619
|
+
</div>
|
|
620
|
+
);
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
export const getStaticProps = async ({ params }) => {
|
|
624
|
+
const locale = params?.locale as string;
|
|
625
|
+
|
|
626
|
+
const t = (content) =>
|
|
627
|
+
getTranslation(content, locale);
|
|
628
|
+
|
|
629
|
+
const metadata = {
|
|
630
|
+
title: t({
|
|
631
|
+
en: "My Website",
|
|
632
|
+
fr: "Mon Site Web",
|
|
633
|
+
es: "Mi Sitio Web",
|
|
634
|
+
}),
|
|
635
|
+
description: t({
|
|
636
|
+
en: "Welcome to my website.",
|
|
637
|
+
fr: "Bienvenue sur mon site Web.",
|
|
638
|
+
es: "Bienvenido a mi sitio web.",
|
|
639
|
+
}),
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
return {
|
|
643
|
+
props: {
|
|
644
|
+
locale,
|
|
645
|
+
metadata,
|
|
646
|
+
},
|
|
647
|
+
};
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
export default HomePage;
|
|
651
|
+
|
|
652
|
+
// ... Rest of the code including getStaticPaths
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
```jsx fileName="src/pages/[locale]/index.csx" codeFormat="commonjs"
|
|
656
|
+
const { GetStaticPaths, GetStaticProps } = require("next");
|
|
657
|
+
const { type IConfigLocales, getTranslation, Locales } = require("intlayer");
|
|
658
|
+
const { useIntlayer } = require("next-intlayer");
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
const HomePage = ({ metadata }) => {
|
|
662
|
+
// Metadata can be used in the head or other components as needed
|
|
663
|
+
return (
|
|
664
|
+
<div>
|
|
665
|
+
<Head>
|
|
666
|
+
<title>{metadata.title}</title>
|
|
667
|
+
<meta name="description" content={metadata.description} />
|
|
668
|
+
</Head>
|
|
669
|
+
|
|
670
|
+
{/* Additional content */}
|
|
671
|
+
</div>
|
|
672
|
+
);
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
const getStaticProps = async ({ params }) => {
|
|
676
|
+
const locale = params?.locale;
|
|
677
|
+
|
|
678
|
+
const t = (content) =>
|
|
679
|
+
getTranslation(content, locale);
|
|
680
|
+
|
|
681
|
+
const metadata = {
|
|
682
|
+
title: t({
|
|
683
|
+
en: "My Website",
|
|
684
|
+
fr: "Mon Site Web",
|
|
685
|
+
es: "Mi Sitio Web",
|
|
686
|
+
}),
|
|
687
|
+
description: t({
|
|
688
|
+
en: "Welcome to my website.",
|
|
689
|
+
fr: "Bienvenue sur mon site Web.",
|
|
690
|
+
es: "Bienvenido a mi sitio web.",
|
|
691
|
+
}),
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
return {
|
|
695
|
+
props: {
|
|
696
|
+
locale,
|
|
697
|
+
metadata,
|
|
698
|
+
},
|
|
699
|
+
};
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
module.exports = {
|
|
703
|
+
getStaticProps,
|
|
704
|
+
getStaticPaths,
|
|
705
|
+
default: HomePage,
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
// ... Rest of the code including getStaticPaths
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
### (Optional) Step 9: Change the Language of Your Content
|
|
712
|
+
|
|
713
|
+
To change the language of your content in Next.js, the recommended way is to use the `Link` component to redirect users to the appropriate localized page. The `Link` component enables prefetching of the page, which helps avoid a full page reload.
|
|
714
|
+
|
|
715
|
+
```tsx fileName="src/components/LanguageSwitcher.tsx" codeFormat="typescript"
|
|
716
|
+
import {
|
|
717
|
+
Locales,
|
|
718
|
+
getHTMLTextDir,
|
|
719
|
+
getLocaleName,
|
|
720
|
+
getLocalizedUrl,
|
|
721
|
+
} from "intlayer";
|
|
722
|
+
import { useLocalePageRouter } from "next-intlayer";
|
|
723
|
+
import { type FC } from "react";
|
|
724
|
+
import Link from "next/link";
|
|
725
|
+
|
|
726
|
+
const LocaleSwitcher: FC = () => {
|
|
727
|
+
const { locale, pathWithoutLocale, availableLocales } = useLocalePageRouter();
|
|
728
|
+
const { setLocaleCookie } = useLocaleCookie();
|
|
729
|
+
|
|
730
|
+
return (
|
|
731
|
+
<div>
|
|
732
|
+
<button popoverTarget="localePopover">{getLocaleName(locale)}</button>
|
|
733
|
+
<div id="localePopover" popover="auto">
|
|
734
|
+
{availableLocales.map((localeItem) => (
|
|
735
|
+
<Link
|
|
736
|
+
href={getLocalizedUrl(pathWithoutLocale, localeItem)}
|
|
737
|
+
hrefLang={localeItem}
|
|
738
|
+
key={localeItem}
|
|
739
|
+
aria-current={locale === localeItem ? "page" : undefined}
|
|
740
|
+
onClick={() => setLocaleCookie(localeItem)}
|
|
741
|
+
>
|
|
742
|
+
<span>
|
|
743
|
+
{/* Locale - e.g. FR */}
|
|
744
|
+
{localeItem}
|
|
745
|
+
</span>
|
|
746
|
+
<span>
|
|
747
|
+
{/* Language in its own Locale - e.g. Français */}
|
|
748
|
+
{getLocaleName(localeItem, locale)}
|
|
749
|
+
</span>
|
|
750
|
+
<span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
|
|
751
|
+
{/* Language in current Locale - e.g. Francés with current locale set to Locales.SPANISH */}
|
|
752
|
+
{getLocaleName(localeItem)}
|
|
753
|
+
</span>
|
|
754
|
+
<span dir="ltr" lang={Locales.ENGLISH}>
|
|
755
|
+
{/* Language in English - e.g. French */}
|
|
756
|
+
{getLocaleName(localeItem, Locales.ENGLISH)}
|
|
757
|
+
</span>
|
|
758
|
+
</Link>
|
|
759
|
+
))}
|
|
760
|
+
</div>
|
|
761
|
+
</div>
|
|
762
|
+
);
|
|
763
|
+
};
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
```jsx fileName="src/components/LanguageSwitcher.msx" codeFormat="esm"
|
|
767
|
+
import {
|
|
768
|
+
Locales,
|
|
769
|
+
getHTMLTextDir,
|
|
770
|
+
getLocaleName,
|
|
771
|
+
getLocalizedUrl,
|
|
772
|
+
} from "intlayer";
|
|
773
|
+
import { useLocalePageRouter } from "next-intlayer";
|
|
774
|
+
import Link from "next/link";
|
|
775
|
+
|
|
776
|
+
const LocaleSwitcher = () => {
|
|
777
|
+
const { locale, pathWithoutLocale, availableLocales } = useLocalePageRouter();
|
|
778
|
+
const { setLocaleCookie } = useLocaleCookie();
|
|
779
|
+
|
|
780
|
+
return (
|
|
781
|
+
<div>
|
|
782
|
+
<button popoverTarget="localePopover">{getLocaleName(locale)}</button>
|
|
783
|
+
<div id="localePopover" popover="auto">
|
|
784
|
+
{availableLocales.map((localeItem) => (
|
|
785
|
+
<Link
|
|
786
|
+
href={getLocalizedUrl(pathWithoutLocale, localeItem)}
|
|
787
|
+
hrefLang={localeItem}
|
|
788
|
+
key={localeItem}
|
|
789
|
+
aria-current={locale === localeItem ? "page" : undefined}
|
|
790
|
+
onClick={() => setLocaleCookie(localeItem)}
|
|
791
|
+
>
|
|
792
|
+
<span>
|
|
793
|
+
{/* Locale - e.g. FR */}
|
|
794
|
+
{localeItem}
|
|
795
|
+
</span>
|
|
796
|
+
<span>
|
|
797
|
+
{/* Language in its own Locale - e.g. Français */}
|
|
798
|
+
{getLocaleName(localeItem, locale)}
|
|
799
|
+
</span>
|
|
800
|
+
<span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
|
|
801
|
+
{/* Language in current Locale - e.g. Francés with current locale set to Locales.SPANISH */}
|
|
802
|
+
{getLocaleName(localeItem)}
|
|
803
|
+
</span>
|
|
804
|
+
<span dir="ltr" lang={Locales.ENGLISH}>
|
|
805
|
+
{/* Language in English - e.g. French */}
|
|
806
|
+
{getLocaleName(localeItem, Locales.ENGLISH)}
|
|
807
|
+
</span>
|
|
808
|
+
</Link>
|
|
809
|
+
))}
|
|
810
|
+
</div>
|
|
811
|
+
</div>
|
|
812
|
+
);
|
|
813
|
+
};
|
|
814
|
+
```
|
|
815
|
+
|
|
816
|
+
```jsx fileName="src/components/LanguageSwitcher.msx" codeFormat="commonjs"
|
|
817
|
+
const {
|
|
818
|
+
Locales,
|
|
819
|
+
getHTMLTextDir,
|
|
820
|
+
getLocaleName,
|
|
821
|
+
getLocalizedUrl,
|
|
822
|
+
} = require("intlayer");
|
|
823
|
+
const { useLocalePageRouter } = require("next-intlayer");
|
|
824
|
+
const Link = require("next/link");
|
|
825
|
+
|
|
826
|
+
const LocaleSwitcher = () => {
|
|
827
|
+
const { locale, pathWithoutLocale, availableLocales } = useLocalePageRouter();
|
|
828
|
+
const { setLocaleCookie } = useLocaleCookie();
|
|
829
|
+
|
|
830
|
+
return (
|
|
831
|
+
<select>
|
|
832
|
+
{availableLocales.map((localeItem) => (
|
|
833
|
+
<option value={localeItem} key={localeItem}>
|
|
834
|
+
<Link
|
|
835
|
+
href={getLocalizedUrl(pathWithoutLocale, localeItem)}
|
|
836
|
+
hrefLang={localeItem}
|
|
837
|
+
aria-current={locale === localeItem ? "page" : undefined}
|
|
838
|
+
onClick={() => setLocaleCookie(localeItem)}
|
|
839
|
+
>
|
|
840
|
+
<span>
|
|
841
|
+
{/* Locale - e.g. FR */}
|
|
842
|
+
{localeItem}
|
|
843
|
+
</span>
|
|
844
|
+
<span>
|
|
845
|
+
{/* Language in its own Locale - e.g. Français */}
|
|
846
|
+
{getLocaleName(localeItem, locale)}
|
|
847
|
+
</span>
|
|
848
|
+
<span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
|
|
849
|
+
{/* Language in current Locale - e.g. Francés with current locale set to Locales.SPANISH */}
|
|
850
|
+
{getLocaleName(localeItem)}
|
|
851
|
+
</span>
|
|
852
|
+
<span dir="ltr" lang={Locales.ENGLISH}>
|
|
853
|
+
{/* Language in English - e.g. French */}
|
|
854
|
+
{getLocaleName(localeItem, Locales.ENGLISH)}
|
|
855
|
+
</span>
|
|
856
|
+
</Link>
|
|
857
|
+
</option>
|
|
858
|
+
))}
|
|
859
|
+
</select>
|
|
860
|
+
);
|
|
861
|
+
};
|
|
862
|
+
```
|
|
863
|
+
|
|
864
|
+
> An alternative way is to use the `setLocale` function provided by the `useLocale` hook. This function will not allow prefetching the page and will reload the page.
|
|
865
|
+
|
|
866
|
+
> In this case, without redirection using `router.push`, only your server-side code will change the locale of the content.
|
|
867
|
+
|
|
868
|
+
```tsx fileName="src/components/LocaleSwitcher.tsx" codeFormat="typescript"
|
|
869
|
+
"use client";
|
|
870
|
+
|
|
871
|
+
import { useRouter } from "next/navigation";
|
|
872
|
+
import { useLocale } from "next-intlayer";
|
|
873
|
+
import { getLocalizedUrl } from "intlayer";
|
|
874
|
+
|
|
875
|
+
// ... Rest of the code
|
|
876
|
+
|
|
877
|
+
const router = useRouter();
|
|
878
|
+
const { setLocale } = useLocale({
|
|
879
|
+
onLocaleChange: (locale) => {
|
|
880
|
+
router.push(getLocalizedUrl(pathWithoutLocale, locale));
|
|
881
|
+
},
|
|
882
|
+
});
|
|
883
|
+
|
|
884
|
+
return (
|
|
885
|
+
<button onClick={() => setLocale(Locales.FRENCH)}>Change to French</button>
|
|
886
|
+
);
|
|
887
|
+
```
|
|
888
|
+
|
|
889
|
+
> The `useLocalePageRouter` API is the same as `useLocale`. To Learn more about the `useLocale` hook, refer to the [documentation](https://github.com/aymericzip/intlayer/blob/main/docs/en/packages/next-intlayer/useLocale.md).
|
|
890
|
+
|
|
891
|
+
> Documentation references:
|
|
892
|
+
|
|
893
|
+
> - [`getLocaleName` hook](https://github.com/aymericzip/intlayer/blob/main/docs/en/packages/intlayer/getLocaleName.md)
|
|
894
|
+
|
|
895
|
+
> - [`getLocalizedUrl` hook](https://github.com/aymericzip/intlayer/blob/main/docs/en/packages/intlayer/getLocalizedUrl.md)
|
|
896
|
+
|
|
897
|
+
> - [`getHTMLTextDir` hook](https://github.com/aymericzip/intlayer/blob/main/docs/en/packages/intlayer/getHTMLTextDir.md)
|
|
898
|
+
|
|
899
|
+
> - [`hrefLang` attribute](https://developers.google.com/search/docs/specialty/international/localized-versions?hl=fr)
|
|
900
|
+
|
|
901
|
+
> - [`lang` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)
|
|
902
|
+
|
|
903
|
+
> - [`dir` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)
|
|
904
|
+
|
|
905
|
+
> - [`aria-current` attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)
|
|
906
|
+
|
|
907
|
+
### (Optional) Step 10: Creating a Localized Link Component
|
|
908
|
+
|
|
909
|
+
To ensure that your application’s navigation respects the current locale, you can create a custom `Link` component. This component automatically prefixes internal URLs with the current language, so that. For example, when a French-speaking user clicks on a link to the "About" page, they are redirected to `/fr/about` instead of `/about`.
|
|
910
|
+
|
|
911
|
+
This behavior is useful for several reasons:
|
|
912
|
+
|
|
913
|
+
- **SEO and User Experience**: Localized URLs help search engines index language-specific pages correctly and provide users with content in their preferred language.
|
|
914
|
+
- **Consistency**: By using a localized link throughout your application, you guarantee that navigation stays within the current locale, preventing unexpected language switches.
|
|
915
|
+
- **Maintainability**: Centralizing the localization logic in a single component simplifies the management of URLs, making your codebase easier to maintain and extend as your application grows.
|
|
916
|
+
|
|
917
|
+
Below is the implementation of a localized `Link` component in TypeScript:
|
|
918
|
+
|
|
919
|
+
```tsx fileName="src/components/Link.tsx" codeFormat="typescript"
|
|
920
|
+
"use client";
|
|
921
|
+
|
|
922
|
+
import { getLocalizedUrl } from "intlayer";
|
|
923
|
+
import NextLink, { type LinkProps as NextLinkProps } from "next/link";
|
|
924
|
+
import { useLocale } from "next-intlayer";
|
|
925
|
+
import { forwardRef, PropsWithChildren, type ForwardedRef } from "react";
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Utility function to check whether a given URL is external.
|
|
929
|
+
* If the URL starts with http:// or https://, it's considered external.
|
|
930
|
+
*/
|
|
931
|
+
export const checkIsExternalLink = (href?: string): boolean =>
|
|
932
|
+
/^https?:\/\//.test(href ?? "");
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* A custom Link component that adapts the href attribute based on the current locale.
|
|
936
|
+
* For internal links, it uses `getLocalizedUrl` to prefix the URL with the locale (e.g., /fr/about).
|
|
937
|
+
* This ensures that navigation stays within the same locale context.
|
|
938
|
+
*/
|
|
939
|
+
export const Link = forwardRef<
|
|
940
|
+
HTMLAnchorElement,
|
|
941
|
+
PropsWithChildren<NextLinkProps>
|
|
942
|
+
>(({ href, children, ...props }, ref: ForwardedRef<HTMLAnchorElement>) => {
|
|
943
|
+
const { locale } = useLocale();
|
|
944
|
+
const isExternalLink = checkIsExternalLink(href.toString());
|
|
945
|
+
|
|
946
|
+
// If the link is internal and a valid href is provided, get the localized URL.
|
|
947
|
+
const hrefI18n: NextLinkProps["href"] =
|
|
948
|
+
href && !isExternalLink ? getLocalizedUrl(href.toString(), locale) : href;
|
|
949
|
+
|
|
950
|
+
return (
|
|
951
|
+
<NextLink href={hrefI18n} ref={ref} {...props}>
|
|
952
|
+
{children}
|
|
953
|
+
</NextLink>
|
|
954
|
+
);
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
Link.displayName = "Link";
|
|
958
|
+
```
|
|
959
|
+
|
|
960
|
+
```jsx fileName="src/components/Link.mjx" codeFormat="esm"
|
|
961
|
+
'use client';
|
|
962
|
+
|
|
963
|
+
import { getLocalizedUrl } from 'intlayer';
|
|
964
|
+
import NextLink, { type LinkProps as NextLinkProps } from 'next/link';
|
|
965
|
+
import { useLocale } from 'next-intlayer';
|
|
966
|
+
import { forwardRef, PropsWithChildren, type ForwardedRef } from 'react';
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* Utility function to check whether a given URL is external.
|
|
970
|
+
* If the URL starts with http:// or https://, it's considered external.
|
|
971
|
+
*/
|
|
972
|
+
export const checkIsExternalLink = (href) =>
|
|
973
|
+
/^https?:\/\//.test(href ?? '');
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* A custom Link component that adapts the href attribute based on the current locale.
|
|
977
|
+
* For internal links, it uses `getLocalizedUrl` to prefix the URL with the locale (e.g., /fr/about).
|
|
978
|
+
* This ensures that navigation stays within the same locale context.
|
|
979
|
+
*/
|
|
980
|
+
export const Link = forwardRef(({ href, children, ...props }, ref) => {
|
|
981
|
+
const { locale } = useLocale();
|
|
982
|
+
const isExternalLink = checkIsExternalLink(href.toString());
|
|
983
|
+
|
|
984
|
+
// If the link is internal and a valid href is provided, get the localized URL.
|
|
985
|
+
const hrefI18n =
|
|
986
|
+
href && !isExternalLink ? getLocalizedUrl(href.toString(), locale) : href;
|
|
987
|
+
|
|
988
|
+
return (
|
|
989
|
+
<NextLink href={hrefI18n} ref={ref} {...props}>
|
|
990
|
+
{children}
|
|
991
|
+
</NextLink>
|
|
992
|
+
);
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
Link.displayName = 'Link';
|
|
996
|
+
```
|
|
997
|
+
|
|
998
|
+
```jsx fileName="src/components/Link.csx" codeFormat="commonjs"
|
|
999
|
+
'use client';
|
|
1000
|
+
|
|
1001
|
+
const { getLocalizedUrl } = require("intlayer");
|
|
1002
|
+
const NextLink = require("next/link");
|
|
1003
|
+
const { useLocale } = require("next-intlayer");
|
|
1004
|
+
const { forwardRef } = require("react");
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* Utility function to check whether a given URL is external.
|
|
1008
|
+
* If the URL starts with http:// or https://, it's considered external.
|
|
1009
|
+
*/
|
|
1010
|
+
const checkIsExternalLink = (href) =>
|
|
1011
|
+
/^https?:\/\//.test(href ?? '');
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
const Link = forwardRef(({ href, children, ...props }, ref) => {
|
|
1015
|
+
const { locale } = useLocale();
|
|
1016
|
+
const isExternalLink = checkIsExternalLink(href.toString());
|
|
1017
|
+
|
|
1018
|
+
// If the link is internal and a valid href is provided, get the localized URL.
|
|
1019
|
+
const hrefI18n: NextLinkProps['href'] =
|
|
1020
|
+
href && !isExternalLink ? getLocalizedUrl(href.toString(), locale) : href;
|
|
1021
|
+
|
|
1022
|
+
return (
|
|
1023
|
+
<NextLink href={hrefI18n} ref={ref} {...props}>
|
|
1024
|
+
{children}
|
|
1025
|
+
</NextLink>
|
|
1026
|
+
);
|
|
1027
|
+
});
|
|
1028
|
+
|
|
1029
|
+
Link.displayName = 'Link';
|
|
1030
|
+
```
|
|
1031
|
+
|
|
1032
|
+
#### How It Works
|
|
1033
|
+
|
|
1034
|
+
- **Detecting External Links**:
|
|
1035
|
+
The helper function `checkIsExternalLink` determines whether a URL is external. External links are left unchanged because they do not need localization.
|
|
1036
|
+
|
|
1037
|
+
- **Retrieving the Current Locale**:
|
|
1038
|
+
The `useLocale` hook provides the current locale (e.g., `fr` for French).
|
|
1039
|
+
|
|
1040
|
+
- **Localizing the URL**:
|
|
1041
|
+
For internal links (i.e., non-external), `getLocalizedUrl` is used to automatically prefix the URL with the current locale. This means that if your user is in French, passing `/about` as the `href` will transform it to `/fr/about`.
|
|
1042
|
+
|
|
1043
|
+
- **Returning the Link**:
|
|
1044
|
+
The component returns an `<a>` element with the localized URL, ensuring that navigation is consistent with the locale.
|
|
1045
|
+
|
|
1046
|
+
By integrating this `Link` component across your application, you maintain a coherent and language-aware user experience while also benefitting from improved SEO and usability.
|
|
1047
|
+
|
|
1048
|
+
### (Optional) Step 11: Optmize your bundle size
|
|
1049
|
+
|
|
1050
|
+
When using `next-intlayer`, dictionaries are included in the bundle for every page by default. To optimize bundle size, Intlayer provides an optional SWC plugin that intelligently replace `useIntlayer` calls using macros. This ensures dictionaries are only included in bundles for pages that actually use them.
|
|
1051
|
+
|
|
1052
|
+
To enable this optimization, install the `@intlayer/swc` package. Once installed, `next-intlayer` will automatically detect and use the plugin:
|
|
1053
|
+
|
|
1054
|
+
```bash packageManager="npm"
|
|
1055
|
+
npm install @intlayer/swc --save-dev
|
|
1056
|
+
```
|
|
1057
|
+
|
|
1058
|
+
```bash packageManager="pnpm"
|
|
1059
|
+
pnpm add @intlayer/swc --save-dev
|
|
1060
|
+
```
|
|
1061
|
+
|
|
1062
|
+
```bash packageManager="yarn"
|
|
1063
|
+
yarn add @intlayer/swc --save-dev
|
|
1064
|
+
```
|
|
1065
|
+
|
|
1066
|
+
> Note: This optimization is only available for Next.js 13 and above.
|
|
1067
|
+
|
|
1068
|
+
> Note: This package is not installed by default because SWC plugins are still experimental on Next.js. It may change in the future.
|
|
1069
|
+
|
|
1070
|
+
### Configure TypeScript
|
|
1071
|
+
|
|
1072
|
+
Intlayer use module augmentation to get benefits of TypeScript and make your codebase stronger.
|
|
1073
|
+
|
|
1074
|
+

|
|
1075
|
+
|
|
1076
|
+

|
|
1077
|
+
|
|
1078
|
+
Ensure your TypeScript configuration includes the autogenerated types.
|
|
1079
|
+
|
|
1080
|
+
```json5 fileName="tsconfig.json"
|
|
1081
|
+
{
|
|
1082
|
+
// ... Your existing TypeScript configurations
|
|
1083
|
+
"include": [
|
|
1084
|
+
// ... Your existing TypeScript configurations
|
|
1085
|
+
".intlayer/**/*.ts", // Include the auto-generated types
|
|
1086
|
+
],
|
|
1087
|
+
}
|
|
1088
|
+
```
|
|
1089
|
+
|
|
1090
|
+
### Git Configuration
|
|
1091
|
+
|
|
1092
|
+
To keep your repository clean and avoid committing generated files, it's recommended to ignore files created by Intlayer.
|
|
1093
|
+
|
|
1094
|
+
Add the following lines to your `.gitignore` file:
|
|
1095
|
+
|
|
1096
|
+
```plaintext fileName=".gitignore"
|
|
1097
|
+
# Ignore the files generated by Intlayer
|
|
1098
|
+
.intlayer
|
|
1099
|
+
```
|
|
1100
|
+
|
|
1101
|
+
### VS Code Extension
|
|
1102
|
+
|
|
1103
|
+
To improve your development experience with Intlayer, you can install the official **Intlayer VS Code Extension**.
|
|
1104
|
+
|
|
1105
|
+
[Install from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
1106
|
+
|
|
1107
|
+
This extension provides:
|
|
1108
|
+
|
|
1109
|
+
- **Autocompletion** for translation keys.
|
|
1110
|
+
- **Real-time error detection** for missing translations.
|
|
1111
|
+
- **Inline previews** of translated content.
|
|
1112
|
+
- **Quick actions** to easily create and update translations.
|
|
1113
|
+
|
|
1114
|
+
For more details on how to use the extension, refer to the [Intlayer VS Code Extension documentation](https://intlayer.org/doc/vs-code-extension).
|
|
1115
|
+
|
|
1116
|
+
## Additional Resources
|
|
1117
|
+
|
|
1118
|
+
- **Intlayer Documentation:** [GitHub Repository](https://github.com/aymericzip/intlayer)
|
|
1119
|
+
- **Dictionary Guide:** [Dictionary](https://github.com/aymericzip/intlayer/blob/main/docs/en/dictionary/get_started.md)
|
|
1120
|
+
- **Configuration Documentation:** [Configuration Guide](https://github.com/aymericzip/intlayer/blob/main/docs/en/configuration.md)
|
|
1121
|
+
|
|
1122
|
+
By following this guide, you can effectively integrate Intlayer into your Next.js application using the Page Router, enabling robust and scalable internationalization support for your web projects.
|
|
1123
|
+
|
|
1124
|
+
### Go Further
|
|
1125
|
+
|
|
1126
|
+
To go further, you can implement the [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/en/intlayer_visual_editor.md) or externalize your content using the [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/en/intlayer_CMS.md).
|