@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,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-08-23
|
|
3
|
+
updatedAt: 2025-08-23
|
|
4
|
+
title: Хук useLocale — документація | react-intlayer
|
|
5
|
+
description: Дивіться, як використовувати хук useLocale для пакета react-intlayer
|
|
6
|
+
keywords:
|
|
7
|
+
- useLocale
|
|
8
|
+
- dictionary
|
|
9
|
+
- key
|
|
10
|
+
- Intlayer
|
|
11
|
+
- Internationalization
|
|
12
|
+
- Документація
|
|
13
|
+
- Next.js
|
|
14
|
+
- JavaScript
|
|
15
|
+
- React
|
|
16
|
+
slugs:
|
|
17
|
+
- doc
|
|
18
|
+
- packages
|
|
19
|
+
- react-intlayer
|
|
20
|
+
- useLocale
|
|
21
|
+
history:
|
|
22
|
+
- version: 5.5.10
|
|
23
|
+
date: 2025-06-29
|
|
24
|
+
changes: Init history
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Інтеграція з React: документація хуку `useLocale`
|
|
28
|
+
|
|
29
|
+
У цьому розділі наведено детальну інформацію про хук `useLocale` з бібліотеки `react-intlayer`, призначений для керування локалізацією в React-застосунках.
|
|
30
|
+
|
|
31
|
+
## Імпорт хуку `useLocale` у React
|
|
32
|
+
|
|
33
|
+
Щоб інтегрувати хук `useLocale` у свій React-додаток, імпортуйте його з відповідного пакета:
|
|
34
|
+
|
|
35
|
+
```typescript codeFormat="typescript"
|
|
36
|
+
import { useLocale } from "react-intlayer"; // Використовується в React-компонентах для керування локаллю
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```javascript codeFormat="esm"
|
|
40
|
+
import { useLocale } from "react-intlayer"; // Використовується в React-компонентах для керування локаллю
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```javascript codeFormat="commonjs"
|
|
44
|
+
const { useLocale } = require("react-intlayer"); // Використовується в React-компонентах для керування локаллю
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Огляд
|
|
48
|
+
|
|
49
|
+
Хук `useLocale` пропонує простий спосіб отримувати доступ та змінювати налаштування локалі в React-компонентах. Він надає доступ до поточної локалі, локалі за замовчуванням, усіх доступних локалей та функцій для оновлення налаштувань локалі.
|
|
50
|
+
|
|
51
|
+
## Використання
|
|
52
|
+
|
|
53
|
+
Ось як ви можете використовувати хук `useLocale` у React-компоненті:
|
|
54
|
+
|
|
55
|
+
```tsx fileName="src/components/LocaleSwitcher.tsx" codeFormat="typescript"
|
|
56
|
+
import type { FC } from "react";
|
|
57
|
+
import { useLocale } from "react-intlayer";
|
|
58
|
+
|
|
59
|
+
const LocaleSwitcher: FC = () => {
|
|
60
|
+
const { locale, defaultLocale, availableLocales, setLocale } = useLocale();
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<div>
|
|
64
|
+
<h1>Current Locale: {locale}</h1>
|
|
65
|
+
<p>Default Locale: {defaultLocale}</p>
|
|
66
|
+
<select value={locale} onChange={(e) => setLocale(e.target.value)}>
|
|
67
|
+
{availableLocales.map((loc) => (
|
|
68
|
+
<option key={loc} value={loc}>
|
|
69
|
+
{loc}
|
|
70
|
+
</option>
|
|
71
|
+
))}
|
|
72
|
+
</select>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default LocaleSwitcher;
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```jsx fileName="src/components/LocaleSwitcher.mjx" codeFormat="esm"
|
|
81
|
+
import { useLocale } from "react-intlayer";
|
|
82
|
+
|
|
83
|
+
const LocaleSwitcher = () => {
|
|
84
|
+
const { locale, defaultLocale, availableLocales, setLocale } = useLocale();
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<div>
|
|
88
|
+
<h1>Поточна локаль: {locale}</h1>
|
|
89
|
+
<p>Локаль за замовчуванням: {defaultLocale}</p>
|
|
90
|
+
<select value={locale} onChange={(e) => setLocale(e.target.value)}>
|
|
91
|
+
{availableLocales.map((loc) => (
|
|
92
|
+
<option key={loc} value={loc}>
|
|
93
|
+
{loc}
|
|
94
|
+
</option>
|
|
95
|
+
))}
|
|
96
|
+
</select>
|
|
97
|
+
</div>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export default LocaleSwitcher;
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```jsx fileName="src/components/LocaleSwitcher.csx" codeFormat="commonjs"
|
|
105
|
+
const { useLocale } = require("react-intlayer");
|
|
106
|
+
|
|
107
|
+
const LocaleSwitcher = () => {
|
|
108
|
+
const { locale, defaultLocale, availableLocales, setLocale } = useLocale();
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<div>
|
|
112
|
+
<h1>Поточна локаль: {locale}</h1>
|
|
113
|
+
<p>Локаль за замовчуванням: {defaultLocale}</p>
|
|
114
|
+
<select value={locale} onChange={(e) => setLocale(e.target.value)}>
|
|
115
|
+
{availableLocales.map((loc) => (
|
|
116
|
+
<option key={loc} value={loc}>
|
|
117
|
+
{loc}
|
|
118
|
+
</option>
|
|
119
|
+
))}
|
|
120
|
+
</select>
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export default LocaleSwitcher;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Параметри та значення, що повертаються
|
|
129
|
+
|
|
130
|
+
Коли ви викликаєте хук `useLocale`, він повертає об'єкт, який містить такі властивості:
|
|
131
|
+
|
|
132
|
+
- **`locale`**: Поточна локаль, встановлена в контексті React.
|
|
133
|
+
- **`defaultLocale`**: Основна локаль, визначена в конфігурації.
|
|
134
|
+
- **`availableLocales`**: Список усіх доступних локалей, визначених у конфігурації.
|
|
135
|
+
/// **`setLocale`**: Функція для оновлення поточної локалі в контексті додатка.
|
|
136
|
+
|
|
137
|
+
## Приклад
|
|
138
|
+
|
|
139
|
+
У цьому прикладі показано компонент, який використовує хук `useLocale` для відображення перемикача локалі, що дозволяє користувачам динамічно змінювати локаль додатка:
|
|
140
|
+
|
|
141
|
+
```tsx fileName="src/components/LocaleSelector.tsx" codeFormat="typescript"
|
|
142
|
+
import type { FC } from "react";
|
|
143
|
+
import { useLocale } from "react-intlayer";
|
|
144
|
+
|
|
145
|
+
const LocaleSelector: FC = () => {
|
|
146
|
+
const { locale, setLocale, availableLocales } = useLocale();
|
|
147
|
+
|
|
148
|
+
const handleLocaleChange = (newLocale) => {
|
|
149
|
+
setLocale(newLocale);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<select value={locale} onChange={(e) => handleLocaleChange(e.target.value)}>
|
|
154
|
+
{availableLocales.map((locale) => (
|
|
155
|
+
<option key={locale} value={locale}>
|
|
156
|
+
{locale}
|
|
157
|
+
</option>
|
|
158
|
+
))}
|
|
159
|
+
</select>
|
|
160
|
+
);
|
|
161
|
+
};
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
```jsx fileName="src/components/LocaleSelector.mjx" codeFormat="esm"
|
|
165
|
+
import { useLocale } from "react-intlayer";
|
|
166
|
+
|
|
167
|
+
const LocaleSelector = () => {
|
|
168
|
+
const { locale, setLocale, availableLocales } = useLocale();
|
|
169
|
+
|
|
170
|
+
const handleLocaleChange = (newLocale) => {
|
|
171
|
+
setLocale(newLocale);
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
return (
|
|
175
|
+
<select value={locale} onChange={(e) => handleLocaleChange(e.target.value)}>
|
|
176
|
+
{availableLocales.map((locale) => (
|
|
177
|
+
<option key={locale} value={locale}>
|
|
178
|
+
{locale}
|
|
179
|
+
</option>
|
|
180
|
+
))}
|
|
181
|
+
</select>
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
```jsx fileName="src/components/LocaleSelector.csx" codeFormat="commonjs"
|
|
187
|
+
const { useLocale } = require("react-intlayer");
|
|
188
|
+
|
|
189
|
+
const LocaleSelector = () => {
|
|
190
|
+
const { locale, setLocale, availableLocales } = useLocale();
|
|
191
|
+
|
|
192
|
+
const handleLocaleChange = (newLocale) => {
|
|
193
|
+
setLocale(newLocale);
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
return (
|
|
197
|
+
<select value={locale} onChange={(e) => handleLocaleChange(e.target.value)}>
|
|
198
|
+
{availableLocales.map((locale) => (
|
|
199
|
+
<option key={locale} value={locale}>
|
|
200
|
+
{locale}
|
|
201
|
+
</option>
|
|
202
|
+
))}
|
|
203
|
+
</select>
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Висновок
|
|
209
|
+
|
|
210
|
+
Хук `useLocale` з `react-intlayer` — це необхідний інструмент для керування локалями у ваших React-застосунках, що надає функціональність, необхідну для ефективного адаптування застосунку до різних міжнародних аудиторій.
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-04-18
|
|
3
|
+
updatedAt: 2025-06-29
|
|
4
|
+
title: Оголошення декларації вмісту `Per-Locale` в Intlayer
|
|
5
|
+
description: Дізнайтеся, як оголошувати вміст за локалями в Intlayer. Ознайомтеся з документацією, щоб зрозуміти різні формати та сценарії використання.
|
|
6
|
+
keywords:
|
|
7
|
+
- Інтернаціоналізація
|
|
8
|
+
- Документація
|
|
9
|
+
- Intlayer
|
|
10
|
+
- Per-Locale
|
|
11
|
+
- TypeScript
|
|
12
|
+
- JavaScript
|
|
13
|
+
slugs:
|
|
14
|
+
- doc
|
|
15
|
+
- concept
|
|
16
|
+
- per-locale-file
|
|
17
|
+
history:
|
|
18
|
+
- version: 7.3.1
|
|
19
|
+
date: 2025-11-29
|
|
20
|
+
changes: Додано глобальну конфігурацію для файлів per-locale
|
|
21
|
+
- version: 5.5.10
|
|
22
|
+
date: 2025-06-29
|
|
23
|
+
changes: Ініціалізація історії
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
# Оголошення декларації вмісту `Per-Locale` в Intlayer
|
|
27
|
+
|
|
28
|
+
Intlayer підтримує два способи оголошення багатомовного вмісту:
|
|
29
|
+
|
|
30
|
+
- Один файл з усіма перекладами
|
|
31
|
+
- Окремий файл для кожної локалі (формат per-locale)
|
|
32
|
+
|
|
33
|
+
Ця гнучкість дає змогу:
|
|
34
|
+
|
|
35
|
+
- Легку міграцію з інших i18n-інструментів
|
|
36
|
+
- Підтримку автоматизованих робочих процесів перекладу
|
|
37
|
+
- Чітку організацію перекладів у окремі файли, специфічні для кожної локалі
|
|
38
|
+
|
|
39
|
+
## Формат Per-Locale
|
|
40
|
+
|
|
41
|
+
Цей формат корисний, коли:
|
|
42
|
+
|
|
43
|
+
- Ви хочете версіїувати або незалежно перевизначати переклади.
|
|
44
|
+
- Ви інтегруєте робочі процеси машинного або людського перекладу.
|
|
45
|
+
|
|
46
|
+
Ви також можете розділити переклади на окремі файли для кожної локалі, вказавши поле locale:
|
|
47
|
+
|
|
48
|
+
```tsx fileName="hello-world.en.content.ts" contentDeclarationFormat="typescript"
|
|
49
|
+
import { t, Locales, type Dictionary } from "intlayer";
|
|
50
|
+
|
|
51
|
+
const helloWorldContent = {
|
|
52
|
+
key: "hello-world",
|
|
53
|
+
locale: Locales.ENGLISH, // Важливо
|
|
54
|
+
content: { multilingualContent: "Title of my component" },
|
|
55
|
+
} satisfies Dictionary;
|
|
56
|
+
|
|
57
|
+
export default helloWorldContent;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```tsx fileName="hello-world.es.content.ts" contentDeclarationFormat="typescript"
|
|
61
|
+
import { t, Locales, type Dictionary } from "intlayer";
|
|
62
|
+
|
|
63
|
+
const helloWorldContent = {
|
|
64
|
+
key: "hello-world",
|
|
65
|
+
locale: Locales.SPANISH, // Важливо
|
|
66
|
+
content: { multilingualContent: "Заголовок мого компонента" },
|
|
67
|
+
} satisfies Dictionary;
|
|
68
|
+
|
|
69
|
+
export default helloWorldContent;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```js fileName="hello-world.en.content.mjs" contentDeclarationFormat="esm"
|
|
73
|
+
import { t, Locales } from "intlayer";
|
|
74
|
+
|
|
75
|
+
/** @type {import('intlayer').Dictionary} */
|
|
76
|
+
const helloWorldContent = {
|
|
77
|
+
key: "hello-world",
|
|
78
|
+
locale: Locales.ENGLISH, // Важливо
|
|
79
|
+
content: { multilingualContent: "Заголовок мого компонента" },
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default helloWorldContent;
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```tsx fileName="hello-world.es.content.mjs" contentDeclarationFormat="esm"
|
|
86
|
+
import { t, Locales } from "intlayer";
|
|
87
|
+
|
|
88
|
+
/** @type {import('intlayer').Dictionary} */
|
|
89
|
+
const helloWorldContent = {
|
|
90
|
+
key: "hello-world",
|
|
91
|
+
locale: Locales.SPANISH, // Важливо
|
|
92
|
+
content: { multilingualContent: "Заголовок мого компонента" },
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export default helloWorldContent;
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```js fileName="hello-world.en.content.cjs" contentDeclarationFormat="commonjs"
|
|
99
|
+
const { t, Locales } = require("intlayer");
|
|
100
|
+
|
|
101
|
+
/** @type {import('intlayer').Dictionary} */
|
|
102
|
+
const helloWorldContent = {
|
|
103
|
+
key: "hello-world",
|
|
104
|
+
locale: Locales.ENGLISH, // Важливо
|
|
105
|
+
content: {
|
|
106
|
+
multilingualContent: "Заголовок мого компонента",
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
module.exports = helloWorldContent;
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```tsx fileName="hello-world.es.content.cjs" contentDeclarationFormat="commonjs"
|
|
114
|
+
const { t, Locales } = require("intlayer");
|
|
115
|
+
|
|
116
|
+
/** @type {import('intlayer').Dictionary} */
|
|
117
|
+
const helloWorldContent = {
|
|
118
|
+
key: "hello-world",
|
|
119
|
+
locale: Locales.SPANISH, // Важливо
|
|
120
|
+
content: {
|
|
121
|
+
multilingualContent: "Заголовок мого компонента",
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
module.exports = helloWorldContent;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
```json5 fileName="hello-world.en.content.json" contentDeclarationFormat="json"
|
|
129
|
+
{
|
|
130
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
131
|
+
"key": "hello-world",
|
|
132
|
+
"locale": "en", // Важливо
|
|
133
|
+
"content": {
|
|
134
|
+
"multilingualContent": "Заголовок мого компонента",
|
|
135
|
+
},
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```json5 fileName="hello-world.es.content.json" contentDeclarationFormat="json"
|
|
140
|
+
{
|
|
141
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
142
|
+
"key": "hello-world",
|
|
143
|
+
"locale": "es", // Важливо
|
|
144
|
+
"content": {
|
|
145
|
+
"multilingualContent": "Título de mi componente",
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
> Важливо: Переконайтеся, що поле locale визначено. Воно вказує Intlayer, яку мову представляє файл.
|
|
151
|
+
|
|
152
|
+
> Примітка: В обох випадках файл декларації контенту повинен відповідати шаблону іменування `*.content.{ts,tsx,js,jsx,mjs,cjs,json}`, щоб Intlayer розпізнав його. Суфікс `.[locale]` є опціональним і використовується лише як конвенція іменування.
|
|
153
|
+
|
|
154
|
+
### Глобальна конфігурація для файлів за локалями
|
|
155
|
+
|
|
156
|
+
Ви можете налаштувати глобальні параметри для файлів за локалями, додавши наступне до файлу `intlayer.config.ts`:
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
160
|
+
|
|
161
|
+
const config: IntlayerConfig = {
|
|
162
|
+
dictionary: {
|
|
163
|
+
locale: Locales.ENGLISH,
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export default config;
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Використовуючи цю конфігурацію, усі файли для кожної локалі будуть згенеровані з мовою за замовчуванням, встановленою на English. Вона також включає генерацію `.content` файлів за допомогою команди `transform` та компілятора. (Див. [Компілятор](https://intlayer.org/doc/compiler) або [Transform](https://intlayer.org/doc/concept/cli/transform) для докладнішої інформації.)
|
|
171
|
+
|
|
172
|
+
## Один файл з кількома перекладами
|
|
173
|
+
|
|
174
|
+
Цей формат ідеально підходить для:
|
|
175
|
+
|
|
176
|
+
- Швидкої ітерації в коді.
|
|
177
|
+
- Безшовної інтеграції з CMS.
|
|
178
|
+
|
|
179
|
+
Це рекомендований підхід для більшості випадків використання. Він централізує переклади, що полегшує ітерацію та інтеграцію з CMS.
|
|
180
|
+
|
|
181
|
+
```tsx fileName="hello-world.content.ts" contentDeclarationFormat="typescript"
|
|
182
|
+
import { t, type Dictionary } from "intlayer";
|
|
183
|
+
|
|
184
|
+
const helloWorldContent = {
|
|
185
|
+
key: "hello-world",
|
|
186
|
+
content: {
|
|
187
|
+
multilingualContent: t({
|
|
188
|
+
uk: "Заголовок мого компонента",
|
|
189
|
+
en: "Title of my component",
|
|
190
|
+
es: "Título de mi componente",
|
|
191
|
+
}),
|
|
192
|
+
},
|
|
193
|
+
} satisfies Dictionary;
|
|
194
|
+
|
|
195
|
+
export default helloWorldContent;
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
```js fileName="hello-world.content.mjs" contentDeclarationFormat="esm"
|
|
199
|
+
import { t } from "intlayer";
|
|
200
|
+
|
|
201
|
+
/** @type {import('intlayer').Dictionary} */
|
|
202
|
+
const helloWorldContent = {
|
|
203
|
+
key: "hello-world",
|
|
204
|
+
content: {
|
|
205
|
+
multilingualContent: t({
|
|
206
|
+
uk: "Заголовок мого компонента",
|
|
207
|
+
en: "Title of my component",
|
|
208
|
+
es: "Título de mi componente",
|
|
209
|
+
}),
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export default helloWorldContent;
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
```js fileName="hello-world.content.cjs" contentDeclarationFormat="json"
|
|
217
|
+
const { t } = require("intlayer");
|
|
218
|
+
|
|
219
|
+
/** @type {import('intlayer').Dictionary} */
|
|
220
|
+
const helloWorldContent = {
|
|
221
|
+
key: "hello-world",
|
|
222
|
+
content: {
|
|
223
|
+
multilingualContent: t({
|
|
224
|
+
uk: "Заголовок мого компонента",
|
|
225
|
+
en: "Title of my component",
|
|
226
|
+
es: "Título de mi componente",
|
|
227
|
+
}),
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
module.exports = helloWorldContent;
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
```json fileName="hello-world.content.ts" contentDeclarationFormat="json"
|
|
235
|
+
{
|
|
236
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
237
|
+
"key": "hello-world",
|
|
238
|
+
"content": {
|
|
239
|
+
"multilingualContent": {
|
|
240
|
+
"nodeType": "translation",
|
|
241
|
+
"translation": {
|
|
242
|
+
"uk": "Заголовок мого компонента",
|
|
243
|
+
"en": "Title of my component",
|
|
244
|
+
"es": "Título de mi componente"
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
> Рекомендовано: цей формат найкраще підходить при використанні візуального редактора Intlayer або при керуванні перекладами безпосередньо в коді.
|
|
252
|
+
|
|
253
|
+
## Змішування форматів
|
|
254
|
+
|
|
255
|
+
Ви можете поєднувати обидва підходи декларації для одного й того ж ключа контенту. Наприклад:
|
|
256
|
+
|
|
257
|
+
- Оголосіть базовий вміст статично у файлі, наприклад index.content.ts.
|
|
258
|
+
- Додайте або перевизначте конкретні переклади в окремих файлах, таких як index.fr.content.ts або index.content.json.
|
|
259
|
+
|
|
260
|
+
Ця конфігурація особливо корисна, коли:
|
|
261
|
+
|
|
262
|
+
- Ви хочете визначити початкову структуру вмісту в коді.
|
|
263
|
+
- Ви плануєте збагачувати або доповнювати переклади пізніше за допомогою CMS або автоматизованих інструментів.
|
|
264
|
+
|
|
265
|
+
```bash codeFormat="typescript"
|
|
266
|
+
.
|
|
267
|
+
└── Components
|
|
268
|
+
└── MyComponent
|
|
269
|
+
├── index.content.ts
|
|
270
|
+
├── index.content.json
|
|
271
|
+
└── index.ts
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Приклад
|
|
275
|
+
|
|
276
|
+
Нижче — файл декларації мультимовного вмісту:
|
|
277
|
+
|
|
278
|
+
```tsx fileName="Components/MyComponent/index.content.ts"
|
|
279
|
+
import { t, type Dictionary } from "intlayer";
|
|
280
|
+
|
|
281
|
+
const helloWorldContent = {
|
|
282
|
+
key: "hello-world",
|
|
283
|
+
locale: Locales.ENGLISH,
|
|
284
|
+
content: {
|
|
285
|
+
multilingualContent: "Заголовок мого компонента",
|
|
286
|
+
projectName: "Мій проєкт",
|
|
287
|
+
},
|
|
288
|
+
} satisfies Dictionary;
|
|
289
|
+
|
|
290
|
+
export default helloWorldContent;
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
```json fileName="Components/MyComponent/index.content.json"
|
|
294
|
+
{
|
|
295
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
296
|
+
"key": "hello-world",
|
|
297
|
+
"content": {
|
|
298
|
+
"multilingualContent": {
|
|
299
|
+
"nodeType": "translation",
|
|
300
|
+
"translation": {
|
|
301
|
+
"uk": "Заголовок мого компонента",
|
|
302
|
+
"fr": "Titre de mon composant",
|
|
303
|
+
"es": "Título de mi componente"
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Intlayer merges multilingual and per-locale files automatically.
|
|
311
|
+
|
|
312
|
+
```tsx fileName="Components/MyComponent/index.ts"
|
|
313
|
+
import { getIntlayer, Locales } from "intlayer";
|
|
314
|
+
|
|
315
|
+
const intlayer = getIntlayer("hello-world"); // Локаль за замовчуванням — ENGLISH, тому буде повернено контент англійською
|
|
316
|
+
|
|
317
|
+
console.log(JSON.stringify(intlayer, null, 2));
|
|
318
|
+
// Результат:
|
|
319
|
+
// {
|
|
320
|
+
// "multilingualContent": "Title of my component",
|
|
321
|
+
// "projectName": "My project"
|
|
322
|
+
// }
|
|
323
|
+
|
|
324
|
+
const intlayer = getIntlayer("hello-world", Locales.SPANISH);
|
|
325
|
+
|
|
326
|
+
console.log(JSON.stringify(intlayer, null, 2));
|
|
327
|
+
// Результат:
|
|
328
|
+
// {
|
|
329
|
+
// "multilingualContent": "Título de mi componente",
|
|
330
|
+
// "projectName": "My project"
|
|
331
|
+
// }
|
|
332
|
+
|
|
333
|
+
const intlayer = getIntlayer("hello-world", Locales.FRENCH);
|
|
334
|
+
|
|
335
|
+
console.log(JSON.stringify(intlayer, null, 2));
|
|
336
|
+
// Результат:
|
|
337
|
+
// {
|
|
338
|
+
// "multilingualContent": "Titre de mon composant",
|
|
339
|
+
// "projectName": "My project"
|
|
340
|
+
// }
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Автоматична генерація перекладів
|
|
344
|
+
|
|
345
|
+
Використовуйте [intlayer CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/uk/cli/index.md) для автоматичного заповнення відсутніх перекладів на основі ваших улюблених сервісів.
|