@intlayer/docs 5.8.1-canary.0 → 6.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blog/ar/rag_powered_documentation_assistant.md +282 -0
- package/blog/de/rag_powered_documentation_assistant.md +282 -0
- package/blog/en/rag_powered_documentation_assistant.md +289 -0
- package/blog/en-GB/rag_powered_documentation_assistant.md +284 -0
- package/blog/es/rag_powered_documentation_assistant.md +308 -0
- package/blog/fr/rag_powered_documentation_assistant.md +308 -0
- package/blog/hi/rag_powered_documentation_assistant.md +284 -0
- package/blog/it/rag_powered_documentation_assistant.md +284 -0
- package/blog/ja/rag_powered_documentation_assistant.md +284 -0
- package/blog/ko/rag_powered_documentation_assistant.md +283 -0
- package/blog/pt/rag_powered_documentation_assistant.md +284 -0
- package/blog/ru/rag_powered_documentation_assistant.md +284 -0
- package/blog/tr/index.md +69 -0
- package/blog/tr/internationalization_and_SEO.md +273 -0
- package/blog/tr/intlayer_with_i18next.md +162 -0
- package/blog/tr/intlayer_with_next-i18next.md +367 -0
- package/blog/tr/intlayer_with_next-intl.md +392 -0
- package/blog/tr/intlayer_with_react-i18next.md +346 -0
- package/blog/tr/intlayer_with_react-intl.md +345 -0
- package/blog/tr/list_i18n_technologies/CMS/drupal.md +143 -0
- package/blog/tr/list_i18n_technologies/CMS/wix.md +167 -0
- package/blog/tr/list_i18n_technologies/CMS/wordpress.md +188 -0
- package/blog/tr/list_i18n_technologies/frameworks/angular.md +125 -0
- package/blog/tr/list_i18n_technologies/frameworks/flutter.md +150 -0
- package/blog/tr/list_i18n_technologies/frameworks/react-native.md +217 -0
- package/blog/tr/list_i18n_technologies/frameworks/react.md +155 -0
- package/blog/tr/list_i18n_technologies/frameworks/svelte.md +129 -0
- package/blog/tr/list_i18n_technologies/frameworks/vue.md +130 -0
- package/blog/tr/next-i18next_vs_next-intl_vs_intlayer.md +170 -0
- package/blog/tr/rag_powered_documentation_assistant.md +284 -0
- package/blog/tr/react-i18next_vs_react-intl_vs_intlayer.md +162 -0
- package/blog/tr/vue-i18n_vs_intlayer.md +276 -0
- package/blog/tr/what_is_internationalization.md +166 -0
- package/blog/zh/rag_powered_documentation_assistant.md +284 -0
- package/dist/cjs/generated/blog.entry.cjs +212 -0
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +660 -132
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +84 -0
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +6 -0
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +212 -0
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +660 -132
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/esm/generated/frequentQuestions.entry.mjs +84 -0
- package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
- package/dist/esm/generated/legal.entry.mjs +6 -0
- package/dist/esm/generated/legal.entry.mjs.map +1 -1
- package/dist/types/generated/blog.entry.d.ts +1 -0
- package/dist/types/generated/blog.entry.d.ts.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +5 -2
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- 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/autoFill.md +41 -40
- package/docs/ar/configuration.md +202 -199
- package/docs/ar/dictionary/content_file.md +1059 -0
- package/docs/ar/intlayer_CMS.md +4 -4
- package/docs/ar/intlayer_with_nestjs.md +271 -0
- package/docs/ar/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/ar/intlayer_with_react_router_v7.md +533 -0
- package/docs/ar/intlayer_with_tanstack.md +465 -299
- package/docs/ar/intlayer_with_vite+preact.md +7 -7
- package/docs/ar/intlayer_with_vite+react.md +7 -7
- package/docs/ar/intlayer_with_vite+vue.md +9 -9
- package/docs/ar/packages/vite-intlayer/index.md +3 -3
- package/docs/ar/readme.md +261 -0
- package/docs/ar/testing.md +199 -0
- package/docs/de/autoFill.md +42 -19
- package/docs/de/configuration.md +155 -147
- package/docs/de/dictionary/content_file.md +1059 -0
- package/docs/de/intlayer_CMS.md +4 -5
- package/docs/de/intlayer_with_nestjs.md +270 -0
- package/docs/de/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/de/intlayer_with_react_router_v7.md +537 -0
- package/docs/de/intlayer_with_tanstack.md +469 -302
- package/docs/de/intlayer_with_vite+preact.md +7 -7
- package/docs/de/intlayer_with_vite+react.md +7 -7
- package/docs/de/intlayer_with_vite+vue.md +9 -9
- package/docs/de/packages/vite-intlayer/index.md +3 -3
- package/docs/de/readme.md +261 -0
- package/docs/de/testing.md +200 -0
- package/docs/en/CI_CD.md +4 -6
- package/docs/en/autoFill.md +25 -5
- package/docs/en/configuration.md +45 -54
- package/docs/en/dictionary/content_file.md +1054 -0
- package/docs/en/intlayer_CMS.md +8 -7
- package/docs/en/intlayer_cli.md +112 -5
- package/docs/en/intlayer_with_nestjs.md +268 -0
- package/docs/en/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/en/intlayer_with_react_router_v7.md +531 -0
- package/docs/en/intlayer_with_tanstack.md +463 -294
- package/docs/en/intlayer_with_vite+preact.md +8 -8
- package/docs/en/intlayer_with_vite+react.md +8 -8
- package/docs/en/intlayer_with_vite+vue.md +8 -8
- package/docs/en/packages/intlayer/getLocalizedUrl.md +102 -25
- package/docs/en/packages/vite-intlayer/index.md +3 -3
- package/docs/en/readme.md +261 -0
- package/docs/en/testing.md +200 -0
- package/docs/en-GB/autoFill.md +29 -6
- package/docs/en-GB/configuration.md +79 -71
- package/docs/en-GB/dictionary/content_file.md +1084 -0
- package/docs/en-GB/intlayer_CMS.md +4 -5
- package/docs/en-GB/intlayer_with_nestjs.md +268 -0
- package/docs/en-GB/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/en-GB/intlayer_with_react_router_v7.md +533 -0
- package/docs/en-GB/intlayer_with_tanstack.md +466 -299
- package/docs/en-GB/intlayer_with_vite+preact.md +7 -7
- package/docs/en-GB/intlayer_with_vite+react.md +7 -7
- package/docs/en-GB/intlayer_with_vite+vue.md +9 -9
- package/docs/en-GB/packages/vite-intlayer/index.md +3 -3
- package/docs/en-GB/readme.md +261 -0
- package/docs/en-GB/testing.md +200 -0
- package/docs/es/autoFill.md +45 -23
- package/docs/es/configuration.md +171 -167
- package/docs/es/dictionary/content_file.md +1088 -0
- package/docs/es/intlayer_CMS.md +4 -5
- package/docs/es/intlayer_with_nestjs.md +268 -0
- package/docs/es/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/es/intlayer_with_react_router_v7.md +533 -0
- package/docs/es/intlayer_with_tanstack.md +469 -280
- package/docs/es/intlayer_with_vite+preact.md +7 -7
- package/docs/es/intlayer_with_vite+react.md +7 -7
- package/docs/es/intlayer_with_vite+vue.md +9 -9
- package/docs/es/packages/vite-intlayer/index.md +3 -3
- package/docs/es/readme.md +261 -0
- package/docs/es/testing.md +200 -0
- package/docs/fr/autoFill.md +47 -24
- package/docs/fr/configuration.md +213 -198
- package/docs/fr/dictionary/content_file.md +1054 -0
- package/docs/fr/intlayer_CMS.md +4 -5
- package/docs/fr/intlayer_with_nestjs.md +268 -0
- package/docs/fr/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/fr/intlayer_with_react_router_v7.md +549 -0
- package/docs/fr/intlayer_with_tanstack.md +465 -279
- package/docs/fr/intlayer_with_vite+preact.md +7 -7
- package/docs/fr/intlayer_with_vite+react.md +7 -7
- package/docs/fr/intlayer_with_vite+vue.md +9 -9
- package/docs/fr/packages/vite-intlayer/index.md +3 -3
- package/docs/fr/readme.md +261 -0
- package/docs/fr/testing.md +200 -0
- package/docs/hi/autoFill.md +47 -25
- package/docs/hi/configuration.md +194 -189
- package/docs/hi/dictionary/content_file.md +1056 -0
- package/docs/hi/intlayer_CMS.md +4 -5
- package/docs/hi/intlayer_with_nestjs.md +269 -0
- package/docs/hi/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/hi/intlayer_with_react_router_v7.md +533 -0
- package/docs/hi/intlayer_with_tanstack.md +467 -282
- package/docs/hi/intlayer_with_vite+preact.md +7 -7
- package/docs/hi/intlayer_with_vite+react.md +7 -7
- package/docs/hi/intlayer_with_vite+vue.md +9 -9
- package/docs/hi/packages/vite-intlayer/index.md +3 -3
- package/docs/hi/readme.md +261 -0
- package/docs/hi/testing.md +200 -0
- package/docs/it/autoFill.md +46 -24
- package/docs/it/configuration.md +169 -161
- package/docs/it/dictionary/content_file.md +1061 -0
- package/docs/it/intlayer_CMS.md +4 -5
- package/docs/it/intlayer_with_nestjs.md +268 -0
- package/docs/it/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/it/intlayer_with_react_router_v7.md +535 -0
- package/docs/it/intlayer_with_tanstack.md +467 -301
- package/docs/it/intlayer_with_vite+preact.md +7 -7
- package/docs/it/intlayer_with_vite+react.md +7 -7
- package/docs/it/intlayer_with_vite+vue.md +9 -9
- package/docs/it/packages/vite-intlayer/index.md +3 -3
- package/docs/it/readme.md +261 -0
- package/docs/it/testing.md +200 -0
- package/docs/ja/autoFill.md +45 -23
- package/docs/ja/configuration.md +243 -204
- package/docs/ja/dictionary/content_file.md +1064 -0
- package/docs/ja/intlayer_CMS.md +4 -5
- package/docs/ja/intlayer_with_nestjs.md +268 -0
- package/docs/ja/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/ja/intlayer_with_react_router_v7.md +534 -0
- package/docs/ja/intlayer_with_tanstack.md +467 -303
- package/docs/ja/intlayer_with_vite+preact.md +7 -7
- package/docs/ja/intlayer_with_vite+react.md +7 -7
- package/docs/ja/intlayer_with_vite+vue.md +9 -9
- package/docs/ja/packages/vite-intlayer/index.md +3 -3
- package/docs/ja/readme.md +263 -0
- package/docs/ja/testing.md +200 -0
- package/docs/ko/autoFill.md +39 -16
- package/docs/ko/configuration.md +217 -197
- package/docs/ko/dictionary/content_file.md +1060 -0
- package/docs/ko/intlayer_CMS.md +4 -5
- package/docs/ko/intlayer_with_nestjs.md +268 -0
- package/docs/ko/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/ko/intlayer_with_react_router_v7.md +540 -0
- package/docs/ko/intlayer_with_tanstack.md +466 -302
- package/docs/ko/intlayer_with_vite+preact.md +7 -7
- package/docs/ko/intlayer_with_vite+react.md +7 -7
- package/docs/ko/intlayer_with_vite+vue.md +9 -9
- package/docs/ko/packages/vite-intlayer/index.md +3 -3
- package/docs/ko/readme.md +261 -0
- package/docs/ko/testing.md +200 -0
- package/docs/pt/autoFill.md +39 -15
- package/docs/pt/configuration.md +165 -147
- package/docs/pt/dictionary/content_file.md +1062 -0
- package/docs/pt/intlayer_CMS.md +4 -5
- package/docs/pt/intlayer_with_nestjs.md +271 -0
- package/docs/pt/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/pt/intlayer_with_react_router_v7.md +535 -0
- package/docs/pt/intlayer_with_tanstack.md +469 -300
- package/docs/pt/intlayer_with_vite+preact.md +7 -7
- package/docs/pt/intlayer_with_vite+react.md +7 -7
- package/docs/pt/intlayer_with_vite+vue.md +9 -9
- package/docs/pt/packages/vite-intlayer/index.md +3 -3
- package/docs/pt/readme.md +261 -0
- package/docs/pt/testing.md +200 -0
- package/docs/ru/autoFill.md +52 -30
- package/docs/ru/configuration.md +164 -117
- package/docs/ru/dictionary/content_file.md +1064 -0
- package/docs/ru/intlayer_CMS.md +4 -4
- package/docs/ru/intlayer_with_nestjs.md +270 -0
- package/docs/ru/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/ru/intlayer_with_react_router_v7.md +534 -0
- package/docs/ru/intlayer_with_tanstack.md +470 -305
- package/docs/ru/intlayer_with_vite+preact.md +7 -7
- package/docs/ru/intlayer_with_vite+react.md +7 -7
- package/docs/ru/intlayer_with_vite+vue.md +9 -9
- package/docs/ru/packages/vite-intlayer/index.md +3 -3
- package/docs/ru/readme.md +261 -0
- package/docs/ru/testing.md +202 -0
- package/docs/tr/CI_CD.md +198 -0
- package/docs/tr/autoFill.md +201 -0
- package/docs/tr/configuration.md +585 -0
- package/docs/tr/dictionary/condition.md +243 -0
- package/docs/tr/dictionary/content_file.md +1055 -0
- package/docs/tr/dictionary/enumeration.md +251 -0
- package/docs/tr/dictionary/file.md +228 -0
- package/docs/tr/dictionary/function_fetching.md +218 -0
- package/docs/tr/dictionary/gender.md +279 -0
- package/docs/tr/dictionary/insertion.md +191 -0
- package/docs/tr/dictionary/markdown.md +385 -0
- package/docs/tr/dictionary/nesting.md +279 -0
- package/docs/tr/dictionary/translation.md +315 -0
- package/docs/tr/formatters.md +618 -0
- package/docs/tr/how_works_intlayer.md +254 -0
- package/docs/tr/index.md +168 -0
- package/docs/tr/interest_of_intlayer.md +288 -0
- package/docs/tr/intlayer_CMS.md +347 -0
- package/docs/tr/intlayer_cli.md +570 -0
- package/docs/tr/intlayer_visual_editor.md +269 -0
- package/docs/tr/intlayer_with_angular.md +694 -0
- package/docs/tr/intlayer_with_create_react_app.md +1218 -0
- package/docs/tr/intlayer_with_express.md +415 -0
- package/docs/tr/intlayer_with_lynx+react.md +511 -0
- package/docs/tr/intlayer_with_nestjs.md +268 -0
- package/docs/tr/intlayer_with_nextjs_14.md +1029 -0
- package/docs/tr/intlayer_with_nextjs_15.md +1506 -0
- package/docs/tr/intlayer_with_nextjs_page_router.md +1484 -0
- package/docs/tr/intlayer_with_nuxt.md +773 -0
- package/docs/tr/intlayer_with_react_native+expo.md +660 -0
- package/docs/tr/intlayer_with_react_router_v7.md +531 -0
- package/docs/tr/intlayer_with_tanstack.md +452 -0
- package/docs/tr/intlayer_with_vite+preact.md +1673 -0
- package/docs/tr/intlayer_with_vite+react.md +1632 -0
- package/docs/tr/intlayer_with_vite+solid.md +288 -0
- package/docs/tr/intlayer_with_vite+svelte.md +288 -0
- package/docs/tr/intlayer_with_vite+vue.md +1042 -0
- package/docs/tr/introduction.md +209 -0
- package/docs/tr/locale_mapper.md +244 -0
- package/docs/tr/mcp_server.md +207 -0
- package/docs/tr/packages/@intlayer/api/index.md +58 -0
- package/docs/tr/packages/@intlayer/chokidar/index.md +57 -0
- package/docs/tr/packages/@intlayer/cli/index.md +47 -0
- package/docs/tr/packages/@intlayer/config/index.md +142 -0
- package/docs/tr/packages/@intlayer/core/index.md +51 -0
- package/docs/tr/packages/@intlayer/design-system/index.md +47 -0
- package/docs/tr/packages/@intlayer/dictionary-entry/index.md +53 -0
- package/docs/tr/packages/@intlayer/editor/index.md +47 -0
- package/docs/tr/packages/@intlayer/editor-react/index.md +47 -0
- package/docs/tr/packages/@intlayer/webpack/index.md +61 -0
- package/docs/tr/packages/angular-intlayer/index.md +59 -0
- package/docs/tr/packages/express-intlayer/index.md +258 -0
- package/docs/tr/packages/express-intlayer/t.md +459 -0
- package/docs/tr/packages/intlayer/getConfiguration.md +151 -0
- package/docs/tr/packages/intlayer/getEnumeration.md +165 -0
- package/docs/tr/packages/intlayer/getHTMLTextDir.md +127 -0
- package/docs/tr/packages/intlayer/getLocaleLang.md +87 -0
- package/docs/tr/packages/intlayer/getLocaleName.md +124 -0
- package/docs/tr/packages/intlayer/getLocalizedUrl.md +324 -0
- package/docs/tr/packages/intlayer/getMultilingualUrls.md +225 -0
- package/docs/tr/packages/intlayer/getPathWithoutLocale.md +81 -0
- package/docs/tr/packages/intlayer/getTranslation.md +196 -0
- package/docs/tr/packages/intlayer/getTranslationContent.md +195 -0
- package/docs/tr/packages/intlayer/index.md +505 -0
- package/docs/tr/packages/intlayer-cli/index.md +71 -0
- package/docs/tr/packages/intlayer-editor/index.md +139 -0
- package/docs/tr/packages/lynx-intlayer/index.md +85 -0
- package/docs/tr/packages/next-intlayer/index.md +154 -0
- package/docs/tr/packages/next-intlayer/t.md +354 -0
- package/docs/tr/packages/next-intlayer/useDictionary.md +270 -0
- package/docs/tr/packages/next-intlayer/useIntlayer.md +265 -0
- package/docs/tr/packages/next-intlayer/useLocale.md +133 -0
- package/docs/tr/packages/nuxt-intlayer/index.md +59 -0
- package/docs/tr/packages/preact-intlayer/index.md +55 -0
- package/docs/tr/packages/react-intlayer/index.md +148 -0
- package/docs/tr/packages/react-intlayer/t.md +304 -0
- package/docs/tr/packages/react-intlayer/useDictionary.md +554 -0
- package/docs/tr/packages/react-intlayer/useI18n.md +478 -0
- package/docs/tr/packages/react-intlayer/useIntlayer.md +253 -0
- package/docs/tr/packages/react-intlayer/useLocale.md +212 -0
- package/docs/tr/packages/react-native-intlayer/index.md +85 -0
- package/docs/tr/packages/react-scripts-intlayer/index.md +82 -0
- package/docs/tr/packages/solid-intlayer/index.md +56 -0
- package/docs/tr/packages/svelte-intlayer/index.md +55 -0
- package/docs/tr/packages/vite-intlayer/index.md +82 -0
- package/docs/tr/packages/vue-intlayer/index.md +59 -0
- package/docs/tr/per_locale_file.md +321 -0
- package/docs/tr/readme.md +261 -0
- package/docs/tr/roadmap.md +338 -0
- package/docs/tr/testing.md +200 -0
- package/docs/tr/vs_code_extension.md +154 -0
- package/docs/zh/autoFill.md +40 -18
- package/docs/zh/configuration.md +245 -226
- package/docs/zh/dictionary/content_file.md +1064 -0
- package/docs/zh/intlayer_CMS.md +4 -5
- package/docs/zh/intlayer_with_nestjs.md +268 -0
- package/docs/zh/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/zh/intlayer_with_react_router_v7.md +535 -0
- package/docs/zh/intlayer_with_tanstack.md +468 -278
- package/docs/zh/intlayer_with_vite+preact.md +7 -7
- package/docs/zh/intlayer_with_vite+react.md +7 -7
- package/docs/zh/intlayer_with_vite+vue.md +7 -7
- package/docs/zh/packages/vite-intlayer/index.md +3 -3
- package/docs/zh/readme.md +261 -0
- package/docs/zh/testing.md +198 -0
- package/frequent_questions/tr/SSR_Next_no_[locale].md +105 -0
- package/frequent_questions/tr/array_as_content_declaration.md +72 -0
- package/frequent_questions/tr/build_dictionaries.md +59 -0
- package/frequent_questions/tr/build_error_CI_CD.md +75 -0
- package/frequent_questions/tr/customized_locale_list.md +65 -0
- package/frequent_questions/tr/domain_routing.md +114 -0
- package/frequent_questions/tr/esbuild_error.md +30 -0
- package/frequent_questions/tr/get_locale_cookie.md +142 -0
- package/frequent_questions/tr/intlayer_command_undefined.md +156 -0
- package/frequent_questions/tr/locale_incorect_in_url.md +74 -0
- package/frequent_questions/tr/static_rendering.md +45 -0
- package/frequent_questions/tr/translated_path_url.md +56 -0
- package/frequent_questions/tr/unknown_command.md +98 -0
- package/legal/tr/privacy_notice.md +83 -0
- package/legal/tr/terms_of_service.md +55 -0
- package/package.json +13 -13
- package/src/generated/blog.entry.ts +212 -0
- package/src/generated/docs.entry.ts +663 -135
- package/src/generated/frequentQuestions.entry.ts +85 -1
- package/src/generated/legal.entry.ts +7 -1
- package/docs/ar/dictionary/content_extention_customization.md +0 -100
- package/docs/ar/dictionary/get_started.md +0 -527
- package/docs/de/dictionary/content_extention_customization.md +0 -100
- package/docs/de/dictionary/get_started.md +0 -531
- package/docs/en/dictionary/content_extention_customization.md +0 -102
- package/docs/en/dictionary/get_started.md +0 -529
- package/docs/en-GB/dictionary/content_extention_customization.md +0 -100
- package/docs/en-GB/dictionary/get_started.md +0 -591
- package/docs/es/dictionary/content_extention_customization.md +0 -100
- package/docs/es/dictionary/get_started.md +0 -527
- package/docs/fr/dictionary/content_extention_customization.md +0 -100
- package/docs/fr/dictionary/get_started.md +0 -527
- package/docs/hi/dictionary/content_extention_customization.md +0 -100
- package/docs/hi/dictionary/get_started.md +0 -527
- package/docs/it/dictionary/content_extention_customization.md +0 -113
- package/docs/it/dictionary/get_started.md +0 -573
- package/docs/ja/dictionary/content_extention_customization.md +0 -113
- package/docs/ja/dictionary/get_started.md +0 -576
- package/docs/ko/dictionary/content_extention_customization.md +0 -100
- package/docs/ko/dictionary/get_started.md +0 -530
- package/docs/pt/dictionary/content_extention_customization.md +0 -100
- package/docs/pt/dictionary/get_started.md +0 -532
- package/docs/ru/dictionary/content_extention_customization.md +0 -100
- package/docs/ru/dictionary/get_started.md +0 -575
- package/docs/zh/dictionary/content_extention_customization.md +0 -117
- package/docs/zh/dictionary/get_started.md +0 -533
|
@@ -1108,38 +1108,38 @@ const App = () => (
|
|
|
1108
1108
|
module.exports = App;
|
|
1109
1109
|
```
|
|
1110
1110
|
|
|
1111
|
-
同时,您还可以使用 `
|
|
1111
|
+
同时,您还可以使用 `intlayerMiddlewarePlugin` 为您的应用程序添加服务器端路由。该插件将根据 URL 自动检测当前语言环境并设置相应的语言环境 Cookie。如果未指定语言环境,插件将根据用户浏览器的语言偏好确定最合适的语言环境。如果仍未检测到语言环境,则会重定向到默认语言环境。
|
|
1112
1112
|
|
|
1113
1113
|
```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
|
|
1114
1114
|
import { defineConfig } from "vite";
|
|
1115
1115
|
import preact from "@preact/preset-vite";
|
|
1116
|
-
import { intlayerPlugin,
|
|
1116
|
+
import { intlayerPlugin, intlayerMiddlewarePlugin } from "vite-intlayer";
|
|
1117
1117
|
|
|
1118
1118
|
// https://vitejs.dev/config/
|
|
1119
1119
|
export default defineConfig({
|
|
1120
|
-
plugins: [preact(), intlayerPlugin(),
|
|
1120
|
+
plugins: [preact(), intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
1121
1121
|
});
|
|
1122
1122
|
```
|
|
1123
1123
|
|
|
1124
1124
|
```javascript {3,7} fileName="vite.config.mjs" codeFormat="esm"
|
|
1125
1125
|
import { defineConfig } from "vite";
|
|
1126
1126
|
import preact from "@preact/preset-vite";
|
|
1127
|
-
import { intlayerPlugin,
|
|
1127
|
+
import { intlayerPlugin, intlayerMiddlewarePlugin } from "vite-intlayer";
|
|
1128
1128
|
|
|
1129
1129
|
// https://vitejs.dev/config/
|
|
1130
1130
|
export default defineConfig({
|
|
1131
|
-
plugins: [preact(), intlayerPlugin(),
|
|
1131
|
+
plugins: [preact(), intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
1132
1132
|
});
|
|
1133
1133
|
```
|
|
1134
1134
|
|
|
1135
1135
|
```javascript {3,7} fileName="vite.config.cjs" codeFormat="commonjs"
|
|
1136
1136
|
const { defineConfig } = require("vite");
|
|
1137
1137
|
const preact = require("@preact/preset-vite");
|
|
1138
|
-
const { intlayerPlugin,
|
|
1138
|
+
const { intlayerPlugin, intlayerMiddlewarePlugin } = require("vite-intlayer");
|
|
1139
1139
|
|
|
1140
1140
|
// https://vitejs.dev/config/
|
|
1141
1141
|
module.exports = defineConfig({
|
|
1142
|
-
plugins: [preact(), intlayerPlugin(),
|
|
1142
|
+
plugins: [preact(), intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
1143
1143
|
});
|
|
1144
1144
|
```
|
|
1145
1145
|
|
|
@@ -1003,38 +1003,38 @@ const App = () => (
|
|
|
1003
1003
|
);
|
|
1004
1004
|
```
|
|
1005
1005
|
|
|
1006
|
-
同时,您还可以使用 `
|
|
1006
|
+
同时,您还可以使用 `intlayerMiddlewarePlugin` 为您的应用程序添加服务器端路由。该插件将根据 URL 自动检测当前语言环境并设置相应的语言环境 Cookie。如果未指定语言环境,插件将根据用户浏览器的语言偏好确定最合适的语言环境。如果未检测到任何语言环境,它将重定向到默认语言环境。
|
|
1007
1007
|
|
|
1008
1008
|
```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
|
|
1009
1009
|
import { defineConfig } from "vite";
|
|
1010
1010
|
import react from "@vitejs/plugin-react-swc";
|
|
1011
|
-
import { intlayerPlugin,
|
|
1011
|
+
import { intlayerPlugin, intlayerMiddlewarePlugin } from "vite-intlayer";
|
|
1012
1012
|
|
|
1013
1013
|
// https://vitejs.dev/config/
|
|
1014
1014
|
export default defineConfig({
|
|
1015
|
-
plugins: [react(), intlayerPlugin(),
|
|
1015
|
+
plugins: [react(), intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
1016
1016
|
});
|
|
1017
1017
|
```
|
|
1018
1018
|
|
|
1019
1019
|
```javascript {3,7} fileName="vite.config.mjs" codeFormat="esm"
|
|
1020
1020
|
import { defineConfig } from "vite";
|
|
1021
1021
|
import react from "@vitejs/plugin-react-swc";
|
|
1022
|
-
import { intlayerPlugin,
|
|
1022
|
+
import { intlayerPlugin, intlayerMiddlewarePlugin } from "vite-intlayer";
|
|
1023
1023
|
|
|
1024
1024
|
// https://vitejs.dev/config/
|
|
1025
1025
|
export default defineConfig({
|
|
1026
|
-
plugins: [react(), intlayerPlugin(),
|
|
1026
|
+
plugins: [react(), intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
1027
1027
|
});
|
|
1028
1028
|
```
|
|
1029
1029
|
|
|
1030
1030
|
```javascript {3,7} fileName="vite.config.cjs" codeFormat="commonjs"
|
|
1031
1031
|
const { defineConfig } = require("vite");
|
|
1032
1032
|
const react = require("@vitejs/plugin-react-swc");
|
|
1033
|
-
const { intlayerPlugin,
|
|
1033
|
+
const { intlayerPlugin, intlayerMiddlewarePlugin } = require("vite-intlayer");
|
|
1034
1034
|
|
|
1035
1035
|
// https://vitejs.dev/config/
|
|
1036
1036
|
module.exports = defineConfig({
|
|
1037
|
-
plugins: [react(), intlayerPlugin(),
|
|
1037
|
+
plugins: [react(), intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
1038
1038
|
});
|
|
1039
1039
|
```
|
|
1040
1040
|
|
|
@@ -677,38 +677,38 @@ import LocaleSwitcher from "@components/LocaleSwitcher.vue";
|
|
|
677
677
|
</template>
|
|
678
678
|
```
|
|
679
679
|
|
|
680
|
-
同时,你也可以使用 `
|
|
680
|
+
同时,你也可以使用 `intlayerMiddlewarePlugin` 为你的应用添加服务器端路由。该插件会根据 URL 自动检测当前语言环境并设置相应的语言环境 cookie。如果未指定语言环境,插件将根据用户浏览器的语言偏好确定最合适的语言环境。如果仍未检测到语言环境,则会重定向到默认语言环境。
|
|
681
681
|
|
|
682
682
|
```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
|
|
683
683
|
import { defineConfig } from "vite";
|
|
684
684
|
import vue from "@vitejs/plugin-vue";
|
|
685
|
-
import { intlayerPlugin,
|
|
685
|
+
import { intlayerPlugin, intlayerMiddlewarePlugin } from "vite-intlayer";
|
|
686
686
|
|
|
687
687
|
// https://vitejs.dev/config/
|
|
688
688
|
export default defineConfig({
|
|
689
|
-
plugins: [vue(), intlayerPlugin(),
|
|
689
|
+
plugins: [vue(), intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
690
690
|
});
|
|
691
691
|
```
|
|
692
692
|
|
|
693
693
|
```javascript {3,7} fileName="vite.config.mjs" codeFormat="esm"
|
|
694
694
|
import { defineConfig } from "vite";
|
|
695
695
|
import vue from "@vitejs/plugin-vue";
|
|
696
|
-
import { intlayerPlugin,
|
|
696
|
+
import { intlayerPlugin, intlayerMiddlewarePlugin } from "vite-intlayer";
|
|
697
697
|
|
|
698
698
|
// https://vitejs.dev/config/
|
|
699
699
|
export default defineConfig({
|
|
700
|
-
plugins: [vue(), intlayerPlugin(),
|
|
700
|
+
plugins: [vue(), intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
701
701
|
});
|
|
702
702
|
```
|
|
703
703
|
|
|
704
704
|
```javascript {3,7} fileName="vite.config.cjs" codeFormat="commonjs"
|
|
705
705
|
const { defineConfig } = require("vite");
|
|
706
706
|
const vue = require("@vitejs/plugin-vue");
|
|
707
|
-
const { intlayerPlugin,
|
|
707
|
+
const { intlayerPlugin, intlayerMiddlewarePlugin } = require("vite-intlayer");
|
|
708
708
|
|
|
709
709
|
// https://vitejs.dev/config/
|
|
710
710
|
module.exports = defineConfig({
|
|
711
|
-
plugins: [vue(), intlayerPlugin(),
|
|
711
|
+
plugins: [vue(), intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
712
712
|
});
|
|
713
713
|
```
|
|
714
714
|
|
|
@@ -53,17 +53,17 @@ pnpm add vite-intlayer
|
|
|
53
53
|
|
|
54
54
|
```typescript fileName="vite.config.ts"
|
|
55
55
|
import { defineConfig } from "vite";
|
|
56
|
-
import { intlayerPlugin,
|
|
56
|
+
import { intlayerPlugin, intlayerMiddlewarePlugin } from "vite-intlayer";
|
|
57
57
|
|
|
58
58
|
// https://vitejs.dev/config/
|
|
59
59
|
export default defineConfig({
|
|
60
|
-
plugins: [intlayerPlugin(),
|
|
60
|
+
plugins: [intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
61
61
|
});
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
> `intlayerPlugin()` 是用于将 Intlayer 集成到 Vite 的插件。它确保内容声明文件的构建,并在开发模式下进行监控。它在 Vite 应用中定义了 Intlayer 的环境变量。此外,它还提供别名以优化性能。
|
|
65
65
|
|
|
66
|
-
> `
|
|
66
|
+
> `intlayerMiddlewarePlugin()` 为您的应用添加服务器端路由。该插件会根据 URL 自动检测当前语言环境并设置相应的语言环境 Cookie。如果未指定语言环境,插件将根据用户浏览器的语言偏好确定最合适的语言环境。如果未检测到语言环境,则会重定向到默认语言环境。
|
|
67
67
|
|
|
68
68
|
## 掌握您的 Vite 应用的国际化
|
|
69
69
|
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://intlayer.org">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/aymericzip/intlayer/main/docs/assets/cover.png" width="60%" alt="Intlayer 标志" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<h1 align="center">
|
|
8
|
+
<strong> Intlayer:一个开源、灵活的国际化工具包,集成了 AI 驱动的翻译和内容管理系统(CMS)。</strong>
|
|
9
|
+
</h1>
|
|
10
|
+
|
|
11
|
+
<br />
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://intlayer.org/doc/concept/content">文档</a> •
|
|
15
|
+
<a href="https://intlayer.org/doc/environment/nextjs">Next.js</a> •
|
|
16
|
+
<a href="https://intlayer.org/doc/environment/vite-and-react">React + Vite</a> •
|
|
17
|
+
<a href="https://intlayer.org/doc/concept/cms">内容管理系统(CMS)</a> •
|
|
18
|
+
<a href="https://discord.gg/7uxamYVeCk">Discord</a>
|
|
19
|
+
</p>
|
|
20
|
+
<p align="center" style="margin-top:15px;">
|
|
21
|
+
<a href="https://www.npmjs.com/package/intlayer" target="_blank"><img src="https://img.shields.io/npm/v/intlayer?style=for-the-badge&labelColor=FFFFFF&color=000000&logoColor=FFFFFF" alt="npm 版本" height="24"/>
|
|
22
|
+
</a>
|
|
23
|
+
<a href="https://github.com/aymericzip/intlayer/stargazers" target="_blank"><img src="https://img.shields.io/github/stars/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logo=github&logoColor=FFD700" alt="GitHub 星标" height="24"/>
|
|
24
|
+
</a>
|
|
25
|
+
<a href="https://www.npmjs.org/package/intlayer" target="_blank"><img src="https://img.shields.io/npm/dm/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000" alt="月下载量" height="24"/>
|
|
26
|
+
</a>
|
|
27
|
+
<a href="https://github.com/aymericzip/intlayer/blob/main/LICENSE"><img src="https://img.shields.io/github/license/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000" alt="许可证"/>
|
|
28
|
+
</a>
|
|
29
|
+
<a href="https://github.com/aymericzip/intlayer/commits/main"><img src="https://img.shields.io/github/last-commit/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000" alt="最新提交"/>
|
|
30
|
+
</a>
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
<a href="https://intlayer.org/doc/concept/content">
|
|
36
|
+
<img src="https://img.shields.io/badge/开始使用-FFFFFF?style=for-the-badge&logo=rocket&logoColor=black" />
|
|
37
|
+
</a>
|
|
38
|
+
|
|
39
|
+
## 什么是 Intlayer?
|
|
40
|
+
|
|
41
|
+
大多数国际化(i18n)库要么过于复杂,要么过于僵硬,或者不适用于现代框架。
|
|
42
|
+
|
|
43
|
+
Intlayer 是一个面向网页和移动应用的**现代国际化解决方案**。
|
|
44
|
+
它与框架无关,**由人工智能驱动**,并且包含免费的**内容管理系统(CMS)和可视化编辑器**。
|
|
45
|
+
|
|
46
|
+
通过**按语言区分的内容文件**、**TypeScript 自动补全**、**可摇树的词典**以及**CI/CD 集成**,Intlayer 让国际化变得更**快速、简洁和智能**。
|
|
47
|
+
|
|
48
|
+
## Intlayer 的主要优势:
|
|
49
|
+
|
|
50
|
+
| 功能 | 描述 |
|
|
51
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
52
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/frameworks.png?raw=true" alt="功能" width="700"> | **跨框架支持**<br><br>Intlayer 兼容所有主流框架和库,包括 Next.js、React、Vite、Vue.js、Nuxt、Preact、Express 等。 |
|
|
53
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.png?raw=true" alt="Feature" width="700"> | **基于JavaScript的内容管理**<br><br>利用JavaScript的灵活性高效地定义和管理您的内容。<br><br> - [内容声明](https://intlayer.org/doc/concept/content) |
|
|
54
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/per_locale_content_declaration_file.png?raw=true" alt="Feature" width="700"> | **每语言内容声明文件**<br><br>通过在自动生成之前只声明一次内容,加快您的开发速度。<br><br> - [每语言内容声明文件](https://intlayer.org/doc/concept/per-locale-file) |
|
|
55
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true" alt="Feature" width="700"> | **类型安全环境**<br><br>利用 TypeScript 确保您的内容定义和代码无错误,同时享受 IDE 自动补全的便利。<br><br> - [TypeScript 配置](https://intlayer.org/doc/environment/vite-and-react#configure-typescript) |
|
|
56
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/config_file.png?raw=true" alt="功能" width="700"> | **简化设置**<br><br>通过最少的配置快速启动。轻松调整国际化、路由、AI、构建和内容处理的设置。<br><br> - [探索 Next.js 集成](https://intlayer.org/doc/environment/nextjs) |
|
|
57
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/content_retrieval.png?raw=true" alt="功能" width="700"> | **简化的内容获取**<br><br>无需为每一条内容调用 `t` 函数。使用单一钩子即可直接获取所有内容。<br><br> - [React 集成](https://intlayer.org/doc/environment/create-react-app) |
|
|
58
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/server_component.png?raw=true" alt="Feature" width="700"> | **一致的服务器组件实现**<br><br>完美适用于 Next.js 服务器组件,客户端和服务器组件使用相同的实现,无需在每个服务器组件之间传递你的 `t` 函数。<br><br> - [服务器组件](https://intlayer.org/doc/environment/nextjs#step-7-utilize-content-in-your-code) |
|
|
59
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/file_tree.png?raw=true" alt="Feature" width="700"> | **有序的代码库**<br><br>保持代码库更有条理:1 个组件 = 同一文件夹中的 1 个字典。翻译内容靠近各自的组件,提升可维护性和清晰度。<br><br> - [Intlayer 如何工作](https://intlayer.org/doc/concept/how-works-intlayer) |
|
|
60
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/url_routing.png?raw=true" alt="功能" width="700"> | **增强的路由功能**<br><br>全面支持应用路由,能够无缝适应复杂的应用结构,适用于 Next.js、React、Vite、Vue.js 等框架。<br><br> - [探索 Next.js 集成](https://intlayer.org/doc/environment/nextjs) |
|
|
61
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/markdown.png?raw=true" alt="Feature" width="700"> | **Markdown 支持**<br><br>导入并解析本地文件和远程 Markdown,用于多语言内容,如隐私政策、文档等。解析并使 Markdown 元数据在代码中可访问。<br><br> - [内容文件](https://intlayer.org/doc/concept/content/file) |
|
|
62
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/visual_editor.png?raw=true" alt="Feature" width="700"> | **免费可视化编辑器和内容管理系统(CMS)**<br><br>为内容创作者提供免费的可视化编辑器和内容管理系统,免去了使用本地化平台的需求。通过 Git 保持内容同步,或使用 CMS 完全或部分外部化内容。<br><br> - [Intlayer 编辑器](https://intlayer.org/doc/concept/editor) <br> - [Intlayer CMS](https://intlayer.org/doc/concept/cms) |
|
|
63
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/bundle.png?raw=true" alt="Feature" width="700"> | **可摇树内容**<br><br>可摇树内容,减少最终包的大小。按组件加载内容,排除包中未使用的内容。支持懒加载以提升应用加载效率。<br><br> - [应用构建优化](https://intlayer.org/doc/concept/how-works-intlayer#app-build-optimization) |
|
|
64
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/static_rendering.png?raw=true" alt="Feature" width="700"> | **静态渲染**<br><br>不会阻塞静态渲染。<br><br> - [Next.js 集成](https://intlayer.org/doc/environment/nextjs) |
|
|
65
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/AI_translation.png?raw=true" alt="Feature" width="700"> | **AI 驱动的翻译**<br><br>使用 Intlayer 先进的 AI 驱动翻译工具,结合您自己的 AI 提供商 / API 密钥,只需一键即可将您的网站转换为 231 种语言。<br><br> - [CI/CD 集成](https://intlayer.org/doc/concept/ci-cd) <br> - [Intlayer CLI](https://intlayer.org/doc/concept/cli) <br> - [自动填充](https://intlayer.org/doc/concept/auto-fill) |
|
|
66
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/mcp.png?raw=true" alt="Feature" width="700"> | **MCP 服务器集成**<br><br>提供一个 MCP(模型上下文协议)服务器,用于 IDE 自动化,使内容管理和国际化工作流程能够直接在您的开发环境中无缝进行。<br><br> - [MCP 服务器](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/mcp_server.md) |
|
|
67
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/vscode_extension.png?raw=true" alt="Feature" width="700"> | **VSCode 扩展**<br><br>Intlayer 提供了一个 VSCode 扩展,帮助您管理内容和翻译,构建词典,翻译内容等。<br><br> - [VSCode 扩展](https://intlayer.org/doc/zh/vs-code-extension) |
|
|
68
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/interoperability.png?raw=true" alt="Feature" width="700"> | **互操作性**<br><br>支持与 react-i18next、next-i18next、next-intl 和 react-intl 的互操作。<br><br> - [Intlayer 与 react-intl](https://intlayer.org/blog/intlayer-with-react-intl) <br> - [Intlayer 与 next-intl](https://intlayer.org/blog/intlayer-with-next-intl) <br> - [Intlayer 与 next-i18next](https://intlayer.org/blog/intlayer-with-next-i18next) |
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 📦 安装
|
|
73
|
+
|
|
74
|
+
今天就开始使用 Intlayer,体验更顺畅、更强大的国际化方式。
|
|
75
|
+
|
|
76
|
+
<a href="https://intlayer.org/doc/concept/content">
|
|
77
|
+
<img src="https://img.shields.io/badge/Get_Started-FFFFFF?style=for-the-badge&logo=rocket&logoColor=black" />
|
|
78
|
+
</a>
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm install intlayer react-intlayer
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
⚡ 快速开始 (Next.js)
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
// intlayer.config.ts
|
|
88
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
89
|
+
|
|
90
|
+
const config: IntlayerConfig = {
|
|
91
|
+
internationalization: {
|
|
92
|
+
locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
|
|
93
|
+
defaultLocale: Locales.ENGLISH,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default config;
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
// app/page.tsx
|
|
102
|
+
import { useIntlayer } from "react-intlayer";
|
|
103
|
+
|
|
104
|
+
const Component = () => {
|
|
105
|
+
const { title } = useIntlayer("home");
|
|
106
|
+
|
|
107
|
+
return <h1>{title}</h1>;
|
|
108
|
+
};
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
<a href="https://intlayer.org/doc/environment/nextjs"> 获取完整指南 → </a>
|
|
112
|
+
|
|
113
|
+
## 🎥 YouTube 直播教程
|
|
114
|
+
|
|
115
|
+
[](https://youtu.be/e_PPG7PTqGU?si=GyU_KpVhr61razRw)
|
|
116
|
+
|
|
117
|
+
<a href="https://intlayer.org/doc/concept/content">
|
|
118
|
+
<img src="https://img.shields.io/badge/Get_Started-FFFFFF?style=for-the-badge&logo=rocket&logoColor=black" />
|
|
119
|
+
</a>
|
|
120
|
+
|
|
121
|
+
## 目录
|
|
122
|
+
|
|
123
|
+
探索我们全面的文档,开始使用 Intlayer 并学习如何将其集成到您的项目中。
|
|
124
|
+
|
|
125
|
+
<details open>
|
|
126
|
+
<summary style="font-size:16px; font-weight:bold;">📘 入门指南</summary>
|
|
127
|
+
<ul>
|
|
128
|
+
<li><a href="https://intlayer.org/doc/why">为什么选择 Intlayer?</a></li>
|
|
129
|
+
<li><a href="https://intlayer.org/doc">介绍</a></li>
|
|
130
|
+
</ul>
|
|
131
|
+
</details>
|
|
132
|
+
|
|
133
|
+
<details>
|
|
134
|
+
<summary style="font-size:16px; font-weight:bold;">⚙️ 概念</summary>
|
|
135
|
+
<ul>
|
|
136
|
+
<li><a href="https://intlayer.org/doc/concept/how-works-intlayer">Intlayer 如何工作</a></li>
|
|
137
|
+
<li><a href="https://intlayer.org/doc/concept/configuration">配置</a></li>
|
|
138
|
+
<li><a href="https://intlayer.org/doc/concept/ai">AI 提供者</a></li>
|
|
139
|
+
<li><a href="https://intlayer.org/doc/concept/cli">Intlayer CLI</a></li>
|
|
140
|
+
<li><a href="https://intlayer.org/doc/concept/editor">Intlayer 编辑器</a></li>
|
|
141
|
+
<li><a href="https://intlayer.org/doc/concept/cms">Intlayer CMS</a></li>
|
|
142
|
+
<li><a href="https://intlayer.org/doc/concept/content">词典</a>
|
|
143
|
+
<ul>
|
|
144
|
+
<li><a href="https://intlayer.org/doc/concept/content/per-locale-file">每语言内容声明文件</a></li>
|
|
145
|
+
<li><a href="https://intlayer.org/doc/concept/content/translation">翻译</a></li>
|
|
146
|
+
<li><a href="https://intlayer.org/doc/concept/content/enumeration">枚举</a></li>
|
|
147
|
+
<li><a href="https://intlayer.org/doc/concept/content/condition">条件</a></li>
|
|
148
|
+
<li><a href="https://intlayer.org/doc/concept/content/nesting">嵌套</a></li>
|
|
149
|
+
<li><a href="https://intlayer.org/doc/concept/content/markdown">Markdown</a></li>
|
|
150
|
+
<li><a href="https://intlayer.org/doc/concept/content/function-fetching">函数获取</a></li>
|
|
151
|
+
<li><a href="https://intlayer.org/doc/concept/content/insertion">插入</a></li>
|
|
152
|
+
<li><a href="https://intlayer.org/doc/concept/content/file">文件</a></li>
|
|
153
|
+
</ul>
|
|
154
|
+
</li>
|
|
155
|
+
</ul>
|
|
156
|
+
</details>
|
|
157
|
+
|
|
158
|
+
<details open>
|
|
159
|
+
<summary style="font-size:16px; font-weight:bold;">🌐 环境</summary>
|
|
160
|
+
<ul>
|
|
161
|
+
<li><a href="https://intlayer.org/doc/environment/nextjs">Intlayer 与 Next.js 15</a>
|
|
162
|
+
<ul>
|
|
163
|
+
<li><a href="https://intlayer.org/doc/environment/nextjs/14">Next.js 14(应用路由)</a></li>
|
|
164
|
+
<li><a href="https://intlayer.org/doc/environment/nextjs/next-with-Page-Router">Next.js 页面路由</a></li>
|
|
165
|
+
</ul>
|
|
166
|
+
</li>
|
|
167
|
+
<li><a href="https://intlayer.org/doc/environment/create-react-app">React CRA</a></li>
|
|
168
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-react">Vite + React</a>
|
|
169
|
+
<ul>
|
|
170
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-react/react-router-v7">React-router-v7</a></li>
|
|
171
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-react/tanstack-start">Tanstack 入门</a></li>
|
|
172
|
+
</ul>
|
|
173
|
+
</li>
|
|
174
|
+
<li><a href="https://intlayer.org/doc/environment/react-native-and-expo">React Native</a></li>
|
|
175
|
+
<li><a href="https://intlayer.org/doc/environment/lynx-and-react">Lynx + React</a></li>
|
|
176
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-svelte">Vite + Svelte</a></li>
|
|
177
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-preact">Vite + Preact</a></li>
|
|
178
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-vue">Vite + Vue</a></li>
|
|
179
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-nuxt">Vite + Nuxt</a></li>
|
|
180
|
+
<li><a href="https://intlayer.org/doc/environment/vite-and-solid">Vite + Solid</a></li>
|
|
181
|
+
<li><a href="https://intlayer.org/doc/environment/angular">Angular</a></li>
|
|
182
|
+
<li><a href="https://intlayer.org/doc/environment/express">Express</a></li>
|
|
183
|
+
<li><a href="https://intlayer.org/doc/environment/nest">NestJS</a></li>
|
|
184
|
+
</ul>
|
|
185
|
+
</details>
|
|
186
|
+
|
|
187
|
+
<details>
|
|
188
|
+
<summary style="font-size:16px; font-weight:bold;">📰 博客</summary>
|
|
189
|
+
<ul>
|
|
190
|
+
<li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/blog/zh/what_is_internationalization.md">什么是国际化 (i18n)</a></li>
|
|
191
|
+
<li><a href="https://intlayer.org/blog/SEO-and-i18n">i18n 与 SEO</a></li>
|
|
192
|
+
<li><a href="https://intlayer.org/blog/intlayer-with-next-i18next">Intlayer 与 i18next</a></li>
|
|
193
|
+
<li><a href="https://intlayer.org/blog/intlayer-with-react-i18next">Intlayer 与 react-intl</a></li>
|
|
194
|
+
<li><a href="https://intlayer.org/blog/intlayer-with-next-intl">Intlayer 与 next-intl</a></li>
|
|
195
|
+
</ul>
|
|
196
|
+
</details>
|
|
197
|
+
|
|
198
|
+
## 🌐 其他语言的自述文件
|
|
199
|
+
|
|
200
|
+
[English](https://github.com/aymericzip/intlayer/blob/main/readme.md) •
|
|
201
|
+
[简体中文](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/readme.md) •
|
|
202
|
+
[Русский](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/readme.md) •
|
|
203
|
+
[日本語](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/readme.md) •
|
|
204
|
+
[Français](https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/readme.md) •
|
|
205
|
+
[한국어](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/readme.md) •
|
|
206
|
+
[Español](https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/readme.md) •
|
|
207
|
+
[德语](https://github.com/aymericzip/intlayer/blob/main/docs/docs/de/readme.md) •
|
|
208
|
+
[阿拉伯语](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/readme.md) •
|
|
209
|
+
[意大利语](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/readme.md) •
|
|
210
|
+
[英语(英国)](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/readme.md) •
|
|
211
|
+
[葡萄牙语](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/readme.md) •
|
|
212
|
+
[印地语](https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/readme.md)
|
|
213
|
+
[土耳其语](https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/readme.md)
|
|
214
|
+
|
|
215
|
+
## 🤝 社区
|
|
216
|
+
|
|
217
|
+
Intlayer 是为社区而建,也由社区共同打造,我们非常欢迎您的反馈!
|
|
218
|
+
|
|
219
|
+
- 有建议?[提出问题](https://github.com/aymericzip/intlayer/issues)
|
|
220
|
+
- 发现了漏洞或改进建议?[提交一个 PR](https://github.com/aymericzip/intlayer/pulls)
|
|
221
|
+
- 需要帮助或想要交流?[加入我们的 Discord](https://discord.gg/7uxamYVeCk)
|
|
222
|
+
|
|
223
|
+
你也可以关注我们:
|
|
224
|
+
|
|
225
|
+
<div>
|
|
226
|
+
<br/>
|
|
227
|
+
<p align="center">
|
|
228
|
+
<a href="https://discord.gg/528mBV4N" target="blank"><img align="center"
|
|
229
|
+
src="https://img.shields.io/badge/discord-5865F2.svg?style=for-the-badge&logo=discord&logoColor=white"
|
|
230
|
+
alt="Intlayer Discord" height="30"/></a>
|
|
231
|
+
<a href="https://www.linkedin.com/company/intlayerorg" target="blank"><img align="center"
|
|
232
|
+
src="https://img.shields.io/badge/linkedin-%231DA1F2.svg?style=for-the-badge&logo=linkedin&logoColor=white"
|
|
233
|
+
alt="Intlayer LinkedIn" height="30"/></a>
|
|
234
|
+
<a href="https://www.facebook.com/intlayer" target="blank"><img align="center"
|
|
235
|
+
src="https://img.shields.io/badge/facebook-4267B2.svg?style=for-the-badge&logo=facebook&logoColor=white"
|
|
236
|
+
alt="Intlayer 脸书" height="30"/></a>
|
|
237
|
+
<a href="https://www.instagram.com/intlayer/" target="blank"><img align="center"
|
|
238
|
+
src="https://img.shields.io/badge/instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white"
|
|
239
|
+
alt="Intlayer Instagram" height="30"/></a>
|
|
240
|
+
<a href="https://x.com/Intlayer183096" target="blank"><img align="center"
|
|
241
|
+
src="https://img.shields.io/badge/x-1DA1F2.svg?style=for-the-badge&logo=x&logoColor=white"
|
|
242
|
+
alt="Intlayer X" height="30"/></a>
|
|
243
|
+
<a href="https://www.youtube.com/@intlayer" target="blank"><img align="center"
|
|
244
|
+
src="https://img.shields.io/badge/youtube-FF0000.svg?style=for-the-badge&logo=youtube&logoColor=white"
|
|
245
|
+
alt="Intlayer YouTube" height="30"/></a>
|
|
246
|
+
<a href="https://www.tiktok.com/@intlayer" target="blank"><img align="center"
|
|
247
|
+
src="https://img.shields.io/badge/tiktok-000000.svg?style=for-the-badge&logo=tiktok&logoColor=white"
|
|
248
|
+
alt="Intlayer TikTok" height="30"/></a>
|
|
249
|
+
<br>
|
|
250
|
+
</p>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
### 贡献
|
|
254
|
+
|
|
255
|
+
有关贡献本项目的更详细指南,请参阅 [`CONTRIBUTING.md`](https://github.com/aymericzip/intlayer/blob/main/CONTRIBUTING.md) 文件。该文件包含了我们开发流程、提交信息规范以及发布流程的关键信息。您的贡献对我们非常重要,我们感谢您为改进本项目所做的努力!
|
|
256
|
+
|
|
257
|
+
### 感谢您的支持
|
|
258
|
+
|
|
259
|
+
如果您喜欢 Intlayer,请在 GitHub 上给我们一个⭐。这将帮助更多人发现该项目!
|
|
260
|
+
|
|
261
|
+
[](https://star-history.com/#aymericzip/intlayer&Date)
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-03-01
|
|
3
|
+
updatedAt: 2025-09-20
|
|
4
|
+
title: 测试您的内容
|
|
5
|
+
description: 了解如何使用 Intlayer 测试您的内容。
|
|
6
|
+
keywords:
|
|
7
|
+
- 测试
|
|
8
|
+
- Intlayer
|
|
9
|
+
- 国际化
|
|
10
|
+
- CMS
|
|
11
|
+
- 内容管理系统
|
|
12
|
+
- 可视化编辑器
|
|
13
|
+
slugs:
|
|
14
|
+
- doc
|
|
15
|
+
- testing
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# 测试您的内容
|
|
19
|
+
|
|
20
|
+
本指南展示了如何自动验证您的字典是否完整,在发布前捕获缺失的翻译,并测试您应用中的本地化 UI。
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 您可以测试的内容
|
|
25
|
+
|
|
26
|
+
- **缺失的翻译**:如果任何字典缺少必需的语言环境,则使 CI 失败。
|
|
27
|
+
- **本地化 UI 渲染**:使用特定的语言环境提供者渲染组件,并断言可见的文本/属性。
|
|
28
|
+
- **构建时审计**:通过 CLI 在本地运行快速审计。
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 快速开始:通过 CLI 审计
|
|
33
|
+
|
|
34
|
+
从您的项目根目录运行审计:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx intlayer content test
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
有用的参数:
|
|
41
|
+
|
|
42
|
+
- `--env-file [路径]`:从文件加载环境变量。
|
|
43
|
+
- `-e, --env [名称]`:选择环境配置。
|
|
44
|
+
- `--base-dir [路径]`:设置应用的基础目录以进行解析。
|
|
45
|
+
- `--verbose`:显示详细日志。
|
|
46
|
+
- `--prefix [标签]`:为日志行添加前缀。
|
|
47
|
+
|
|
48
|
+
注意:CLI 会打印详细报告,但在失败时不会以非零状态退出。对于 CI 门控,请添加下面的单元测试,断言没有缺失的必需语言环境。
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 编程测试(Vitest/Jest)
|
|
53
|
+
|
|
54
|
+
使用 Intlayer CLI API 断言您的必需语言环境没有缺失的翻译。
|
|
55
|
+
|
|
56
|
+
```ts file=i18n.test.ts
|
|
57
|
+
/* @vitest-environment node */
|
|
58
|
+
import { listMissingTranslations } from "intlayer/cli";
|
|
59
|
+
import { describe, expect, it } from "vitest";
|
|
60
|
+
|
|
61
|
+
describe("翻译", () => {
|
|
62
|
+
it("没有缺失的必需语言环境", () => {
|
|
63
|
+
const result = listMissingTranslations();
|
|
64
|
+
|
|
65
|
+
if (result.missingRequiredLocales.length > 0) {
|
|
66
|
+
// 当测试在本地或CI中失败时,这很有帮助
|
|
67
|
+
console.log(result.missingTranslations);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
expect(result.missingRequiredLocales).toHaveLength(0);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Jest 等效代码:
|
|
76
|
+
|
|
77
|
+
```ts file=i18n.test.ts
|
|
78
|
+
import { listMissingTranslations } from "intlayer/cli";
|
|
79
|
+
|
|
80
|
+
test("没有缺失的必需语言环境", () => {
|
|
81
|
+
const result = listMissingTranslations();
|
|
82
|
+
|
|
83
|
+
if (result.missingRequiredLocales.length > 0) {
|
|
84
|
+
// eslint-disable-next-line no-console
|
|
85
|
+
console.log(result.missingTranslations);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
expect(result.missingRequiredLocales).toHaveLength(0);
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
工作原理:
|
|
93
|
+
|
|
94
|
+
- Intlayer 读取您的配置(locales、requiredLocales)和声明的字典,然后报告:
|
|
95
|
+
- `missingTranslations`:按键,缺失了哪些语言及其对应的文件。
|
|
96
|
+
- `missingLocales`:所有缺失语言的合集。
|
|
97
|
+
- `missingRequiredLocales`:限制为 `requiredLocales` 的子集(如果未设置 `requiredLocales`,则为所有语言)。
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 测试本地化 UI(React / Next.js)
|
|
102
|
+
|
|
103
|
+
在 Intlayer 提供者下渲染组件,并断言可见内容。
|
|
104
|
+
|
|
105
|
+
React 示例(Testing Library):
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import { IntlayerProvider } from "react-intlayer/client";
|
|
109
|
+
import { render, screen } from "@testing-library/react";
|
|
110
|
+
import { MyComponent } from "./MyComponent";
|
|
111
|
+
|
|
112
|
+
test("renders localized title in English", () => {
|
|
113
|
+
render(
|
|
114
|
+
<IntlayerProvider locale="en-US">
|
|
115
|
+
<MyComponent />
|
|
116
|
+
</IntlayerProvider>
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
expect(screen.getByText("预期的英文标题")).toBeInTheDocument();
|
|
120
|
+
});
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Next.js(App Router)示例:使用框架包装器:
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
import { IntlayerClientProvider } from "next-intlayer/client";
|
|
127
|
+
import { render, screen } from "@testing-library/react";
|
|
128
|
+
import { MyPage } from "./MyPage";
|
|
129
|
+
|
|
130
|
+
test("渲染法语本地化标题", () => {
|
|
131
|
+
render(
|
|
132
|
+
<IntlayerClientProvider locale="fr-FR">
|
|
133
|
+
<MyPage />
|
|
134
|
+
</IntlayerClientProvider>
|
|
135
|
+
);
|
|
136
|
+
expect(screen.getByRole("heading", { name: "预期标题" })).toBeInTheDocument();
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
提示:
|
|
141
|
+
|
|
142
|
+
- 当你需要属性的原始字符串值(例如 `aria-label`)时,可以访问 React 中 `useIntlayer` 返回的 `.value` 字段。
|
|
143
|
+
- 将字典与组件放在一起,便于单元测试和清理。
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 持续集成
|
|
148
|
+
|
|
149
|
+
添加一个测试,当缺少必需的翻译时使构建失败。
|
|
150
|
+
|
|
151
|
+
`package.json`:
|
|
152
|
+
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"scripts": {
|
|
156
|
+
"test:i18n": "vitest run -c"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
GitHub Actions 示例:
|
|
162
|
+
|
|
163
|
+
```yaml
|
|
164
|
+
name: CI
|
|
165
|
+
on: [push, pull_request]
|
|
166
|
+
jobs:
|
|
167
|
+
test:
|
|
168
|
+
runs-on: ubuntu-latest
|
|
169
|
+
steps:
|
|
170
|
+
- uses: actions/checkout@v4
|
|
171
|
+
- uses: actions/setup-node@v4
|
|
172
|
+
with:
|
|
173
|
+
node-version: 20
|
|
174
|
+
- run: npm ci
|
|
175
|
+
- run: npm run test:i18n
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
可选:在测试的同时运行 CLI 审计以获得人类可读的摘要:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npx intlayer content test --verbose
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 故障排除
|
|
187
|
+
|
|
188
|
+
- 确保您的 Intlayer 配置定义了 `locales` 和(可选的)`requiredLocales`。
|
|
189
|
+
- 如果您的应用使用动态或远程字典,请在字典可用的环境中运行测试。
|
|
190
|
+
- 对于混合的 monorepos,使用 `--base-dir` 指定 CLI 指向正确的应用根目录。
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 文档历史
|
|
195
|
+
|
|
196
|
+
| 版本 | 日期 | 变更说明 |
|
|
197
|
+
| ----- | ---------- | ------------ |
|
|
198
|
+
| 6.0.0 | 2025-09-20 | 引入测试功能 |
|