@intlayer/docs 7.5.11 → 7.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blog/ar/intlayer_with_i18next.md +0 -2
- package/blog/ar/intlayer_with_next-i18next.md +0 -2
- package/blog/ar/intlayer_with_react-i18next.md +0 -2
- package/blog/de/intlayer_with_i18next.md +0 -45
- package/blog/de/intlayer_with_next-i18next.md +0 -46
- package/blog/de/intlayer_with_react-i18next.md +0 -2
- package/blog/en/intlayer_with_i18next.md +0 -46
- package/blog/en/intlayer_with_next-i18next.md +0 -48
- package/blog/en/intlayer_with_next-intl.md +0 -44
- package/blog/en/intlayer_with_react-i18next.md +0 -44
- package/blog/en/intlayer_with_react-intl.md +0 -42
- package/blog/en/intlayer_with_vue-i18n.md +0 -44
- package/blog/en-GB/intlayer_with_i18next.md +0 -45
- package/blog/en-GB/intlayer_with_next-i18next.md +0 -47
- package/blog/en-GB/intlayer_with_next-intl.md +0 -42
- package/blog/en-GB/intlayer_with_react-i18next.md +0 -43
- package/blog/en-GB/intlayer_with_react-intl.md +0 -42
- package/blog/en-GB/intlayer_with_vue-i18n.md +0 -46
- package/blog/es/intlayer_with_i18next.md +0 -45
- package/blog/es/intlayer_with_next-i18next.md +0 -47
- package/blog/es/intlayer_with_next-intl.md +0 -42
- package/blog/es/intlayer_with_react-i18next.md +0 -43
- package/blog/es/intlayer_with_react-intl.md +0 -42
- package/blog/es/intlayer_with_vue-i18n.md +0 -46
- package/blog/fr/intlayer_with_i18next.md +0 -45
- package/blog/fr/intlayer_with_next-i18next.md +0 -47
- package/blog/fr/intlayer_with_next-intl.md +0 -42
- package/blog/fr/intlayer_with_react-i18next.md +0 -43
- package/blog/fr/intlayer_with_react-intl.md +0 -42
- package/blog/fr/intlayer_with_vue-i18n.md +0 -46
- package/blog/hi/intlayer_with_i18next.md +0 -2
- package/blog/hi/intlayer_with_next-i18next.md +0 -2
- package/blog/hi/intlayer_with_react-i18next.md +0 -2
- package/blog/id/intlayer_with_i18next.md +0 -2
- package/blog/id/intlayer_with_next-i18next.md +0 -2
- package/blog/id/intlayer_with_react-i18next.md +0 -2
- package/blog/it/intlayer_with_i18next.md +0 -2
- package/blog/it/intlayer_with_next-i18next.md +0 -2
- package/blog/it/intlayer_with_react-i18next.md +0 -2
- package/blog/ja/intlayer_with_i18next.md +0 -45
- package/blog/ja/intlayer_with_next-i18next.md +0 -46
- package/blog/ja/intlayer_with_next-intl.md +0 -42
- package/blog/ja/intlayer_with_react-i18next.md +0 -42
- package/blog/ja/intlayer_with_react-intl.md +0 -42
- package/blog/ja/intlayer_with_vue-i18n.md +0 -46
- package/blog/ko/intlayer_with_i18next.md +0 -2
- package/blog/ko/intlayer_with_next-i18next.md +0 -2
- package/blog/ko/intlayer_with_react-i18next.md +0 -1
- package/blog/pl/intlayer_with_i18next.md +0 -45
- package/blog/pl/intlayer_with_next-i18next.md +0 -46
- package/blog/pl/intlayer_with_next-intl.md +0 -42
- package/blog/pl/intlayer_with_react-i18next.md +0 -43
- package/blog/pl/intlayer_with_react-intl.md +0 -42
- package/blog/pl/intlayer_with_vue-i18n.md +0 -46
- package/blog/pt/intlayer_with_i18next.md +0 -2
- package/blog/pt/intlayer_with_next-i18next.md +0 -2
- package/blog/pt/intlayer_with_react-i18next.md +0 -2
- package/blog/ru/intlayer_with_i18next.md +0 -45
- package/blog/ru/intlayer_with_next-i18next.md +0 -47
- package/blog/ru/intlayer_with_next-intl.md +0 -42
- package/blog/ru/intlayer_with_react-i18next.md +0 -43
- package/blog/ru/intlayer_with_react-intl.md +0 -42
- package/blog/ru/intlayer_with_vue-i18n.md +0 -46
- package/blog/tr/intlayer_with_i18next.md +0 -2
- package/blog/tr/intlayer_with_next-i18next.md +0 -1
- package/blog/tr/intlayer_with_react-i18next.md +0 -2
- package/blog/uk/compiler_vs_declarative_i18n.md +224 -0
- package/blog/uk/i18n_using_next-i18next.md +1086 -0
- package/blog/uk/i18n_using_next-intl.md +760 -0
- package/blog/uk/index.md +69 -0
- package/blog/uk/internationalization_and_SEO.md +273 -0
- package/blog/uk/intlayer_with_i18next.md +211 -0
- package/blog/uk/intlayer_with_next-i18next.md +202 -0
- package/blog/uk/intlayer_with_next-intl.md +203 -0
- package/blog/uk/intlayer_with_react-i18next.md +200 -0
- package/blog/uk/intlayer_with_react-intl.md +202 -0
- package/blog/uk/intlayer_with_vue-i18n.md +206 -0
- package/blog/uk/l10n_platform_alternative/Lokalise.md +80 -0
- package/blog/uk/l10n_platform_alternative/crowdin.md +80 -0
- package/blog/uk/l10n_platform_alternative/phrase.md +78 -0
- package/blog/uk/list_i18n_technologies/CMS/drupal.md +143 -0
- package/blog/uk/list_i18n_technologies/CMS/wix.md +167 -0
- package/blog/uk/list_i18n_technologies/CMS/wordpress.md +189 -0
- package/blog/uk/list_i18n_technologies/frameworks/angular.md +125 -0
- package/blog/uk/list_i18n_technologies/frameworks/flutter.md +128 -0
- package/blog/uk/list_i18n_technologies/frameworks/react-native.md +217 -0
- package/blog/uk/list_i18n_technologies/frameworks/react.md +155 -0
- package/blog/uk/list_i18n_technologies/frameworks/svelte.md +145 -0
- package/blog/uk/list_i18n_technologies/frameworks/vue.md +144 -0
- package/blog/uk/next-i18next_vs_next-intl_vs_intlayer.md +1499 -0
- package/blog/uk/nextjs-multilingual-seo-comparison.md +360 -0
- package/blog/uk/rag_powered_documentation_assistant.md +288 -0
- package/blog/uk/react-i18next_vs_react-intl_vs_intlayer.md +164 -0
- package/blog/uk/vue-i18n_vs_intlayer.md +279 -0
- package/blog/uk/what_is_internationalization.md +167 -0
- package/blog/vi/intlayer_with_i18next.md +0 -2
- package/blog/vi/intlayer_with_next-i18next.md +0 -2
- package/blog/vi/intlayer_with_react-i18next.md +0 -2
- package/blog/zh/intlayer_with_i18next.md +0 -2
- package/blog/zh/intlayer_with_next-i18next.md +0 -2
- package/blog/zh/intlayer_with_react-i18next.md +0 -2
- package/blog/zh/intlayer_with_vue-i18n.md +0 -46
- package/dist/cjs/generated/blog.entry.cjs +58 -29
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +218 -99
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +50 -15
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +4 -2
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +58 -29
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +218 -99
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/esm/generated/frequentQuestions.entry.mjs +50 -15
- package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
- package/dist/esm/generated/legal.entry.mjs +4 -2
- package/dist/esm/generated/legal.entry.mjs.map +1 -1
- package/dist/types/generated/blog.entry.d.ts.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +1 -0
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/dist/types/generated/frequentQuestions.entry.d.ts +1 -0
- package/dist/types/generated/frequentQuestions.entry.d.ts.map +1 -1
- package/dist/types/generated/legal.entry.d.ts.map +1 -1
- package/docs/ar/configuration.md +6 -1
- package/docs/ar/dictionary/content_file.md +6 -1
- package/docs/ar/intlayer_with_next-i18next.md +0 -1
- package/docs/ar/intlayer_with_nextjs_14.md +28 -0
- package/docs/ar/intlayer_with_nextjs_15.md +28 -0
- package/docs/ar/intlayer_with_nextjs_16.md +28 -0
- package/docs/ar/intlayer_with_nextjs_no_locale_path.md +1159 -0
- package/docs/ar/plugins/sync-json.md +6 -2
- package/docs/de/configuration.md +6 -1
- package/docs/de/dictionary/content_file.md +6 -1
- package/docs/de/intlayer_with_next-i18next.md +0 -1
- package/docs/de/intlayer_with_nextjs_14.md +28 -0
- package/docs/de/intlayer_with_nextjs_15.md +28 -0
- package/docs/de/intlayer_with_nextjs_16.md +28 -0
- package/docs/de/intlayer_with_nextjs_no_locale_path.md +1152 -0
- package/docs/de/plugins/sync-json.md +6 -2
- package/docs/en/configuration.md +6 -1
- package/docs/en/dictionary/content_file.md +6 -1
- package/docs/en/intlayer_with_next-i18next.md +0 -1
- package/docs/en/intlayer_with_nextjs_14.md +28 -0
- package/docs/en/intlayer_with_nextjs_15.md +28 -0
- package/docs/en/intlayer_with_nextjs_16.md +31 -1
- package/docs/en/intlayer_with_nextjs_no_locale_path.md +1132 -0
- package/docs/en/plugins/sync-json.md +6 -2
- package/docs/en-GB/configuration.md +6 -1
- package/docs/en-GB/dictionary/content_file.md +3 -1
- package/docs/en-GB/intlayer_with_next-i18next.md +0 -1
- package/docs/en-GB/intlayer_with_nextjs_14.md +28 -0
- package/docs/en-GB/intlayer_with_nextjs_15.md +28 -0
- package/docs/en-GB/intlayer_with_nextjs_16.md +28 -0
- package/docs/en-GB/intlayer_with_nextjs_no_locale_path.md +1154 -0
- package/docs/en-GB/plugins/sync-json.md +6 -2
- package/docs/es/configuration.md +6 -1
- package/docs/es/dictionary/content_file.md +6 -1
- package/docs/es/intlayer_with_next-i18next.md +0 -1
- package/docs/es/intlayer_with_nextjs_14.md +28 -0
- package/docs/es/intlayer_with_nextjs_15.md +28 -0
- package/docs/es/intlayer_with_nextjs_16.md +28 -0
- package/docs/es/intlayer_with_nextjs_no_locale_path.md +1143 -0
- package/docs/es/plugins/sync-json.md +6 -2
- package/docs/fr/configuration.md +6 -1
- package/docs/fr/dictionary/content_file.md +3 -1
- package/docs/fr/intlayer_with_next-i18next.md +0 -1
- package/docs/fr/intlayer_with_nextjs_14.md +28 -0
- package/docs/fr/intlayer_with_nextjs_15.md +28 -0
- package/docs/fr/intlayer_with_nextjs_16.md +28 -0
- package/docs/fr/intlayer_with_nextjs_no_locale_path.md +1174 -0
- package/docs/fr/plugins/sync-json.md +9 -5
- package/docs/hi/configuration.md +6 -1
- package/docs/hi/dictionary/content_file.md +3 -1
- package/docs/hi/intlayer_with_next-i18next.md +0 -1
- package/docs/hi/intlayer_with_nextjs_14.md +28 -0
- package/docs/hi/intlayer_with_nextjs_15.md +28 -0
- package/docs/hi/intlayer_with_nextjs_16.md +28 -0
- package/docs/hi/intlayer_with_nextjs_no_locale_path.md +1151 -0
- package/docs/hi/plugins/sync-json.md +6 -2
- package/docs/id/configuration.md +6 -1
- package/docs/id/dictionary/content_file.md +3 -1
- package/docs/id/intlayer_with_next-i18next.md +0 -1
- package/docs/id/intlayer_with_nextjs_14.md +28 -0
- package/docs/id/intlayer_with_nextjs_15.md +28 -0
- package/docs/id/intlayer_with_nextjs_16.md +28 -0
- package/docs/id/intlayer_with_nextjs_no_locale_path.md +1154 -0
- package/docs/id/plugins/sync-json.md +6 -2
- package/docs/it/configuration.md +6 -1
- package/docs/it/dictionary/content_file.md +3 -1
- package/docs/it/intlayer_with_next-i18next.md +0 -1
- package/docs/it/intlayer_with_nextjs_14.md +28 -0
- package/docs/it/intlayer_with_nextjs_15.md +28 -0
- package/docs/it/intlayer_with_nextjs_16.md +28 -0
- package/docs/it/intlayer_with_nextjs_no_locale_path.md +1148 -0
- package/docs/it/plugins/sync-json.md +6 -2
- package/docs/ja/configuration.md +6 -1
- package/docs/ja/dictionary/content_file.md +3 -1
- package/docs/ja/intlayer_with_next-i18next.md +0 -1
- package/docs/ja/intlayer_with_nextjs_14.md +28 -0
- package/docs/ja/intlayer_with_nextjs_15.md +28 -0
- package/docs/ja/intlayer_with_nextjs_16.md +28 -0
- package/docs/ja/intlayer_with_nextjs_no_locale_path.md +1222 -0
- package/docs/ja/plugins/sync-json.md +6 -2
- package/docs/ko/configuration.md +6 -1
- package/docs/ko/dictionary/content_file.md +3 -1
- package/docs/ko/intlayer_with_next-i18next.md +0 -1
- package/docs/ko/intlayer_with_nextjs_14.md +28 -0
- package/docs/ko/intlayer_with_nextjs_15.md +28 -0
- package/docs/ko/intlayer_with_nextjs_16.md +28 -0
- package/docs/ko/intlayer_with_nextjs_no_locale_path.md +1205 -0
- package/docs/ko/plugins/sync-json.md +6 -2
- package/docs/pl/configuration.md +3 -1
- package/docs/pl/dictionary/content_file.md +3 -1
- package/docs/pl/intlayer_with_next-i18next.md +0 -1
- package/docs/pl/intlayer_with_nextjs_14.md +28 -0
- package/docs/pl/intlayer_with_nextjs_15.md +28 -0
- package/docs/pl/intlayer_with_nextjs_16.md +28 -0
- package/docs/pl/intlayer_with_nextjs_no_locale_path.md +1149 -0
- package/docs/pl/plugins/sync-json.md +6 -2
- package/docs/pt/configuration.md +6 -1
- package/docs/pt/dictionary/content_file.md +3 -1
- package/docs/pt/intlayer_with_next-i18next.md +0 -1
- package/docs/pt/intlayer_with_nextjs_14.md +28 -0
- package/docs/pt/intlayer_with_nextjs_15.md +28 -0
- package/docs/pt/intlayer_with_nextjs_16.md +28 -0
- package/docs/pt/intlayer_with_nextjs_no_locale_path.md +1152 -0
- package/docs/pt/plugins/sync-json.md +6 -2
- package/docs/ru/configuration.md +6 -1
- package/docs/ru/dictionary/content_file.md +6 -1
- package/docs/ru/intlayer_with_next-i18next.md +0 -1
- package/docs/ru/intlayer_with_nextjs_14.md +28 -0
- package/docs/ru/intlayer_with_nextjs_15.md +28 -0
- package/docs/ru/intlayer_with_nextjs_16.md +28 -0
- package/docs/ru/intlayer_with_nextjs_no_locale_path.md +1204 -0
- package/docs/ru/plugins/sync-json.md +6 -2
- package/docs/tr/configuration.md +6 -1
- package/docs/tr/dictionary/content_file.md +3 -1
- package/docs/tr/intlayer_with_next-i18next.md +0 -1
- package/docs/tr/intlayer_with_nextjs_14.md +28 -0
- package/docs/tr/intlayer_with_nextjs_15.md +28 -0
- package/docs/tr/intlayer_with_nextjs_16.md +28 -0
- package/docs/tr/intlayer_with_nextjs_no_locale_path.md +1159 -0
- package/docs/tr/plugins/sync-json.md +6 -2
- package/docs/uk/CI_CD.md +198 -0
- package/docs/uk/autoFill.md +307 -0
- package/docs/uk/bundle_optimization.md +185 -0
- package/docs/uk/cli/build.md +64 -0
- package/docs/uk/cli/ci.md +137 -0
- package/docs/uk/cli/configuration.md +63 -0
- package/docs/uk/cli/debug.md +46 -0
- package/docs/uk/cli/doc-review.md +43 -0
- package/docs/uk/cli/doc-translate.md +132 -0
- package/docs/uk/cli/editor.md +28 -0
- package/docs/uk/cli/fill.md +130 -0
- package/docs/uk/cli/index.md +190 -0
- package/docs/uk/cli/init.md +84 -0
- package/docs/uk/cli/list.md +90 -0
- package/docs/uk/cli/list_projects.md +128 -0
- package/docs/uk/cli/live.md +41 -0
- package/docs/uk/cli/login.md +157 -0
- package/docs/uk/cli/pull.md +78 -0
- package/docs/uk/cli/push.md +98 -0
- package/docs/uk/cli/sdk.md +71 -0
- package/docs/uk/cli/test.md +76 -0
- package/docs/uk/cli/transform.md +65 -0
- package/docs/uk/cli/version.md +24 -0
- package/docs/uk/cli/watch.md +37 -0
- package/docs/uk/compiler.md +133 -0
- package/docs/uk/component_i18n.md +194 -0
- package/docs/uk/configuration.md +742 -0
- package/docs/uk/dictionary/condition.md +237 -0
- package/docs/uk/dictionary/content_file.md +1134 -0
- package/docs/uk/dictionary/enumeration.md +245 -0
- package/docs/uk/dictionary/file.md +232 -0
- package/docs/uk/dictionary/function_fetching.md +212 -0
- package/docs/uk/dictionary/gender.md +273 -0
- package/docs/uk/dictionary/insertion.md +187 -0
- package/docs/uk/dictionary/markdown.md +383 -0
- package/docs/uk/dictionary/nesting.md +273 -0
- package/docs/uk/dictionary/translation.md +332 -0
- package/docs/uk/formatters.md +595 -0
- package/docs/uk/how_works_intlayer.md +256 -0
- package/docs/uk/index.md +175 -0
- package/docs/uk/interest_of_intlayer.md +297 -0
- package/docs/uk/intlayer_CMS.md +569 -0
- package/docs/uk/intlayer_visual_editor.md +292 -0
- package/docs/uk/intlayer_with_angular.md +710 -0
- package/docs/uk/intlayer_with_astro.md +256 -0
- package/docs/uk/intlayer_with_create_react_app.md +1258 -0
- package/docs/uk/intlayer_with_express.md +429 -0
- package/docs/uk/intlayer_with_fastify.md +446 -0
- package/docs/uk/intlayer_with_lynx+react.md +548 -0
- package/docs/uk/intlayer_with_nestjs.md +283 -0
- package/docs/uk/intlayer_with_next-i18next.md +640 -0
- package/docs/uk/intlayer_with_next-intl.md +456 -0
- package/docs/uk/intlayer_with_nextjs_14.md +1646 -0
- package/docs/uk/intlayer_with_nextjs_15.md +1910 -0
- package/docs/uk/intlayer_with_nextjs_16.md +1763 -0
- package/docs/uk/intlayer_with_nextjs_no_locale_path.md +1159 -0
- package/docs/uk/intlayer_with_nextjs_page_router.md +1541 -0
- package/docs/uk/intlayer_with_nuxt.md +711 -0
- package/docs/uk/intlayer_with_react_native+expo.md +715 -0
- package/docs/uk/intlayer_with_react_router_v7.md +600 -0
- package/docs/uk/intlayer_with_react_router_v7_fs_routes.md +669 -0
- package/docs/uk/intlayer_with_svelte_kit.md +579 -0
- package/docs/uk/intlayer_with_tanstack.md +818 -0
- package/docs/uk/intlayer_with_vite+preact.md +1748 -0
- package/docs/uk/intlayer_with_vite+react.md +1449 -0
- package/docs/uk/intlayer_with_vite+solid.md +302 -0
- package/docs/uk/intlayer_with_vite+svelte.md +520 -0
- package/docs/uk/intlayer_with_vite+vue.md +1113 -0
- package/docs/uk/introduction.md +222 -0
- package/docs/uk/locale_mapper.md +242 -0
- package/docs/uk/mcp_server.md +211 -0
- package/docs/uk/packages/express-intlayer/t.md +465 -0
- package/docs/uk/packages/intlayer/getConfiguration.md +145 -0
- package/docs/uk/packages/intlayer/getEnumeration.md +159 -0
- package/docs/uk/packages/intlayer/getHTMLTextDir.md +121 -0
- package/docs/uk/packages/intlayer/getLocaleLang.md +81 -0
- package/docs/uk/packages/intlayer/getLocaleName.md +135 -0
- package/docs/uk/packages/intlayer/getLocalizedUrl.md +338 -0
- package/docs/uk/packages/intlayer/getMultilingualUrls.md +359 -0
- package/docs/uk/packages/intlayer/getPathWithoutLocale.md +75 -0
- package/docs/uk/packages/intlayer/getPrefix.md +213 -0
- package/docs/uk/packages/intlayer/getTranslation.md +190 -0
- package/docs/uk/packages/intlayer/getTranslationContent.md +189 -0
- package/docs/uk/packages/next-intlayer/t.md +365 -0
- package/docs/uk/packages/next-intlayer/useDictionary.md +276 -0
- package/docs/uk/packages/next-intlayer/useIntlayer.md +263 -0
- package/docs/uk/packages/next-intlayer/useLocale.md +166 -0
- package/docs/uk/packages/react-intlayer/t.md +311 -0
- package/docs/uk/packages/react-intlayer/useDictionary.md +295 -0
- package/docs/uk/packages/react-intlayer/useI18n.md +250 -0
- package/docs/uk/packages/react-intlayer/useIntlayer.md +251 -0
- package/docs/uk/packages/react-intlayer/useLocale.md +210 -0
- package/docs/uk/per_locale_file.md +345 -0
- package/docs/uk/plugins/sync-json.md +398 -0
- package/docs/uk/readme.md +265 -0
- package/docs/uk/releases/v6.md +305 -0
- package/docs/uk/releases/v7.md +624 -0
- package/docs/uk/roadmap.md +346 -0
- package/docs/uk/testing.md +204 -0
- package/docs/uk/vs_code_extension.md +133 -0
- package/docs/vi/configuration.md +6 -1
- package/docs/vi/dictionary/content_file.md +6 -1
- package/docs/vi/intlayer_with_next-i18next.md +0 -1
- package/docs/vi/intlayer_with_nextjs_14.md +28 -0
- package/docs/vi/intlayer_with_nextjs_15.md +28 -0
- package/docs/vi/intlayer_with_nextjs_16.md +28 -0
- package/docs/vi/intlayer_with_nextjs_no_locale_path.md +1151 -0
- package/docs/vi/plugins/sync-json.md +6 -2
- package/docs/zh/configuration.md +6 -1
- package/docs/zh/dictionary/content_file.md +6 -1
- package/docs/zh/intlayer_with_next-i18next.md +0 -1
- package/docs/zh/intlayer_with_nextjs_14.md +28 -0
- package/docs/zh/intlayer_with_nextjs_15.md +28 -0
- package/docs/zh/intlayer_with_nextjs_16.md +28 -0
- package/docs/zh/intlayer_with_nextjs_no_locale_path.md +1206 -0
- package/docs/zh/plugins/sync-json.md +9 -5
- package/frequent_questions/ar/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/ar/error-vite-env-only.md +77 -0
- package/frequent_questions/de/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/de/error-vite-env-only.md +77 -0
- package/frequent_questions/en/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/en/error-vite-env-only.md +77 -0
- package/frequent_questions/en-GB/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/en-GB/error-vite-env-only.md +77 -0
- package/frequent_questions/es/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/es/error-vite-env-only.md +76 -0
- package/frequent_questions/fr/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/fr/error-vite-env-only.md +77 -0
- package/frequent_questions/hi/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/hi/error-vite-env-only.md +77 -0
- package/frequent_questions/id/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/id/error-vite-env-only.md +77 -0
- package/frequent_questions/it/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/it/error-vite-env-only.md +77 -0
- package/frequent_questions/ja/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/ja/error-vite-env-only.md +77 -0
- package/frequent_questions/ko/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/ko/error-vite-env-only.md +77 -0
- package/frequent_questions/pl/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/pl/error-vite-env-only.md +77 -0
- package/frequent_questions/pt/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/pt/error-vite-env-only.md +77 -0
- package/frequent_questions/ru/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/ru/error-vite-env-only.md +77 -0
- package/frequent_questions/tr/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/tr/error-vite-env-only.md +77 -0
- package/frequent_questions/uk/SSR_Next_no_[locale].md +104 -0
- package/frequent_questions/uk/array_as_content_declaration.md +72 -0
- package/frequent_questions/uk/build_dictionaries.md +58 -0
- package/frequent_questions/uk/build_error_CI_CD.md +74 -0
- package/frequent_questions/uk/bun_set_up.md +53 -0
- package/frequent_questions/uk/customized_locale_list.md +64 -0
- package/frequent_questions/uk/domain_routing.md +113 -0
- package/frequent_questions/uk/error-vite-env-only.md +77 -0
- package/frequent_questions/uk/esbuild_error.md +29 -0
- package/frequent_questions/uk/get_locale_cookie.md +142 -0
- package/frequent_questions/uk/intlayer_command_undefined.md +155 -0
- package/frequent_questions/uk/locale_incorect_in_url.md +73 -0
- package/frequent_questions/uk/package_version_error.md +181 -0
- package/frequent_questions/uk/static_rendering.md +44 -0
- package/frequent_questions/uk/translated_path_url.md +55 -0
- package/frequent_questions/uk/unknown_command.md +97 -0
- package/frequent_questions/vi/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/vi/error-vite-env-only.md +77 -0
- package/frequent_questions/zh/SSR_Next_no_[locale].md +1 -1
- package/frequent_questions/zh/error-vite-env-only.md +77 -0
- package/legal/uk/privacy_notice.md +83 -0
- package/legal/uk/terms_of_service.md +55 -0
- package/package.json +6 -6
- package/src/generated/blog.entry.ts +29 -0
- package/src/generated/docs.entry.ts +119 -0
- package/src/generated/frequentQuestions.entry.ts +35 -0
- package/src/generated/legal.entry.ts +2 -0
|
@@ -0,0 +1,715 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-06-18
|
|
3
|
+
updatedAt: 2025-12-30
|
|
4
|
+
title: Як перекласти ваш додаток React Native та Expo — посібник з i18n 2026
|
|
5
|
+
description: Дізнайтеся, як зробити ваш вебсайт на React Native та Expo багатомовним. Дотримуйтесь документації, щоб інтернаціоналізувати (i18n) та перекласти його.
|
|
6
|
+
keywords:
|
|
7
|
+
- Інтернаціоналізація
|
|
8
|
+
- Документація
|
|
9
|
+
- Intlayer
|
|
10
|
+
- React Native
|
|
11
|
+
- Expo
|
|
12
|
+
- JavaScript
|
|
13
|
+
slugs:
|
|
14
|
+
- doc
|
|
15
|
+
- environment
|
|
16
|
+
- react-native-and-expo
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-react-native-template
|
|
18
|
+
history:
|
|
19
|
+
- version: 7.5.9
|
|
20
|
+
date: 2025-12-30
|
|
21
|
+
changes: Додано команду init
|
|
22
|
+
- version: 6.1.6
|
|
23
|
+
date: 2025-10-02
|
|
24
|
+
changes: Додано розділ debug
|
|
25
|
+
- version: 5.5.10
|
|
26
|
+
date: 2025-06-29
|
|
27
|
+
changes: Ініціалізація історії
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
# Перекладіть ваш додаток React Native та Expo за допомогою Intlayer | Інтернаціоналізація (i18n)
|
|
31
|
+
|
|
32
|
+
## Зміст
|
|
33
|
+
|
|
34
|
+
<TOC/>
|
|
35
|
+
|
|
36
|
+
## Що таке Intlayer?
|
|
37
|
+
|
|
38
|
+
**Intlayer** — це **інноваційна, відкрита бібліотека для інтернаціоналізації (i18n)**, яка спрощує підтримку кількох мов у сучасних додатках. Вона працює у багатьох JavaScript/TypeScript середовищах, **включно з React Native** (через пакет `react-intlayer`).
|
|
39
|
+
|
|
40
|
+
За допомогою Intlayer ви можете:
|
|
41
|
+
|
|
42
|
+
- **Легко керувати перекладами** за допомогою декларативних словників на рівні компонентів.
|
|
43
|
+
- **Забезпечити підтримку TypeScript** з автогенерованими типами.
|
|
44
|
+
- **Динамічно локалізувати** контент, включно з текстами інтерфейсу (а в React для web — також HTML-метадані тощо).
|
|
45
|
+
- **Отримати переваги розширених можливостей**, таких як динамічне визначення локалі та її перемикання.
|
|
46
|
+
|
|
47
|
+
///
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Крок 1: Встановіть залежності
|
|
52
|
+
|
|
53
|
+
<iframe
|
|
54
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-react-native-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
55
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
56
|
+
title="Демо CodeSandbox — як інтернаціоналізувати ваш застосунок за допомогою Intlayer"
|
|
57
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
58
|
+
loading="lazy"
|
|
59
|
+
/>
|
|
60
|
+
|
|
61
|
+
Перегляньте [шаблон застосунку](https://github.com/aymericzip/intlayer-react-native-template) на GitHub.
|
|
62
|
+
|
|
63
|
+
У вашому проекті React Native встановіть такі пакети:
|
|
64
|
+
|
|
65
|
+
```bash packageManager="npm"
|
|
66
|
+
npm install intlayer react-intlayer
|
|
67
|
+
npm install --save-dev react-native-intlayer
|
|
68
|
+
npx intlayer init
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```bash packageManager="pnpm"
|
|
72
|
+
pnpm add intlayer react-intlayer
|
|
73
|
+
pnpm add --save-dev react-native-intlayer
|
|
74
|
+
pnpm intlayer init
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```bash packageManager="yarn"
|
|
78
|
+
yarn add intlayer react-intlayer
|
|
79
|
+
yarn add --save-dev react-native-intlayer
|
|
80
|
+
yarn intlayer init
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```bash packageManager="bun"
|
|
84
|
+
bun add intlayer react-intlayer
|
|
85
|
+
bun add --dev react-native-intlayer
|
|
86
|
+
bunx intlayer init
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Пакети
|
|
90
|
+
|
|
91
|
+
- **intlayer**
|
|
92
|
+
Основний i18n-набір інструментів для конфігурації, вмісту словників, генерації типів та команд CLI.
|
|
93
|
+
|
|
94
|
+
- **react-intlayer**
|
|
95
|
+
Інтеграція для React, яка надає провайдери контексту та React hooks, які ви використовуватимете в React Native для отримання та перемикання локалей.
|
|
96
|
+
|
|
97
|
+
- **react-native-intlayer**
|
|
98
|
+
Інтеграція для React Native, яка забезпечує плагін Metro для інтеграції Intlayer з бандлером React Native.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Крок 2: Створіть конфігурацію Intlayer
|
|
103
|
+
|
|
104
|
+
У корені вашого проєкту (або в будь-якому зручному місці) створіть файл **Intlayer config**. Він може виглядати так:
|
|
105
|
+
|
|
106
|
+
```ts fileName="intlayer.config.ts" codeFormat="typescript"
|
|
107
|
+
/**
|
|
108
|
+
* Якщо типи Locales недоступні, спробуйте встановити moduleResolution у "bundler" у вашому tsconfig.json
|
|
109
|
+
*/
|
|
110
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
111
|
+
|
|
112
|
+
const config: IntlayerConfig = {
|
|
113
|
+
internationalization: {
|
|
114
|
+
locales: [
|
|
115
|
+
Locales.ENGLISH,
|
|
116
|
+
Locales.FRENCH,
|
|
117
|
+
Locales.SPANISH,
|
|
118
|
+
// ... Додайте будь-які інші локалі, які вам потрібні
|
|
119
|
+
],
|
|
120
|
+
defaultLocale: Locales.ENGLISH,
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export default config;
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```js fileName="intlayer.config.mjs" codeFormat="esm"
|
|
128
|
+
import { Locales } from "intlayer";
|
|
129
|
+
|
|
130
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
131
|
+
const config = {
|
|
132
|
+
internationalization: {
|
|
133
|
+
locales: [
|
|
134
|
+
Locales.ENGLISH,
|
|
135
|
+
Locales.FRENCH,
|
|
136
|
+
Locales.SPANISH,
|
|
137
|
+
// ... Додайте будь-які інші локалі, які вам потрібні
|
|
138
|
+
],
|
|
139
|
+
defaultLocale: Locales.ENGLISH,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export default config;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
```js fileName="intlayer.config.js" codeFormat="commonjs"
|
|
147
|
+
const { Locales } = require("intlayer");
|
|
148
|
+
|
|
149
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
150
|
+
const config = {
|
|
151
|
+
internationalization: {
|
|
152
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
153
|
+
defaultLocale: Locales.ENGLISH,
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
module.exports = config;
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
У цій конфігурації ви можете:
|
|
161
|
+
|
|
162
|
+
- Налаштувати ваш **список підтримуваних локалей**.
|
|
163
|
+
- Встановіть локаль за **замовчуванням**.
|
|
164
|
+
- Пізніше ви зможете додати більш просунуті опції (наприклад, логи, користувацькі директорії контенту тощо).
|
|
165
|
+
- Див. [документацію конфігурації Intlayer](https://github.com/aymericzip/intlayer/blob/main/docs/docs/uk/configuration.md) для детальнішої інформації.
|
|
166
|
+
|
|
167
|
+
## Крок 3: Додайте плагін Metro
|
|
168
|
+
|
|
169
|
+
Metro — це бандлер для React Native. Він є бандлером за замовчуванням для проєктів React Native, створених за допомогою команди `react-native init`. Щоб використовувати Intlayer з Metro, потрібно додати плагін у файл `metro.config.js`:
|
|
170
|
+
|
|
171
|
+
```js fileName="metro.config.js"
|
|
172
|
+
const { getDefaultConfig } = require("expo/metro-config");
|
|
173
|
+
const { configMetroIntlayer } = require("react-native-intlayer/metro");
|
|
174
|
+
|
|
175
|
+
module.exports = (async () => {
|
|
176
|
+
const defaultConfig = getDefaultConfig(__dirname);
|
|
177
|
+
|
|
178
|
+
return await configMetroIntlayer(defaultConfig);
|
|
179
|
+
})();
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
> Примітка: `configMetroIntlayer` — це функція, яка повертає проміс. Використовуйте `configMetroIntlayerSync`, якщо хочете виконувати це синхронно, або уникайте IFFE (Immediately Invoked Function Expression).
|
|
183
|
+
> Примітка: `configMetroIntlayerSync` не дозволяє будувати словники intlayer під час запуску сервера
|
|
184
|
+
|
|
185
|
+
## Крок 4: Додайте провайдер Intlayer
|
|
186
|
+
|
|
187
|
+
Щоб синхронізувати мову користувача по всьому застосунку, потрібно обгорнути кореневий компонент компонентом `IntlayerProvider` з `react-intlayer-native`.
|
|
188
|
+
|
|
189
|
+
> Переконайтеся, що використовуєте провайдер з `react-native-intlayer`, а не з `react-intlayer`. Експорт з `react-native-intlayer` включає поліфіли для Web API.
|
|
190
|
+
|
|
191
|
+
Також потрібно додати функцію `intlayerPolyfill` у ваш файл `index.js`, щоб забезпечити правильну роботу Intlayer.
|
|
192
|
+
|
|
193
|
+
```tsx fileName="app/_layout.tsx" codeFormat="typescript"
|
|
194
|
+
import { Stack } from "expo-router";
|
|
195
|
+
import { getLocales } from "expo-localization";
|
|
196
|
+
import { IntlayerProvider } from "react-native-intlayer";
|
|
197
|
+
import { type FC } from "react";
|
|
198
|
+
|
|
199
|
+
const getDeviceLocale = () => getLocales()[0]?.languageTag;
|
|
200
|
+
|
|
201
|
+
const RootLayout: FC = () => {
|
|
202
|
+
return (
|
|
203
|
+
<IntlayerProvider defaultLocale={getDeviceLocale()}>
|
|
204
|
+
<Stack>
|
|
205
|
+
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
206
|
+
</Stack>
|
|
207
|
+
</IntlayerProvider>
|
|
208
|
+
);
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
export default RootLayout;
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
```jsx fileName="app/_layout.mjx" codeFormat="esm"
|
|
215
|
+
import { Stack } from "expo-router";
|
|
216
|
+
import { getLocales } from "expo-localization";
|
|
217
|
+
import { IntlayerProvider } from "react-native-intlayer";
|
|
218
|
+
|
|
219
|
+
const getDeviceLocale = () => getLocales()[0]?.languageTag;
|
|
220
|
+
|
|
221
|
+
const RootLayout = () => {
|
|
222
|
+
return (
|
|
223
|
+
<IntlayerProvider defaultLocale={getDeviceLocale()}>
|
|
224
|
+
<Stack>
|
|
225
|
+
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
226
|
+
</Stack>
|
|
227
|
+
</IntlayerProvider>
|
|
228
|
+
);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export default RootLayout;
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
```jsx fileName="app/_layout.cjx" codeFormat="commonjs"
|
|
235
|
+
const { Stack } = require("expo-router");
|
|
236
|
+
const { getLocales } = require("expo-localization");
|
|
237
|
+
const { IntlayerProvider } = require("react-native-intlayer");
|
|
238
|
+
|
|
239
|
+
const getDeviceLocale = () => getLocales()[0]?.languageTag;
|
|
240
|
+
|
|
241
|
+
const RootLayout = () => {
|
|
242
|
+
return (
|
|
243
|
+
<IntlayerProvider defaultLocale={getDeviceLocale()}>
|
|
244
|
+
<Stack>
|
|
245
|
+
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
246
|
+
</Stack>
|
|
247
|
+
</IntlayerProvider>
|
|
248
|
+
);
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
module.exports = RootLayout;
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## Крок 5: Оголосіть свій контент
|
|
255
|
+
|
|
256
|
+
Створіть файли **декларації контенту** у будь-якому місці вашого проєкту (зазвичай у `src/`), використовуючи будь-який з форматів розширень, які підтримує Intlayer:
|
|
257
|
+
|
|
258
|
+
- `.content.json`
|
|
259
|
+
- `.content.ts`
|
|
260
|
+
- `.content.tsx`
|
|
261
|
+
- `.content.js`
|
|
262
|
+
- `.content.jsx`
|
|
263
|
+
- `.content.mjs`
|
|
264
|
+
- `.content.mjx`
|
|
265
|
+
- `.content.cjs`
|
|
266
|
+
- `.content.cjx`
|
|
267
|
+
- тощо.
|
|
268
|
+
|
|
269
|
+
Приклад (TypeScript із TSX-нодами для React Native):
|
|
270
|
+
|
|
271
|
+
```tsx fileName="src/app.content.tsx" contentDeclarationFormat="typescript"
|
|
272
|
+
import { t, type Dictionary } from "intlayer";
|
|
273
|
+
import type { ReactNode } from "react";
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Словник контенту для нашого домену "app"
|
|
277
|
+
*/
|
|
278
|
+
import { t, type Dictionary } from "intlayer";
|
|
279
|
+
|
|
280
|
+
const homeScreenContent = {
|
|
281
|
+
key: "home-screen",
|
|
282
|
+
content: {
|
|
283
|
+
title: t({
|
|
284
|
+
uk: "Ласкаво просимо!",
|
|
285
|
+
en: "Welcome!",
|
|
286
|
+
fr: "Bienvenue!",
|
|
287
|
+
es: "¡Bienvenido!",
|
|
288
|
+
}),
|
|
289
|
+
},
|
|
290
|
+
} satisfies Dictionary;
|
|
291
|
+
|
|
292
|
+
export default homeScreenContent;
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
```jsx fileName="src/app.content.mjx" contentDeclarationFormat="esm"
|
|
296
|
+
import { t } from "intlayer";
|
|
297
|
+
import { ReactNode } from "react";
|
|
298
|
+
|
|
299
|
+
/** @type {import('intlayer').Dictionary} */
|
|
300
|
+
const appContent = {
|
|
301
|
+
key: "home-screen",
|
|
302
|
+
content: {
|
|
303
|
+
title: t({
|
|
304
|
+
uk: "Ласкаво просимо!",
|
|
305
|
+
en: "Welcome!",
|
|
306
|
+
fr: "Bienvenue!",
|
|
307
|
+
es: "¡Bienvenido!",
|
|
308
|
+
}),
|
|
309
|
+
},
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export default appContent;
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
```jsx fileName="src/app.content.csx" contentDeclarationFormat="commonjs"
|
|
316
|
+
const { t } = require("intlayer");
|
|
317
|
+
|
|
318
|
+
/** @type {import('intlayer').Dictionary} */
|
|
319
|
+
const appContent = {
|
|
320
|
+
key: "home-screen",
|
|
321
|
+
content: {
|
|
322
|
+
title: t({
|
|
323
|
+
uk: "Ласкаво просимо!",
|
|
324
|
+
en: "Welcome!",
|
|
325
|
+
fr: "Bienvenue!",
|
|
326
|
+
es: "¡Bienvenido!",
|
|
327
|
+
}),
|
|
328
|
+
},
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
module.exports = appContent;
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
```json fileName="src/app.content.json" contentDeclarationFormat="json"
|
|
335
|
+
{
|
|
336
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
337
|
+
"key": "app",
|
|
338
|
+
"content": {
|
|
339
|
+
"title": {
|
|
340
|
+
"nodeType": "translation",
|
|
341
|
+
"translation": {
|
|
342
|
+
"uk": "Ласкаво просимо!",
|
|
343
|
+
"en": "Welcome!",
|
|
344
|
+
"fr": "Bienvenue!",
|
|
345
|
+
"es": "¡Bienvenido!"
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
> Для детальної інформації про декларації контенту див. [документацію Intlayer щодо контенту](https://github.com/aymericzip/intlayer/blob/main/docs/docs/uk/dictionary/content_file.md).
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## Крок 4: Використання Intlayer у ваших компонентах
|
|
357
|
+
|
|
358
|
+
Використовуйте хук `useIntlayer` у дочірніх компонентах, щоб отримувати локалізований контент.
|
|
359
|
+
|
|
360
|
+
### Приклад
|
|
361
|
+
|
|
362
|
+
```tsx fileName="app/(tabs)/index.tsx" codeFormat="typescript"
|
|
363
|
+
import { Image, StyleSheet, Platform } from "react-native";
|
|
364
|
+
import { useIntlayer } from "react-intlayer";
|
|
365
|
+
import { HelloWave } from "@/components/HelloWave";
|
|
366
|
+
import ParallaxScrollView from "@/components/ParallaxScrollView";
|
|
367
|
+
import { ThemedText } from "@/components/ThemedText";
|
|
368
|
+
import { ThemedView } from "@/components/ThemedView";
|
|
369
|
+
import { type FC } from "react";
|
|
370
|
+
|
|
371
|
+
const HomeScreen = (): FC => {
|
|
372
|
+
const { title, steps } = useIntlayer("home-screen");
|
|
373
|
+
|
|
374
|
+
return (
|
|
375
|
+
<ParallaxScrollView
|
|
376
|
+
headerBackgroundColor={{ light: "#A1CEDC", dark: "#1D3D47" }}
|
|
377
|
+
headerImage={
|
|
378
|
+
<Image
|
|
379
|
+
source={require("@/assets/images/partial-react-logo.png")}
|
|
380
|
+
style={styles.reactLogo}
|
|
381
|
+
/>
|
|
382
|
+
}
|
|
383
|
+
>
|
|
384
|
+
<ThemedView style={styles.titleContainer}>
|
|
385
|
+
<ThemedText type="title">{title}</ThemedText>
|
|
386
|
+
<HelloWave />
|
|
387
|
+
</ThemedView>
|
|
388
|
+
</ParallaxScrollView>
|
|
389
|
+
);
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
const styles = StyleSheet.create({
|
|
393
|
+
titleContainer: {
|
|
394
|
+
flexDirection: "row",
|
|
395
|
+
alignItems: "center",
|
|
396
|
+
gap: 8,
|
|
397
|
+
},
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
export default HomeScreen;
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
```jsx fileName="app/(tabs)/index.content.msx" codeFormat="esm"
|
|
404
|
+
import { Image, StyleSheet, Platform } from "react-native";
|
|
405
|
+
import { useIntlayer } from "react-intlayer";
|
|
406
|
+
import { HelloWave } from "@/components/HelloWave";
|
|
407
|
+
import ParallaxScrollView from "@/components/ParallaxScrollView";
|
|
408
|
+
import { ThemedText } from "@/components/ThemedText";
|
|
409
|
+
import { ThemedView } from "@/components/ThemedView";
|
|
410
|
+
|
|
411
|
+
const HomeScreen = () => {
|
|
412
|
+
const { title, steps } = useIntlayer("home-screen");
|
|
413
|
+
|
|
414
|
+
return (
|
|
415
|
+
<ParallaxScrollView
|
|
416
|
+
headerBackgroundColor={{ light: "#A1CEDC", dark: "#1D3D47" }}
|
|
417
|
+
headerImage={
|
|
418
|
+
<Image
|
|
419
|
+
source={require("@/assets/images/partial-react-logo.png")}
|
|
420
|
+
style={styles.reactLogo}
|
|
421
|
+
/>
|
|
422
|
+
}
|
|
423
|
+
>
|
|
424
|
+
<ThemedView style={styles.titleContainer}>
|
|
425
|
+
<ThemedText type="title">{title}</ThemedText>
|
|
426
|
+
<HelloWave />
|
|
427
|
+
</ThemedView>
|
|
428
|
+
</ParallaxScrollView>
|
|
429
|
+
);
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
const styles = StyleSheet.create({
|
|
433
|
+
titleContainer: {
|
|
434
|
+
flexDirection: "row",
|
|
435
|
+
alignItems: "center",
|
|
436
|
+
gap: 8,
|
|
437
|
+
},
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
export default HomeScreen;
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
```jsx fileName="app/(tabs)/index.content.csx" codeFormat="commonjs"
|
|
444
|
+
const { Image, StyleSheet, Platform } = require("react-native");
|
|
445
|
+
const { useIntlayer } = require("react-intlayer");
|
|
446
|
+
const { HelloWave } = require("@/components/HelloWave");
|
|
447
|
+
const ParallaxScrollView = require("@/components/ParallaxScrollView");
|
|
448
|
+
const { ThemedText } = require("@/components/ThemedText");
|
|
449
|
+
const { ThemedView } = require("@/components/ThemedView");
|
|
450
|
+
|
|
451
|
+
const HomeScreen = () => {
|
|
452
|
+
const { title, steps } = useIntlayer("home-screen");
|
|
453
|
+
|
|
454
|
+
return (
|
|
455
|
+
<ParallaxScrollView
|
|
456
|
+
headerBackgroundColor={{ light: "#A1CEDC", dark: "#1D3D47" }}
|
|
457
|
+
headerImage={
|
|
458
|
+
<Image
|
|
459
|
+
source={require("@/assets/images/partial-react-logo.png")}
|
|
460
|
+
style={styles.reactLogo}
|
|
461
|
+
/>
|
|
462
|
+
}
|
|
463
|
+
>
|
|
464
|
+
<ThemedView style={styles.titleContainer}>
|
|
465
|
+
<ThemedText type="title">{title}</ThemedText>
|
|
466
|
+
<HelloWave />
|
|
467
|
+
</ThemedView>
|
|
468
|
+
</ParallaxScrollView>
|
|
469
|
+
);
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
const styles = StyleSheet.create({
|
|
473
|
+
titleContainer: {
|
|
474
|
+
flexDirection: "row",
|
|
475
|
+
alignItems: "center",
|
|
476
|
+
gap: 8,
|
|
477
|
+
},
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
module.exports = HomeScreen;
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
> Коли ви використовуєте `content.someKey` у властивостях, які очікують рядок (наприклад, `title` кнопки або `children` компонента `Text`), **викликайте `content.someKey.value`**, щоб отримати фактичний рядок.
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
## (Необов'язково) Крок 5: Змінити локаль додатку
|
|
488
|
+
|
|
489
|
+
Щоб перемикати локалі зсередини ваших компонентів, ви можете використовувати метод `setLocale` хука `useLocale`:
|
|
490
|
+
|
|
491
|
+
```tsx fileName="src/components/LocaleSwitcher.tsx" codeFormat="typescript"
|
|
492
|
+
import { type FC } from "react";
|
|
493
|
+
import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
|
|
494
|
+
import { getLocaleName } from "intlayer";
|
|
495
|
+
import { useLocale } from "react-intlayer";
|
|
496
|
+
|
|
497
|
+
export const LocaleSwitcher: FC = () => {
|
|
498
|
+
const { setLocale, availableLocales } = useLocale();
|
|
499
|
+
|
|
500
|
+
return (
|
|
501
|
+
<View style={styles.container}>
|
|
502
|
+
{availableLocales.map((locale) => (
|
|
503
|
+
<TouchableOpacity
|
|
504
|
+
key={locale}
|
|
505
|
+
style={styles.button}
|
|
506
|
+
onPress={() => setLocale(locale)}
|
|
507
|
+
>
|
|
508
|
+
<Text style={styles.text}>{getLocaleName(locale)}</Text>
|
|
509
|
+
</TouchableOpacity>
|
|
510
|
+
))}
|
|
511
|
+
</View>
|
|
512
|
+
);
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
const styles = StyleSheet.create({
|
|
516
|
+
container: {
|
|
517
|
+
flexDirection: "row",
|
|
518
|
+
justifyContent: "center",
|
|
519
|
+
alignItems: "center",
|
|
520
|
+
gap: 8,
|
|
521
|
+
},
|
|
522
|
+
button: {
|
|
523
|
+
paddingVertical: 6,
|
|
524
|
+
paddingHorizontal: 12,
|
|
525
|
+
borderRadius: 6,
|
|
526
|
+
backgroundColor: "#ddd",
|
|
527
|
+
},
|
|
528
|
+
text: {
|
|
529
|
+
fontSize: 14,
|
|
530
|
+
fontWeight: "500",
|
|
531
|
+
color: "#333",
|
|
532
|
+
},
|
|
533
|
+
});
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
```jsx fileName="src/components/LocaleSwitcher.msx" codeFormat="esm"
|
|
537
|
+
import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
|
|
538
|
+
import { getLocaleName } from "intlayer";
|
|
539
|
+
import { useLocale } from "react-intlayer";
|
|
540
|
+
|
|
541
|
+
export const LocaleSwitcher = () => {
|
|
542
|
+
const { setLocale, availableLocales } = useLocale();
|
|
543
|
+
|
|
544
|
+
return (
|
|
545
|
+
<View style={styles.container}>
|
|
546
|
+
{availableLocales.map((locale) => (
|
|
547
|
+
<TouchableOpacity
|
|
548
|
+
key={locale}
|
|
549
|
+
style={styles.button}
|
|
550
|
+
onPress={() => setLocale(locale)}
|
|
551
|
+
>
|
|
552
|
+
<Text style={styles.text}>{getLocaleName(locale)}</Text>
|
|
553
|
+
</TouchableOpacity>
|
|
554
|
+
))}
|
|
555
|
+
</View>
|
|
556
|
+
);
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
const styles = StyleSheet.create({
|
|
560
|
+
container: {
|
|
561
|
+
flexDirection: "row",
|
|
562
|
+
justifyContent: "center",
|
|
563
|
+
alignItems: "center",
|
|
564
|
+
gap: 8,
|
|
565
|
+
},
|
|
566
|
+
button: {
|
|
567
|
+
paddingVertical: 6,
|
|
568
|
+
paddingHorizontal: 12,
|
|
569
|
+
borderRadius: 6,
|
|
570
|
+
backgroundColor: "#ddd",
|
|
571
|
+
},
|
|
572
|
+
text: {
|
|
573
|
+
fontSize: 14,
|
|
574
|
+
fontWeight: "500",
|
|
575
|
+
color: "#333",
|
|
576
|
+
},
|
|
577
|
+
});
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
```jsx fileName="src/components/LocaleSwitcher.csx" codeFormat="commonjs"
|
|
581
|
+
const { View, Text, TouchableOpacity, StyleSheet } = require("react-native");
|
|
582
|
+
const { getLocaleName } = require("intlayer");
|
|
583
|
+
const { useLocale } = require("react-intlayer");
|
|
584
|
+
|
|
585
|
+
const LocaleSwitcher = () => {
|
|
586
|
+
const { setLocale, availableLocales } = useLocale();
|
|
587
|
+
|
|
588
|
+
return (
|
|
589
|
+
<View style={styles.container}>
|
|
590
|
+
{availableLocales.map((locale) => (
|
|
591
|
+
<TouchableOpacity
|
|
592
|
+
key={locale}
|
|
593
|
+
style={styles.button}
|
|
594
|
+
onPress={() => setLocale(locale)}
|
|
595
|
+
>
|
|
596
|
+
<Text style={styles.text}>{getLocaleName(locale)}</Text>
|
|
597
|
+
</TouchableOpacity>
|
|
598
|
+
))}
|
|
599
|
+
</View>
|
|
600
|
+
);
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
const styles = StyleSheet.create({
|
|
604
|
+
container: {
|
|
605
|
+
flexDirection: "row",
|
|
606
|
+
justifyContent: "center",
|
|
607
|
+
alignItems: "center",
|
|
608
|
+
gap: 8,
|
|
609
|
+
},
|
|
610
|
+
button: {
|
|
611
|
+
paddingVertical: 6,
|
|
612
|
+
paddingHorizontal: 12,
|
|
613
|
+
borderRadius: 6,
|
|
614
|
+
backgroundColor: "#ddd",
|
|
615
|
+
},
|
|
616
|
+
text: {
|
|
617
|
+
fontSize: 14,
|
|
618
|
+
fontWeight: "500",
|
|
619
|
+
color: "#333",
|
|
620
|
+
},
|
|
621
|
+
});
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
Це спричиняє повторний рендер (re-render) усіх компонентів, що використовують контент Intlayer — тепер вони відображають переклади для нової локалі.
|
|
625
|
+
|
|
626
|
+
> Див. документацію по [`useLocale`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/uk/packages/react-intlayer/useLocale.md) для докладніших відомостей.
|
|
627
|
+
|
|
628
|
+
## Налаштування TypeScript (якщо ви використовуєте TypeScript)
|
|
629
|
+
|
|
630
|
+
Intlayer генерує визначення типів у прихованій теці (за замовчуванням `.intlayer`), щоб покращити автодоповнення та виявляти помилки перекладів:
|
|
631
|
+
|
|
632
|
+
```json5
|
|
633
|
+
// tsconfig.json
|
|
634
|
+
{
|
|
635
|
+
// ... ваша існуюча конфігурація TS
|
|
636
|
+
"include": [
|
|
637
|
+
"src", // ваш вихідний код
|
|
638
|
+
".intlayer/types/**/*.ts", // <-- переконайтеся, що згенеровані типи включені
|
|
639
|
+
// ... все інше, що ви вже включаєте
|
|
640
|
+
],
|
|
641
|
+
}
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
Це дозволяє такі можливості, як:
|
|
645
|
+
|
|
646
|
+
- **Autocompletion** для ключів вашого словника.
|
|
647
|
+
- **Type checking**, що попереджає, якщо ви звертаєтеся до неіснуючого ключа або є невідповідність типів.
|
|
648
|
+
|
|
649
|
+
---
|
|
650
|
+
|
|
651
|
+
## Git Configuration
|
|
652
|
+
|
|
653
|
+
Щоб уникнути коміту автоматично згенерованих Intlayer файлів, додайте наступне до вашого `.gitignore`:
|
|
654
|
+
|
|
655
|
+
```plaintext
|
|
656
|
+
# Ігнорувати файли, згенеровані Intlayer
|
|
657
|
+
.intlayer
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
---
|
|
661
|
+
|
|
662
|
+
### Розширення для VS Code
|
|
663
|
+
|
|
664
|
+
Щоб покращити досвід розробки з Intlayer, ви можете встановити офіційне **Intlayer VS Code Extension**.
|
|
665
|
+
|
|
666
|
+
[Встановити з VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
667
|
+
|
|
668
|
+
Це розширення надає:
|
|
669
|
+
|
|
670
|
+
- **Autocompletion** для ключів перекладу.
|
|
671
|
+
- **Real-time error detection** для відсутніх перекладів.
|
|
672
|
+
- **Inline previews** перекладеного вмісту.
|
|
673
|
+
- **Quick actions** для простого створення та оновлення перекладів.
|
|
674
|
+
|
|
675
|
+
Для детальнішого опису використання розширення зверніться до [документації Intlayer VS Code Extension](https://intlayer.org/doc/vs-code-extension).
|
|
676
|
+
|
|
677
|
+
---
|
|
678
|
+
|
|
679
|
+
## Додаткові ресурси
|
|
680
|
+
|
|
681
|
+
- **Visual Editor**: Використовуйте [Intlayer Visual Editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/uk/intlayer_visual_editor.md) для візуального керування перекладами.
|
|
682
|
+
- **CMS Integration**: Ви також можете винести та отримувати вміст вашого словника з [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/uk/intlayer_CMS.md).
|
|
683
|
+
- **CLI Commands**: Ознайомтеся з [Intlayer CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/uk/cli/index.md) для завдань, таких як **extracting translations** або **checking missing keys**.
|
|
684
|
+
|
|
685
|
+
Насолоджуйтесь створенням ваших додатків на **React Native** з повноцінною i18n за допомогою **Intlayer**!
|
|
686
|
+
|
|
687
|
+
---
|
|
688
|
+
|
|
689
|
+
### Налагодження
|
|
690
|
+
|
|
691
|
+
React Native може бути менш стабільним, ніж React для Web, тому приділяйте особливу увагу узгодженню версій.
|
|
692
|
+
|
|
693
|
+
Intlayer в першу чергу орієнтований на Web Intl API; на React Native потрібно підключити відповідні polyfills.
|
|
694
|
+
|
|
695
|
+
Контрольний список:
|
|
696
|
+
|
|
697
|
+
- Використовуйте останні версії `intlayer`, `react-intlayer` та `react-native-intlayer`.
|
|
698
|
+
- Увімкніть Intlayer polyfill.
|
|
699
|
+
- Якщо ви використовуєте `getLocaleName` або інші утиліти на базі Intl API, імпортуйте ці polyfills на ранньому етапі (наприклад, в `index.js` або `App.tsx`):
|
|
700
|
+
|
|
701
|
+
```ts
|
|
702
|
+
import "intl";
|
|
703
|
+
import "@formatjs/intl-getcanonicallocales/polyfill";
|
|
704
|
+
import "@formatjs/intl-locale/polyfill";
|
|
705
|
+
import "@formatjs/intl-pluralrules/polyfill";
|
|
706
|
+
import "@formatjs/intl-displaynames/polyfill";
|
|
707
|
+
import "@formatjs/intl-listformat/polyfill";
|
|
708
|
+
import "@formatjs/intl-numberformat/polyfill";
|
|
709
|
+
import "@formatjs/intl-relativetimeformat/polyfill";
|
|
710
|
+
import "@formatjs/intl-datetimeformat/polyfill";
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
- Перевірте вашу конфігурацію Metro (resolver aliases, asset plugins, `tsconfig` paths), якщо модулі не вдається розв'язати.
|
|
714
|
+
|
|
715
|
+
---
|