@intlayer/docs 5.5.11 → 5.6.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/intlayer_with_next-intl.md +0 -1
- package/blog/ar/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/ar/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/ar/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/ar/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/ar/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/ar/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/ar/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/ar/what_is_internationalization.md +2 -2
- package/blog/de/intlayer_with_next-intl.md +0 -1
- package/blog/de/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/de/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/de/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/de/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/de/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/de/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/de/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/de/what_is_internationalization.md +2 -2
- package/blog/en/intlayer_with_next-intl.md +0 -1
- package/blog/en/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/en/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/en/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/en/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/en/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/en/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/en/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/en/what_is_internationalization.md +2 -2
- package/blog/en-GB/intlayer_with_next-intl.md +0 -1
- package/blog/en-GB/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/en-GB/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/en-GB/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/en-GB/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/en-GB/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/en-GB/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/en-GB/what_is_internationalization.md +2 -2
- package/blog/es/intlayer_with_next-intl.md +0 -1
- package/blog/es/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/es/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/es/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/es/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/es/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/es/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/es/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/es/what_is_internationalization.md +2 -2
- package/blog/fr/intlayer_with_next-intl.md +0 -1
- package/blog/fr/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/fr/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/fr/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/fr/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/fr/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/fr/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/fr/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/fr/what_is_internationalization.md +2 -2
- package/blog/hi/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/hi/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/hi/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/hi/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/hi/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/hi/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/hi/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/hi/what_is_internationalization.md +2 -2
- package/blog/it/intlayer_with_next-intl.md +0 -1
- package/blog/it/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/it/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/it/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/it/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/it/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/it/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/it/what_is_internationalization.md +2 -2
- package/blog/ja/intlayer_with_next-intl.md +0 -1
- package/blog/ja/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/ja/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/ja/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/ja/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/ja/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/ja/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/ja/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/ja/what_is_internationalization.md +2 -2
- package/blog/ko/intlayer_with_next-intl.md +0 -1
- package/blog/ko/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/ko/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/ko/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/ko/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/ko/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/pt/intlayer_with_next-intl.md +0 -1
- package/blog/pt/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/pt/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/pt/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/pt/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/pt/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/pt/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/pt/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/pt/what_is_internationalization.md +2 -2
- package/blog/ru/intlayer_with_next-intl.md +0 -1
- package/blog/ru/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/ru/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/ru/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/ru/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/ru/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/ru/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/ru/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/ru/what_is_internationalization.md +2 -2
- package/blog/zh/intlayer_with_next-intl.md +0 -1
- package/blog/zh/list_i18n_technologies/CMS/wordpress.md +1 -1
- package/blog/zh/list_i18n_technologies/frameworks/angular.md +1 -1
- package/blog/zh/list_i18n_technologies/frameworks/flutter.md +1 -1
- package/blog/zh/list_i18n_technologies/frameworks/react-native.md +1 -1
- package/blog/zh/list_i18n_technologies/frameworks/react.md +1 -1
- package/blog/zh/list_i18n_technologies/frameworks/svelte.md +1 -1
- package/blog/zh/list_i18n_technologies/frameworks/vue.md +1 -1
- package/blog/zh/what_is_internationalization.md +2 -2
- package/dist/cjs/blog.cjs +2 -2
- package/dist/cjs/blog.cjs.map +1 -1
- package/dist/cjs/common.cjs +17 -6
- package/dist/cjs/common.cjs.map +1 -1
- package/dist/cjs/doc.cjs +2 -2
- package/dist/cjs/doc.cjs.map +1 -1
- package/dist/cjs/frequentQuestions.cjs +2 -2
- package/dist/cjs/frequentQuestions.cjs.map +1 -1
- package/dist/cjs/generated/blog.entry.cjs +1152 -252
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +3778 -1124
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +794 -161
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +32 -31
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/cjs/legal.cjs +2 -2
- package/dist/cjs/legal.cjs.map +1 -1
- package/dist/esm/blog.mjs +2 -2
- package/dist/esm/blog.mjs.map +1 -1
- package/dist/esm/common.mjs +17 -6
- package/dist/esm/common.mjs.map +1 -1
- package/dist/esm/doc.mjs +2 -2
- package/dist/esm/doc.mjs.map +1 -1
- package/dist/esm/frequentQuestions.mjs +2 -2
- package/dist/esm/frequentQuestions.mjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +1151 -252
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +3777 -1124
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/esm/generated/frequentQuestions.entry.mjs +793 -161
- package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
- package/dist/esm/generated/legal.entry.mjs +31 -31
- package/dist/esm/generated/legal.entry.mjs.map +1 -1
- package/dist/esm/legal.mjs +2 -2
- package/dist/esm/legal.mjs.map +1 -1
- package/dist/types/blog.d.ts +2 -2
- package/dist/types/blog.d.ts.map +1 -1
- package/dist/types/common.d.ts +5 -2
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/doc.d.ts +2 -2
- package/dist/types/doc.d.ts.map +1 -1
- package/dist/types/frequentQuestions.d.ts +2 -2
- package/dist/types/frequentQuestions.d.ts.map +1 -1
- package/dist/types/generated/blog.entry.d.ts.map +1 -1
- 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/dist/types/legal.d.ts +2 -2
- package/dist/types/legal.d.ts.map +1 -1
- package/docs/ar/intlayer_CMS.md +1 -0
- package/docs/ar/intlayer_cli.md +292 -177
- package/docs/ar/intlayer_visual_editor.md +1 -0
- package/docs/ar/intlayer_with_angular.md +1 -0
- package/docs/ar/intlayer_with_create_react_app.md +1 -0
- package/docs/ar/intlayer_with_lynx+react.md +1 -0
- package/docs/ar/intlayer_with_nextjs_14.md +1 -0
- package/docs/ar/intlayer_with_nextjs_15.md +3 -1
- package/docs/ar/intlayer_with_nuxt.md +1 -0
- package/docs/ar/intlayer_with_react_native+expo.md +1 -0
- package/docs/ar/intlayer_with_vite+preact.md +4 -3
- package/docs/ar/intlayer_with_vite+react.md +108 -112
- package/docs/ar/intlayer_with_vite+solid.md +4 -3
- package/docs/ar/intlayer_with_vite+svelte.md +4 -3
- package/docs/ar/intlayer_with_vite+vue.md +5 -4
- package/docs/ar/mcp_server.md +126 -92
- package/docs/de/intlayer_CMS.md +1 -0
- package/docs/de/intlayer_cli.md +291 -171
- package/docs/de/intlayer_visual_editor.md +1 -0
- package/docs/de/intlayer_with_angular.md +1 -0
- package/docs/de/intlayer_with_create_react_app.md +1 -0
- package/docs/de/intlayer_with_lynx+react.md +1 -0
- package/docs/de/intlayer_with_nextjs_14.md +1 -0
- package/docs/de/intlayer_with_nextjs_15.md +3 -1
- package/docs/de/intlayer_with_nuxt.md +1 -0
- package/docs/de/intlayer_with_react_native+expo.md +1 -0
- package/docs/de/intlayer_with_vite+preact.md +4 -3
- package/docs/de/intlayer_with_vite+react.md +128 -146
- package/docs/de/intlayer_with_vite+solid.md +4 -3
- package/docs/de/intlayer_with_vite+svelte.md +4 -3
- package/docs/de/intlayer_with_vite+vue.md +5 -4
- package/docs/de/mcp_server.md +116 -112
- package/docs/en/CI_CD.md +3 -1
- package/docs/en/autoFill.md +3 -1
- package/docs/en/configuration.md +7 -3
- package/docs/en/dictionary/condition.md +3 -1
- package/docs/en/dictionary/content_extention_customization.md +3 -1
- package/docs/en/dictionary/enumeration.md +3 -1
- package/docs/en/dictionary/file.md +3 -1
- package/docs/en/dictionary/function_fetching.md +3 -1
- package/docs/en/dictionary/get_started.md +3 -1
- package/docs/en/dictionary/insertion.md +3 -1
- package/docs/en/dictionary/markdown.md +3 -1
- package/docs/en/dictionary/nesting.md +3 -1
- package/docs/en/dictionary/translation.md +3 -1
- package/docs/en/how_works_intlayer.md +3 -1
- package/docs/en/index.md +3 -1
- package/docs/en/interest_of_intlayer.md +3 -1
- package/docs/en/intlayer_CMS.md +4 -1
- package/docs/en/intlayer_cli.md +246 -136
- package/docs/en/intlayer_visual_editor.md +4 -1
- package/docs/en/intlayer_with_angular.md +4 -1
- package/docs/en/intlayer_with_create_react_app.md +4 -1
- package/docs/en/intlayer_with_express.md +3 -1
- package/docs/en/intlayer_with_lynx+react.md +4 -1
- package/docs/en/intlayer_with_nextjs_14.md +7 -1
- package/docs/en/intlayer_with_nextjs_15.md +8 -2
- package/docs/en/intlayer_with_nextjs_page_router.md +5 -1
- package/docs/en/intlayer_with_nuxt.md +4 -1
- package/docs/en/intlayer_with_react_native+expo.md +4 -1
- package/docs/en/intlayer_with_vite+preact.md +9 -4
- package/docs/en/intlayer_with_vite+react.md +18 -10
- package/docs/en/intlayer_with_vite+solid.md +7 -4
- package/docs/en/intlayer_with_vite+svelte.md +7 -4
- package/docs/en/intlayer_with_vite+vue.md +10 -5
- package/docs/en/introduction.md +3 -1
- package/docs/en/mcp_server.md +114 -80
- package/docs/en/packages/@intlayer/api/index.md +3 -1
- package/docs/en/packages/@intlayer/chokidar/index.md +3 -1
- package/docs/en/packages/@intlayer/cli/index.md +3 -1
- package/docs/en/packages/@intlayer/config/index.md +3 -1
- package/docs/en/packages/@intlayer/core/index.md +3 -1
- package/docs/en/packages/@intlayer/design-system/index.md +3 -1
- package/docs/en/packages/@intlayer/dictionary-entry/index.md +3 -1
- package/docs/en/packages/@intlayer/editor/index.md +3 -1
- package/docs/en/packages/@intlayer/editor-react/index.md +3 -1
- package/docs/en/packages/@intlayer/webpack/index.md +3 -1
- package/docs/en/packages/angular-intlayer/index.md +3 -1
- package/docs/en/packages/express-intlayer/index.md +3 -1
- package/docs/en/packages/express-intlayer/t.md +3 -1
- package/docs/en/packages/intlayer/getConfiguration.md +3 -1
- package/docs/en/packages/intlayer/getEnumeration.md +3 -1
- package/docs/en/packages/intlayer/getHTMLTextDir.md +3 -1
- package/docs/en/packages/intlayer/getLocaleLang.md +3 -1
- package/docs/en/packages/intlayer/getLocaleName.md +3 -1
- package/docs/en/packages/intlayer/getLocalizedUrl.md +3 -1
- package/docs/en/packages/intlayer/getMultilingualUrls.md +3 -1
- package/docs/en/packages/intlayer/getPathWithoutLocale.md +3 -1
- package/docs/en/packages/intlayer/getTranslation.md +3 -1
- package/docs/en/packages/intlayer/getTranslationContent.md +3 -1
- package/docs/en/packages/intlayer/index.md +3 -1
- package/docs/en/packages/intlayer-cli/index.md +3 -1
- package/docs/en/packages/intlayer-editor/index.md +3 -1
- package/docs/en/packages/lynx-intlayer/index.md +3 -1
- package/docs/en/packages/next-intlayer/index.md +3 -1
- package/docs/en/packages/next-intlayer/t.md +3 -1
- package/docs/en/packages/next-intlayer/useDictionary.md +3 -1
- package/docs/en/packages/next-intlayer/useIntlayer.md +3 -1
- package/docs/en/packages/next-intlayer/useIntlayerAsync.md +3 -1
- package/docs/en/packages/next-intlayer/useLocale.md +3 -1
- package/docs/en/packages/nuxt-intlayer/index.md +3 -1
- package/docs/en/packages/preact-intlayer/index.md +3 -1
- package/docs/en/packages/react-intlayer/index.md +3 -1
- package/docs/en/packages/react-intlayer/t.md +3 -1
- package/docs/en/packages/react-intlayer/useDictionary.md +3 -1
- package/docs/en/packages/react-intlayer/useIntlayer.md +3 -1
- package/docs/en/packages/react-intlayer/useIntlayerAsync.md +3 -1
- package/docs/en/packages/react-intlayer/useLocale.md +3 -1
- package/docs/en/packages/react-native-intlayer/index.md +3 -1
- package/docs/en/packages/react-scripts-intlayer/index.md +3 -1
- package/docs/en/packages/solid-intlayer/index.md +3 -1
- package/docs/en/packages/svelte-intlayer/index.md +3 -1
- package/docs/en/packages/vite-intlayer/index.md +3 -1
- package/docs/en/packages/vue-intlayer/index.md +3 -1
- package/docs/en/per_locale_file.md +3 -1
- package/docs/en/roadmap.md +5 -2
- package/docs/en/vs_code_extension.md +3 -1
- package/docs/en-GB/intlayer_CMS.md +1 -0
- package/docs/en-GB/intlayer_cli.md +257 -138
- package/docs/en-GB/intlayer_visual_editor.md +1 -0
- package/docs/en-GB/intlayer_with_angular.md +1 -0
- package/docs/en-GB/intlayer_with_create_react_app.md +1 -0
- package/docs/en-GB/intlayer_with_lynx+react.md +1 -0
- package/docs/en-GB/intlayer_with_nextjs_14.md +1 -0
- package/docs/en-GB/intlayer_with_nextjs_15.md +3 -1
- package/docs/en-GB/intlayer_with_nuxt.md +1 -0
- package/docs/en-GB/intlayer_with_react_native+expo.md +1 -0
- package/docs/en-GB/intlayer_with_vite+preact.md +4 -3
- package/docs/en-GB/intlayer_with_vite+react.md +71 -87
- package/docs/en-GB/intlayer_with_vite+solid.md +4 -3
- package/docs/en-GB/intlayer_with_vite+svelte.md +4 -3
- package/docs/en-GB/intlayer_with_vite+vue.md +5 -4
- package/docs/en-GB/mcp_server.md +116 -82
- package/docs/es/intlayer_CMS.md +1 -0
- package/docs/es/intlayer_cli.md +283 -164
- package/docs/es/intlayer_visual_editor.md +1 -0
- package/docs/es/intlayer_with_angular.md +1 -0
- package/docs/es/intlayer_with_create_react_app.md +1 -0
- package/docs/es/intlayer_with_lynx+react.md +1 -0
- package/docs/es/intlayer_with_nextjs_14.md +1 -0
- package/docs/es/intlayer_with_nextjs_15.md +3 -1
- package/docs/es/intlayer_with_nuxt.md +1 -0
- package/docs/es/intlayer_with_react_native+expo.md +1 -0
- package/docs/es/intlayer_with_vite+preact.md +4 -3
- package/docs/es/intlayer_with_vite+react.md +98 -98
- package/docs/es/intlayer_with_vite+solid.md +4 -3
- package/docs/es/intlayer_with_vite+svelte.md +4 -3
- package/docs/es/intlayer_with_vite+vue.md +5 -4
- package/docs/es/mcp_server.md +120 -86
- package/docs/es/vs_code_extension.md +1 -0
- package/docs/fr/intlayer_CMS.md +1 -0
- package/docs/fr/intlayer_cli.md +280 -184
- package/docs/fr/intlayer_visual_editor.md +1 -0
- package/docs/fr/intlayer_with_angular.md +1 -0
- package/docs/fr/intlayer_with_create_react_app.md +1 -0
- package/docs/fr/intlayer_with_lynx+react.md +1 -0
- package/docs/fr/intlayer_with_nextjs_14.md +1 -0
- package/docs/fr/intlayer_with_nextjs_15.md +3 -1
- package/docs/fr/intlayer_with_nuxt.md +1 -0
- package/docs/fr/intlayer_with_react_native+expo.md +1 -0
- package/docs/fr/intlayer_with_vite+preact.md +5 -4
- package/docs/fr/intlayer_with_vite+react.md +80 -69
- package/docs/fr/intlayer_with_vite+solid.md +4 -3
- package/docs/fr/intlayer_with_vite+svelte.md +4 -3
- package/docs/fr/intlayer_with_vite+vue.md +5 -4
- package/docs/fr/mcp_server.md +121 -87
- package/docs/hi/intlayer_CMS.md +1 -0
- package/docs/hi/intlayer_cli.md +295 -174
- package/docs/hi/intlayer_visual_editor.md +1 -0
- package/docs/hi/intlayer_with_angular.md +1 -0
- package/docs/hi/intlayer_with_create_react_app.md +1 -0
- package/docs/hi/intlayer_with_lynx+react.md +1 -0
- package/docs/hi/intlayer_with_nextjs_14.md +1 -0
- package/docs/hi/intlayer_with_nextjs_15.md +3 -1
- package/docs/hi/intlayer_with_nuxt.md +1 -0
- package/docs/hi/intlayer_with_react_native+expo.md +1 -0
- package/docs/hi/intlayer_with_vite+preact.md +4 -3
- package/docs/hi/intlayer_with_vite+react.md +114 -111
- package/docs/hi/intlayer_with_vite+solid.md +4 -3
- package/docs/hi/intlayer_with_vite+svelte.md +4 -3
- package/docs/hi/intlayer_with_vite+vue.md +5 -4
- package/docs/hi/mcp_server.md +118 -84
- package/docs/it/intlayer_CMS.md +1 -0
- package/docs/it/intlayer_cli.md +282 -167
- package/docs/it/intlayer_visual_editor.md +1 -0
- package/docs/it/intlayer_with_angular.md +1 -0
- package/docs/it/intlayer_with_create_react_app.md +1 -0
- package/docs/it/intlayer_with_lynx+react.md +1 -0
- package/docs/it/intlayer_with_nextjs_14.md +1 -0
- package/docs/it/intlayer_with_nextjs_15.md +3 -1
- package/docs/it/intlayer_with_nuxt.md +1 -0
- package/docs/it/intlayer_with_react_native+expo.md +1 -0
- package/docs/it/intlayer_with_vite+preact.md +4 -3
- package/docs/it/intlayer_with_vite+react.md +163 -116
- package/docs/it/intlayer_with_vite+solid.md +4 -3
- package/docs/it/intlayer_with_vite+svelte.md +4 -3
- package/docs/it/intlayer_with_vite+vue.md +4 -4
- package/docs/it/mcp_server.md +120 -86
- package/docs/ja/intlayer_CMS.md +1 -0
- package/docs/ja/intlayer_cli.md +285 -168
- package/docs/ja/intlayer_visual_editor.md +1 -0
- package/docs/ja/intlayer_with_angular.md +1 -0
- package/docs/ja/intlayer_with_create_react_app.md +1 -0
- package/docs/ja/intlayer_with_lynx+react.md +1 -0
- package/docs/ja/intlayer_with_nextjs_14.md +1 -0
- package/docs/ja/intlayer_with_nextjs_15.md +3 -1
- package/docs/ja/intlayer_with_nuxt.md +1 -0
- package/docs/ja/intlayer_with_react_native+expo.md +1 -0
- package/docs/ja/intlayer_with_vite+preact.md +4 -3
- package/docs/ja/intlayer_with_vite+react.md +160 -222
- package/docs/ja/intlayer_with_vite+solid.md +4 -3
- package/docs/ja/intlayer_with_vite+svelte.md +4 -3
- package/docs/ja/intlayer_with_vite+vue.md +5 -4
- package/docs/ja/mcp_server.md +121 -85
- package/docs/ko/intlayer_CMS.md +1 -0
- package/docs/ko/intlayer_cli.md +291 -175
- package/docs/ko/intlayer_visual_editor.md +1 -0
- package/docs/ko/intlayer_with_angular.md +1 -0
- package/docs/ko/intlayer_with_create_react_app.md +1 -0
- package/docs/ko/intlayer_with_lynx+react.md +1 -0
- package/docs/ko/intlayer_with_nextjs_14.md +1 -0
- package/docs/ko/intlayer_with_nextjs_15.md +3 -1
- package/docs/ko/intlayer_with_nuxt.md +1 -0
- package/docs/ko/intlayer_with_react_native+expo.md +1 -0
- package/docs/ko/intlayer_with_vite+preact.md +4 -3
- package/docs/ko/intlayer_with_vite+react.md +123 -152
- package/docs/ko/intlayer_with_vite+solid.md +4 -3
- package/docs/ko/intlayer_with_vite+svelte.md +4 -3
- package/docs/ko/intlayer_with_vite+vue.md +5 -4
- package/docs/ko/mcp_server.md +117 -83
- package/docs/ko/packages/intlayer/getLocalizedUrl.md +1 -23
- package/docs/pt/intlayer_CMS.md +1 -0
- package/docs/pt/intlayer_cli.md +274 -154
- package/docs/pt/intlayer_visual_editor.md +1 -0
- package/docs/pt/intlayer_with_angular.md +1 -0
- package/docs/pt/intlayer_with_create_react_app.md +1 -0
- package/docs/pt/intlayer_with_lynx+react.md +1 -0
- package/docs/pt/intlayer_with_nextjs_14.md +1 -0
- package/docs/pt/intlayer_with_nextjs_15.md +3 -1
- package/docs/pt/intlayer_with_nuxt.md +1 -0
- package/docs/pt/intlayer_with_react_native+expo.md +1 -0
- package/docs/pt/intlayer_with_vite+preact.md +4 -3
- package/docs/pt/intlayer_with_vite+react.md +117 -136
- package/docs/pt/intlayer_with_vite+solid.md +4 -3
- package/docs/pt/intlayer_with_vite+svelte.md +4 -3
- package/docs/pt/intlayer_with_vite+vue.md +4 -4
- package/docs/pt/mcp_server.md +121 -87
- package/docs/ru/intlayer_CMS.md +1 -0
- package/docs/ru/intlayer_cli.md +287 -170
- package/docs/ru/intlayer_visual_editor.md +1 -0
- package/docs/ru/intlayer_with_angular.md +1 -0
- package/docs/ru/intlayer_with_create_react_app.md +1 -0
- package/docs/ru/intlayer_with_lynx+react.md +1 -0
- package/docs/ru/intlayer_with_nextjs_14.md +1 -0
- package/docs/ru/intlayer_with_nextjs_15.md +3 -1
- package/docs/ru/intlayer_with_nuxt.md +1 -0
- package/docs/ru/intlayer_with_react_native+expo.md +1 -0
- package/docs/ru/intlayer_with_vite+preact.md +4 -3
- package/docs/ru/intlayer_with_vite+react.md +105 -87
- package/docs/ru/intlayer_with_vite+solid.md +4 -3
- package/docs/ru/intlayer_with_vite+svelte.md +4 -3
- package/docs/ru/intlayer_with_vite+vue.md +5 -4
- package/docs/ru/mcp_server.md +119 -85
- package/docs/zh/intlayer_CMS.md +1 -0
- package/docs/zh/intlayer_cli.md +275 -155
- package/docs/zh/intlayer_visual_editor.md +1 -0
- package/docs/zh/intlayer_with_angular.md +1 -0
- package/docs/zh/intlayer_with_create_react_app.md +1 -0
- package/docs/zh/intlayer_with_lynx+react.md +1 -0
- package/docs/zh/intlayer_with_nextjs_14.md +1 -0
- package/docs/zh/intlayer_with_nextjs_15.md +3 -1
- package/docs/zh/intlayer_with_nuxt.md +1 -0
- package/docs/zh/intlayer_with_react_native+expo.md +1 -0
- package/docs/zh/intlayer_with_vite+preact.md +4 -3
- package/docs/zh/intlayer_with_vite+react.md +154 -188
- package/docs/zh/intlayer_with_vite+solid.md +4 -3
- package/docs/zh/intlayer_with_vite+svelte.md +4 -3
- package/docs/zh/intlayer_with_vite+vue.md +5 -4
- package/docs/zh/mcp_server.md +119 -86
- package/docs/zh/packages/intlayer/getLocalizedUrl.md +1 -23
- package/frequent_questions/ar/build_error_CI_CD.md +75 -0
- package/frequent_questions/de/build_error_CI_CD.md +75 -0
- package/frequent_questions/en/build_error_CI_CD.md +75 -0
- package/frequent_questions/en-GB/build_error_CI_CD.md +75 -0
- package/frequent_questions/es/build_error_CI_CD.md +75 -0
- package/frequent_questions/fr/build_error_CI_CD.md +75 -0
- package/frequent_questions/hi/build_error_CI_CD.md +75 -0
- package/frequent_questions/it/build_error_CI_CD.md +75 -0
- package/frequent_questions/ja/build_error_CI_CD.md +75 -0
- package/frequent_questions/ja/intlayer_command_undefined.md +3 -3
- package/frequent_questions/ko/build_error_CI_CD.md +75 -0
- package/frequent_questions/ko/intlayer_command_undefined.md +3 -3
- package/frequent_questions/pt/build_error_CI_CD.md +75 -0
- package/frequent_questions/ru/build_error_CI_CD.md +75 -0
- package/frequent_questions/zh/build_error_CI_CD.md +75 -0
- package/frequent_questions/zh/intlayer_command_undefined.md +3 -3
- package/legal/ar/privacy_notice.md +83 -0
- package/legal/ar/terms_of_service.md +55 -0
- package/legal/de/privacy_notice.md +83 -0
- package/legal/de/terms_of_service.md +55 -0
- package/legal/en/privacy_notice.md +83 -0
- package/legal/en/terms_of_service.md +55 -0
- package/legal/en-GB/privacy_notice.md +83 -0
- package/legal/en-GB/terms_of_service.md +55 -0
- package/legal/es/privacy_notice.md +83 -0
- package/legal/es/terms_of_service.md +55 -0
- package/legal/fr/privacy_notice.md +83 -0
- package/legal/fr/terms_of_service.md +55 -0
- package/legal/hi/privacy_notice.md +83 -0
- package/legal/hi/terms_of_service.md +55 -0
- package/legal/it/privacy_notice.md +83 -0
- package/legal/it/terms_of_service.md +55 -0
- package/legal/ja/privacy_notice.md +83 -0
- package/legal/ja/terms_of_service.md +55 -0
- package/legal/ko/privacy_notice.md +83 -0
- package/legal/ko/terms_of_service.md +55 -0
- package/legal/pt/privacy_notice.md +83 -0
- package/legal/pt/terms_of_service.md +55 -0
- package/legal/ru/privacy_notice.md +83 -0
- package/legal/ru/terms_of_service.md +55 -0
- package/legal/zh/privacy_notice.md +83 -0
- package/legal/zh/terms_of_service.md +55 -0
- package/package.json +12 -11
- package/src/blog.ts +6 -4
- package/src/common.ts +25 -7
- package/src/doc.ts +6 -4
- package/src/frequentQuestions.ts +6 -4
- package/src/generated/blog.entry.ts +1177 -280
- package/src/generated/docs.entry.ts +3868 -1217
- package/src/generated/frequentQuestions.entry.ts +808 -178
- package/src/generated/legal.entry.ts +34 -36
- package/src/legal.ts +6 -4
|
@@ -1,58 +1,61 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt:
|
|
3
|
-
updatedAt:
|
|
4
|
-
title:
|
|
5
|
-
description: React
|
|
2
|
+
createdAt: 2024-03-07
|
|
3
|
+
updatedAt: 2024-03-07
|
|
4
|
+
title: Vite + ReactでのIntlayerの使い始め
|
|
5
|
+
description: Intlayerを使ってViteとReactアプリケーションに国際化(i18n)を追加する方法を学びます。このガイドに従ってアプリを多言語対応にしましょう。
|
|
6
6
|
keywords:
|
|
7
7
|
- 国際化
|
|
8
8
|
- ドキュメント
|
|
9
9
|
- Intlayer
|
|
10
10
|
- Vite
|
|
11
11
|
- React
|
|
12
|
-
-
|
|
12
|
+
- i18n
|
|
13
13
|
- JavaScript
|
|
14
14
|
slugs:
|
|
15
15
|
- doc
|
|
16
16
|
- environment
|
|
17
|
-
-
|
|
18
|
-
|
|
17
|
+
- vite-and-react
|
|
18
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-vite-react-template
|
|
19
|
+
youtubeVideo: https://www.youtube.com/watch?v=dS9L7uJeak4---
|
|
20
|
+
|
|
21
|
+
# IntlayerとViteとReactで始める国際化(i18n)
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
<iframe title="The best i18n solution for Vite and React? Discover Intlayer" class="m-auto aspect-[16/9] w-full overflow-hidden rounded-lg border-0" allow="autoplay; gyroscope;" loading="lazy" width="1080" height="auto" src="https://www.youtube.com/embed/dS9L7uJeak4?si=VaKmrYMmXjo3xpk2"/>
|
|
21
24
|
|
|
22
|
-
GitHub
|
|
25
|
+
GitHubの[アプリケーションテンプレート](https://github.com/aymericzip/intlayer-vite-react-template)を参照してください。
|
|
23
26
|
|
|
24
|
-
## Intlayer
|
|
27
|
+
## Intlayerとは?
|
|
25
28
|
|
|
26
|
-
**Intlayer
|
|
29
|
+
**Intlayer**は、最新のウェブアプリケーションでの多言語対応を簡素化するために設計された革新的なオープンソースの国際化(i18n)ライブラリです。
|
|
27
30
|
|
|
28
|
-
Intlayer
|
|
31
|
+
Intlayerを使うと、以下が可能です:
|
|
29
32
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
- **自動生成された型により
|
|
33
|
-
-
|
|
33
|
+
- **コンポーネントレベルで宣言的な辞書を使って** 翻訳を簡単に管理できます。
|
|
34
|
+
- **メタデータ、ルート、コンテンツを動的にローカライズ** できます。
|
|
35
|
+
- **自動生成された型によりTypeScriptサポートを保証** し、オートコンプリートやエラー検出を向上させます。
|
|
36
|
+
- **動的なロケール検出や切り替えなどの高度な機能を活用** できます。
|
|
34
37
|
|
|
35
38
|
---
|
|
36
39
|
|
|
37
|
-
## Vite
|
|
40
|
+
## ViteとReactアプリケーションでIntlayerをセットアップするステップバイステップガイド
|
|
38
41
|
|
|
39
|
-
### ステップ
|
|
42
|
+
### ステップ1: 依存関係のインストール
|
|
40
43
|
|
|
41
|
-
npm
|
|
44
|
+
npmを使って必要なパッケージをインストールします:
|
|
42
45
|
|
|
43
46
|
```bash packageManager="npm"
|
|
44
47
|
npm install intlayer react-intlayer
|
|
45
|
-
npm install --save-dev
|
|
48
|
+
npm install vite-intlayer --save-dev
|
|
46
49
|
```
|
|
47
50
|
|
|
48
51
|
```bash packageManager="pnpm"
|
|
49
52
|
pnpm add intlayer react-intlayer
|
|
50
|
-
pnpm add --save-dev
|
|
53
|
+
pnpm add vite-intlayer --save-dev
|
|
51
54
|
```
|
|
52
55
|
|
|
53
56
|
```bash packageManager="yarn"
|
|
54
57
|
yarn add intlayer react-intlayer
|
|
55
|
-
yarn add --save-dev
|
|
58
|
+
yarn add vite-intlayer --save-dev
|
|
56
59
|
```
|
|
57
60
|
|
|
58
61
|
- **intlayer**
|
|
@@ -60,20 +63,14 @@ yarn add --save-dev vite-intlayer
|
|
|
60
63
|
設定管理、翻訳、[コンテンツ宣言](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dictionary/get_started.md)、トランスパイル、および[CLIコマンド](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_cli.md)のための国際化ツールを提供するコアパッケージです。
|
|
61
64
|
|
|
62
65
|
- **react-intlayer**
|
|
63
|
-
IntlayerをReact
|
|
66
|
+
IntlayerをReactアプリケーションと統合するパッケージです。Reactの国際化のためのコンテキストプロバイダーとフックを提供します。
|
|
64
67
|
|
|
65
68
|
- **vite-intlayer**
|
|
66
|
-
/
|
|
69
|
+
Intlayerを[Viteバンドラー](https://vite.dev/guide/why.html#why-bundle-for-production)と統合するためのViteプラグイン、およびユーザーの優先ロケール検出、クッキー管理、URLリダイレクト処理のためのミドルウェアを含みます。
|
|
67
70
|
|
|
68
|
-
|
|
69
|
-
IntlayerをReactアプリケーションに統合するパッケージです。Reactの国際化のためのコンテキストプロバイダーとフックを提供します。
|
|
70
|
-
|
|
71
|
-
- **vite-intlayer**
|
|
72
|
-
Intlayerを[Viteバンドラー](https://vite.dev/guide/why.html#why-bundle-for-production)と統合するためのViteプラグイン、およびユーザーの優先ロケールの検出、クッキー管理、URLリダイレクト処理のためのミドルウェアを含みます。
|
|
71
|
+
### ステップ 2: プロジェクトの設定
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
アプリケーションの言語を設定するための設定ファイルを作成します:
|
|
73
|
+
アプリケーションの言語を設定するための設定ファイルを作成します:
|
|
77
74
|
|
|
78
75
|
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
79
76
|
import { Locales, type IntlayerConfig } from "intlayer";
|
|
@@ -84,7 +81,7 @@ const config: IntlayerConfig = {
|
|
|
84
81
|
Locales.ENGLISH,
|
|
85
82
|
Locales.FRENCH,
|
|
86
83
|
Locales.SPANISH,
|
|
87
|
-
//
|
|
84
|
+
// 他のロケールをここに追加
|
|
88
85
|
],
|
|
89
86
|
defaultLocale: Locales.ENGLISH,
|
|
90
87
|
},
|
|
@@ -103,7 +100,7 @@ const config = {
|
|
|
103
100
|
Locales.ENGLISH,
|
|
104
101
|
Locales.FRENCH,
|
|
105
102
|
Locales.SPANISH,
|
|
106
|
-
//
|
|
103
|
+
// 他のロケールをここに追加
|
|
107
104
|
],
|
|
108
105
|
defaultLocale: Locales.ENGLISH,
|
|
109
106
|
},
|
|
@@ -122,7 +119,7 @@ const config = {
|
|
|
122
119
|
Locales.ENGLISH,
|
|
123
120
|
Locales.FRENCH,
|
|
124
121
|
Locales.SPANISH,
|
|
125
|
-
//
|
|
122
|
+
// 他のロケールをここに追加
|
|
126
123
|
],
|
|
127
124
|
defaultLocale: Locales.ENGLISH,
|
|
128
125
|
},
|
|
@@ -131,11 +128,11 @@ const config = {
|
|
|
131
128
|
module.exports = config;
|
|
132
129
|
```
|
|
133
130
|
|
|
134
|
-
> この設定ファイルを通じて、ローカライズされたURL
|
|
131
|
+
> この設定ファイルを通じて、ローカライズされたURL、ミドルウェアのリダイレクション、クッキー名、コンテンツ宣言の場所と拡張子、コンソールでのIntlayerログの無効化などを設定できます。利用可能なパラメータの完全なリストについては、[設定ドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/configuration.md)を参照してください。
|
|
135
132
|
|
|
136
133
|
### ステップ3: Vite設定にIntlayerを統合する
|
|
137
134
|
|
|
138
|
-
intlayer
|
|
135
|
+
設定にintlayerプラグインを追加します。
|
|
139
136
|
|
|
140
137
|
```typescript fileName="vite.config.ts" codeFormat="typescript"
|
|
141
138
|
import { defineConfig } from "vite";
|
|
@@ -148,23 +145,6 @@ export default defineConfig({
|
|
|
148
145
|
});
|
|
149
146
|
```
|
|
150
147
|
|
|
151
|
-
````> この設定ファイルを通じて、ローカライズされたURL、ミドルウェアのリダイレクション、クッキー名、コンテンツ宣言の場所や拡張子、コンソールでのIntlayerログの無効化などを設定できます。利用可能なパラメータの完全なリストについては、[設定ドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/configuration.md)を参照してください。
|
|
152
|
-
|
|
153
|
-
### ステップ3: Vite設定にIntlayerを統合する
|
|
154
|
-
|
|
155
|
-
intlayerプラグインを設定に追加します。
|
|
156
|
-
|
|
157
|
-
```typescript fileName="vite.config.ts" codeFormat="typescript"
|
|
158
|
-
import { defineConfig } from "vite";
|
|
159
|
-
import react from "@vitejs/plugin-react-swc";
|
|
160
|
-
import { intlayerPlugin } from "vite-intlayer";
|
|
161
|
-
|
|
162
|
-
// https://vitejs.dev/config/
|
|
163
|
-
export default defineConfig({
|
|
164
|
-
plugins: [react(), intlayerPlugin()],
|
|
165
|
-
});
|
|
166
|
-
````
|
|
167
|
-
|
|
168
148
|
```javascript fileName="vite.config.mjs" codeFormat="esm"
|
|
169
149
|
import { defineConfig } from "vite";
|
|
170
150
|
import react from "@vitejs/plugin-react-swc";
|
|
@@ -187,34 +167,11 @@ module.exports = defineConfig({
|
|
|
187
167
|
});
|
|
188
168
|
```
|
|
189
169
|
|
|
190
|
-
> `intlayerPlugin()` Viteプラグインは、IntlayerをVite
|
|
170
|
+
> `intlayerPlugin()` Viteプラグインは、IntlayerをViteと統合するために使用されます。これにより、コンテンツ宣言ファイルのビルドが保証され、開発モードで監視されます。また、Viteアプリケーション内でIntlayerの環境変数を定義します。さらに、パフォーマンスを最適化するためのエイリアスも提供します。
|
|
191
171
|
|
|
192
172
|
### ステップ4: コンテンツを宣言する
|
|
193
173
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
```tsx fileName="src/app.content.tsx" contentDeclarationFormat="typescript"
|
|
197
|
-
import { t, type Dictionary } from "intlayer";
|
|
198
|
-
import type { ReactNode } from "react";
|
|
199
|
-
|
|
200
|
-
const appContent = {
|
|
201
|
-
key: "app",
|
|
202
|
-
content: {
|
|
203
|
-
viteLogo: t({
|
|
204
|
-
en: "Vite logo",
|
|
205
|
-
fr: "Logo Vite",
|
|
206
|
-
es: "Logo Vite",
|
|
207
|
-
}),
|
|
208
|
-
reactLogo: t({
|
|
209
|
-
en: "React logo",
|
|
210
|
-
fr: "Logo React",
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
> `intlayerPlugin()` Viteプラグインは、IntlayerをViteと統合するために使用されます。これにより、コンテンツ宣言ファイルのビルドが保証され、開発モードで監視されます。また、Viteアプリケーション内でIntlayerの環境変数を定義します。さらに、パフォーマンス最適化のためのエイリアスも提供します。
|
|
214
|
-
|
|
215
|
-
### ステップ4: コンテンツを宣言する
|
|
216
|
-
|
|
217
|
-
翻訳を格納するためのコンテンツ宣言を作成および管理します:
|
|
174
|
+
翻訳を格納するためのコンテンツ宣言を作成および管理します:
|
|
218
175
|
|
|
219
176
|
```tsx fileName="src/app.content.tsx" contentDeclarationFormat="typescript"
|
|
220
177
|
import { t, type Dictionary } from "intlayer";
|
|
@@ -245,17 +202,17 @@ const appContent = {
|
|
|
245
202
|
edit: t<ReactNode>({
|
|
246
203
|
en: (
|
|
247
204
|
<>
|
|
248
|
-
<code>src/App.tsx</code> を編集して保存し、HMR
|
|
205
|
+
<code>src/App.tsx</code> を編集して保存し、HMRをテストします
|
|
249
206
|
</>
|
|
250
207
|
),
|
|
251
208
|
fr: (
|
|
252
209
|
<>
|
|
253
|
-
<code>src/App.tsx</code> を編集して保存し、HMR
|
|
210
|
+
<code>src/App.tsx</code> を編集して保存し、HMRをテストします
|
|
254
211
|
</>
|
|
255
212
|
),
|
|
256
213
|
es: (
|
|
257
214
|
<>
|
|
258
|
-
<code>src/App.tsx</code> を編集して保存し、HMR
|
|
215
|
+
<code>src/App.tsx</code> を編集して保存し、HMRをテストします
|
|
259
216
|
</>
|
|
260
217
|
),
|
|
261
218
|
}),
|
|
@@ -321,7 +278,7 @@ const appContent = {
|
|
|
321
278
|
},
|
|
322
279
|
|
|
323
280
|
readTheDocs: t({
|
|
324
|
-
en: "
|
|
281
|
+
en: "ViteとReactのロゴをクリックして詳細を確認してください",
|
|
325
282
|
fr: "Cliquez sur les logos Vite et React pour en savoir plus",
|
|
326
283
|
es: "Haga clic en los logotipos de Vite y React para obtener más información",
|
|
327
284
|
}),
|
|
@@ -339,13 +296,11 @@ const appContent = {
|
|
|
339
296
|
key: "app",
|
|
340
297
|
content: {
|
|
341
298
|
viteLogo: t({
|
|
342
|
-
ja: "Vite ロゴ",
|
|
343
299
|
en: "Vite logo",
|
|
344
300
|
fr: "Logo Vite",
|
|
345
301
|
es: "Logo Vite",
|
|
346
302
|
}),
|
|
347
303
|
reactLogo: t({
|
|
348
|
-
ja: "React ロゴ",
|
|
349
304
|
en: "React logo",
|
|
350
305
|
fr: "Logo React",
|
|
351
306
|
es: "Logo React",
|
|
@@ -354,7 +309,6 @@ const appContent = {
|
|
|
354
309
|
title: "Vite + React",
|
|
355
310
|
|
|
356
311
|
count: t({
|
|
357
|
-
ja: "カウントは ",
|
|
358
312
|
en: "count is ",
|
|
359
313
|
fr: "le compte est ",
|
|
360
314
|
es: "el recuento es ",
|
|
@@ -365,11 +319,6 @@ const appContent = {
|
|
|
365
319
|
ReactNode >
|
|
366
320
|
{
|
|
367
321
|
// コンテンツ内でReactノードを使用する場合はReactをインポートすることを忘れないでください
|
|
368
|
-
ja: (
|
|
369
|
-
<>
|
|
370
|
-
<code>src/App.tsx</code> を編集して保存し、HMRをテストします
|
|
371
|
-
</>
|
|
372
|
-
),
|
|
373
322
|
en: (
|
|
374
323
|
<>
|
|
375
324
|
Edit <code>src/App.tsx</code> and save to test HMR
|
|
@@ -391,7 +340,7 @@ const appContent = {
|
|
|
391
340
|
en: "Click on the Vite and React logos to learn more",
|
|
392
341
|
fr: "Cliquez sur les logos Vite et React pour en savoir plus",
|
|
393
342
|
es: "Haga clic en los logotipos de Vite y React para obtener más información",
|
|
394
|
-
ja: "ViteとReact
|
|
343
|
+
ja: "詳細を知るには、Vite と React のロゴをクリックしてください",
|
|
395
344
|
}),
|
|
396
345
|
},
|
|
397
346
|
};
|
|
@@ -410,7 +359,7 @@ module.exports = appContent;
|
|
|
410
359
|
"en": "Vite logo",
|
|
411
360
|
"fr": "Logo Vite",
|
|
412
361
|
"es": "Logo Vite",
|
|
413
|
-
"ja": "Viteロゴ"
|
|
362
|
+
"ja": "Vite ロゴ"
|
|
414
363
|
}
|
|
415
364
|
},
|
|
416
365
|
"reactLogo": {
|
|
@@ -443,7 +392,7 @@ module.exports = appContent;
|
|
|
443
392
|
"edit": {
|
|
444
393
|
"nodeType": "translation",
|
|
445
394
|
"translation": {
|
|
446
|
-
"ja": "src/App.tsx を編集して保存し、HMR
|
|
395
|
+
"ja": "src/App.tsx を編集して保存し、HMR をテストしてください",
|
|
447
396
|
"en": "Edit src/App.tsx and save to test HMR",
|
|
448
397
|
"fr": "Éditez src/App.tsx et enregistrez pour tester HMR",
|
|
449
398
|
"es": "Edita src/App.tsx y guarda para probar HMR"
|
|
@@ -452,7 +401,8 @@ module.exports = appContent;
|
|
|
452
401
|
"readTheDocs": {
|
|
453
402
|
"nodeType": "translation",
|
|
454
403
|
"translation": {
|
|
455
|
-
"ja": "Vite
|
|
404
|
+
"ja": "ViteとReactのロゴをクリックして詳細を学びましょう",
|
|
405
|
+
"en": "Click on the Vite and React logos to learn more",
|
|
456
406
|
"fr": "Cliquez sur les logos Vite et React pour en savoir plus",
|
|
457
407
|
"es": "Haga clic en los logotipos de Vite y React para obtener más información"
|
|
458
408
|
}
|
|
@@ -461,11 +411,11 @@ module.exports = appContent;
|
|
|
461
411
|
}
|
|
462
412
|
```
|
|
463
413
|
|
|
464
|
-
> あなたのコンテンツ宣言は、`contentDir
|
|
414
|
+
> あなたのコンテンツ宣言は、`contentDir`ディレクトリ(デフォルトは`./src`)に含まれた時点で、アプリケーションのどこにでも定義できます。そして、コンテンツ宣言ファイルの拡張子(デフォルトは`.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`)に一致する必要があります。
|
|
465
415
|
|
|
466
416
|
> 詳細については、[コンテンツ宣言のドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dictionary/get_started.md)を参照してください。
|
|
467
417
|
|
|
468
|
-
> コンテンツファイルに
|
|
418
|
+
> コンテンツファイルにTSXコードが含まれている場合は、`import React from "react";`をコンテンツファイルにインポートすることを検討してください。
|
|
469
419
|
|
|
470
420
|
### ステップ5: コード内でIntlayerを利用する
|
|
471
421
|
|
|
@@ -590,16 +540,15 @@ const AppContent = () => {
|
|
|
590
540
|
/>
|
|
591
541
|
</a>
|
|
592
542
|
</div>
|
|
593
|
-
<h1>{content.title}</h1>
|
|
543
|
+
<h1>{content.title}</h1>
|
|
594
544
|
<div className="card">
|
|
595
545
|
<button onClick={() => setCount((count) => count + 1)}>
|
|
596
546
|
{content.count}
|
|
597
547
|
{count}
|
|
598
548
|
</button>
|
|
599
|
-
<p>{content.edit}</p>
|
|
549
|
+
<p>{content.edit}</p>
|
|
600
550
|
</div>
|
|
601
|
-
<p className="read-the-docs">{content.readTheDocs}</p>
|
|
602
|
-
{/* ドキュメントを読む案内 */}
|
|
551
|
+
<p className="read-the-docs">{content.readTheDocs}</p>
|
|
603
552
|
</>
|
|
604
553
|
);
|
|
605
554
|
};
|
|
@@ -615,47 +564,13 @@ module.exports = App;
|
|
|
615
564
|
|
|
616
565
|
> もし `alt`、`title`、`href`、`aria-label` などの `string` 属性でコンテンツを使用したい場合は、関数の値を呼び出す必要があります。例えば:
|
|
617
566
|
|
|
618
|
-
> ```jsx
|
|
619
|
-
> <img src={content.image.src.value} alt={content.image.value} />
|
|
620
|
-
> ```
|
|
621
|
-
|
|
622
|
-
alt={content.reactLogo.value}
|
|
623
|
-
/>
|
|
624
|
-
</a>
|
|
625
|
-
</div>
|
|
626
|
-
<h1>{content.title}</h1>
|
|
627
|
-
<div className="card">
|
|
628
|
-
<button onClick={() => setCount((count) => count + 1)}>
|
|
629
|
-
{content.count}
|
|
630
|
-
{count}
|
|
631
|
-
</button>
|
|
632
|
-
<p>{content.edit}</p>
|
|
633
|
-
</div>
|
|
634
|
-
<p className="read-the-docs">{content.readTheDocs}</p>
|
|
635
|
-
</>
|
|
636
|
-
|
|
637
|
-
);
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
const App = () => (
|
|
641
|
-
<IntlayerProvider>
|
|
642
|
-
<AppContent />
|
|
643
|
-
</IntlayerProvider>
|
|
644
|
-
);
|
|
645
|
-
|
|
646
|
-
module.exports = App;
|
|
647
|
-
|
|
648
|
-
````
|
|
649
|
-
|
|
650
|
-
> `alt`、`title`、`href`、`aria-label`などの`string`属性でコンテンツを使用したい場合は、関数の値を呼び出す必要があります。例えば:
|
|
651
|
-
|
|
652
567
|
> ```jsx
|
|
653
568
|
> <img src={content.image.src.value} alt={content.image.value} />
|
|
654
569
|
> ```
|
|
655
570
|
|
|
656
571
|
> `useIntlayer` フックの詳細については、[ドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/packages/react-intlayer/useIntlayer.md)を参照してください。
|
|
657
572
|
|
|
658
|
-
### (オプション)ステップ6
|
|
573
|
+
### (オプション)ステップ6: コンテンツの言語を変更する
|
|
659
574
|
|
|
660
575
|
コンテンツの言語を変更するには、`useLocale` フックが提供する `setLocale` 関数を使用します。この関数を使うことで、アプリケーションのロケールを設定し、それに応じてコンテンツを更新できます。
|
|
661
576
|
|
|
@@ -668,12 +583,10 @@ const LocaleSwitcher: FC = () => {
|
|
|
668
583
|
const { setLocale } = useLocale();
|
|
669
584
|
|
|
670
585
|
return (
|
|
671
|
-
<button onClick={() => setLocale(Locales.English)}>
|
|
672
|
-
英語に言語を変更
|
|
673
|
-
</button>
|
|
586
|
+
<button onClick={() => setLocale(Locales.English)}>英語に言語を変更</button>
|
|
674
587
|
);
|
|
675
588
|
};
|
|
676
|
-
|
|
589
|
+
```
|
|
677
590
|
|
|
678
591
|
```jsx fileName="src/components/LocaleSwitcher.msx" codeFormat="esm"
|
|
679
592
|
import { Locales } from "intlayer";
|
|
@@ -705,7 +618,7 @@ const LocaleSwitcher = () => {
|
|
|
705
618
|
|
|
706
619
|
### (オプション)ステップ7:アプリケーションにローカライズされたルーティングを追加する
|
|
707
620
|
|
|
708
|
-
このステップの目的は、各言語ごとにユニークなルートを作成することです。これはSEO
|
|
621
|
+
このステップの目的は、各言語ごとにユニークなルートを作成することです。これはSEOやSEOに適したURLに役立ちます。
|
|
709
622
|
例:
|
|
710
623
|
|
|
711
624
|
```plaintext
|
|
@@ -714,7 +627,7 @@ const LocaleSwitcher = () => {
|
|
|
714
627
|
- https://example.com/fr/about
|
|
715
628
|
```
|
|
716
629
|
|
|
717
|
-
>
|
|
630
|
+
> デフォルトでは、ルートはデフォルトロケールに対してプレフィックスが付きません。デフォルトロケールにもプレフィックスを付けたい場合は、設定の `middleware.prefixDefault` オプションを `true` に設定できます。詳細は[設定ドキュメント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/configuration.md)を参照してください。
|
|
718
631
|
|
|
719
632
|
アプリケーションにローカライズされたルーティングを追加するには、アプリケーションのルートをラップし、ロケールベースのルーティングを処理する `LocaleRouter` コンポーネントを作成できます。以下は [React Router](https://reactrouter.com/home) を使用した例です。
|
|
720
633
|
|
|
@@ -729,7 +642,7 @@ import {
|
|
|
729
642
|
Route,
|
|
730
643
|
Navigate,
|
|
731
644
|
useLocation,
|
|
732
|
-
} from "react-router-dom"; //
|
|
645
|
+
} from "react-router-dom"; // ナビゲーション管理用のルーターコンポーネント
|
|
733
646
|
|
|
734
647
|
// Intlayerから設定を分割代入
|
|
735
648
|
const { internationalization, middleware } = configuration;
|
|
@@ -748,13 +661,13 @@ const AppLocalized: FC<PropsWithChildren<{ locale: Locales }>> = ({
|
|
|
748
661
|
// 現在のロケールを決定し、指定がなければデフォルトロケールを使用
|
|
749
662
|
const currentLocale = locale ?? defaultLocale;
|
|
750
663
|
|
|
751
|
-
//
|
|
664
|
+
// パスからロケールのプレフィックスを取り除き、ベースパスを構築
|
|
752
665
|
const pathWithoutLocale = getPathWithoutLocale(
|
|
753
666
|
pathname // 現在のURLパス
|
|
754
667
|
);
|
|
755
668
|
|
|
756
669
|
/**
|
|
757
|
-
* middleware.prefixDefaultがtrue
|
|
670
|
+
* middleware.prefixDefaultがtrueの場合、デフォルトロケールには常にプレフィックスを付ける必要があります。
|
|
758
671
|
*/
|
|
759
672
|
if (middleware.prefixDefault) {
|
|
760
673
|
// ロケールの検証
|
|
@@ -774,8 +687,8 @@ const AppLocalized: FC<PropsWithChildren<{ locale: Locales }>> = ({
|
|
|
774
687
|
);
|
|
775
688
|
} else {
|
|
776
689
|
/**
|
|
777
|
-
* middleware.prefixDefaultがfalse
|
|
778
|
-
*
|
|
690
|
+
* middleware.prefixDefaultがfalseの場合、デフォルトロケールはプレフィックスされません。
|
|
691
|
+
* 現在のロケールが有効であり、デフォルトロケールでないことを確認します。
|
|
779
692
|
*/
|
|
780
693
|
if (
|
|
781
694
|
currentLocale.toString() !== defaultLocale.toString() &&
|
|
@@ -785,11 +698,11 @@ const AppLocalized: FC<PropsWithChildren<{ locale: Locales }>> = ({
|
|
|
785
698
|
)
|
|
786
699
|
.includes(currentLocale) // 現在のロケールが有効なロケールのリストに含まれているかをチェック
|
|
787
700
|
) {
|
|
788
|
-
//
|
|
701
|
+
// ロケールのプレフィックスなしのパスへリダイレクト
|
|
789
702
|
return <Navigate to={`${pathWithoutLocale}${search}`} replace />;
|
|
790
703
|
}
|
|
791
704
|
|
|
792
|
-
// IntlayerProvider
|
|
705
|
+
// IntlayerProviderで子要素をラップし、現在のロケールを設定
|
|
793
706
|
return (
|
|
794
707
|
<IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
|
|
795
708
|
);
|
|
@@ -798,7 +711,7 @@ const AppLocalized: FC<PropsWithChildren<{ locale: Locales }>> = ({
|
|
|
798
711
|
|
|
799
712
|
/**
|
|
800
713
|
* ロケール固有のルートを設定するルーターコンポーネント。
|
|
801
|
-
* React Router
|
|
714
|
+
* React Routerを使用してナビゲーションを管理し、ローカライズされたコンポーネントをレンダリングします。
|
|
802
715
|
*/
|
|
803
716
|
export const LocaleRouter: FC<PropsWithChildren> = ({ children }) => (
|
|
804
717
|
<BrowserRouter>
|
|
@@ -843,7 +756,7 @@ import {
|
|
|
843
756
|
Route,
|
|
844
757
|
Navigate,
|
|
845
758
|
useLocation,
|
|
846
|
-
} from "react-router-dom"; //
|
|
759
|
+
} from "react-router-dom"; // ナビゲーション管理のためのルーターコンポーネント
|
|
847
760
|
|
|
848
761
|
// Intlayerからの設定の分割代入
|
|
849
762
|
const { internationalization, middleware } = configuration;
|
|
@@ -857,7 +770,7 @@ const { locales, defaultLocale } = internationalization;
|
|
|
857
770
|
const AppLocalized = ({ children, locale }) => {
|
|
858
771
|
const { pathname, search } = useLocation(); // 現在のURLパスを取得
|
|
859
772
|
|
|
860
|
-
//
|
|
773
|
+
// 現在のロケールを決定し、指定がなければデフォルトにフォールバック
|
|
861
774
|
const currentLocale = locale ?? defaultLocale;
|
|
862
775
|
|
|
863
776
|
// パスからロケールのプレフィックスを削除してベースパスを構築
|
|
@@ -880,14 +793,14 @@ const AppLocalized = ({ children, locale }) => {
|
|
|
880
793
|
);
|
|
881
794
|
}
|
|
882
795
|
|
|
883
|
-
// IntlayerProvider
|
|
796
|
+
// IntlayerProviderで子要素をラップし、現在のロケールを設定します
|
|
884
797
|
return (
|
|
885
798
|
<IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
|
|
886
799
|
);
|
|
887
800
|
} else {
|
|
888
801
|
/**
|
|
889
802
|
* middleware.prefixDefaultがfalseの場合、デフォルトロケールはプレフィックスされません。
|
|
890
|
-
*
|
|
803
|
+
* 現在のロケールが有効であり、デフォルトロケールでないことを確認します。
|
|
891
804
|
*/
|
|
892
805
|
if (
|
|
893
806
|
currentLocale.toString() !== defaultLocale.toString() &&
|
|
@@ -897,11 +810,11 @@ const AppLocalized = ({ children, locale }) => {
|
|
|
897
810
|
)
|
|
898
811
|
.includes(currentLocale) // 現在のロケールが有効なロケールのリストに含まれているかをチェック
|
|
899
812
|
) {
|
|
900
|
-
//
|
|
813
|
+
// ロケールのプレフィックスなしのパスにリダイレクト
|
|
901
814
|
return <Navigate to={`${pathWithoutLocale}${search}`} replace />;
|
|
902
815
|
}
|
|
903
816
|
|
|
904
|
-
// IntlayerProvider
|
|
817
|
+
// IntlayerProviderで子要素をラップし、現在のロケールを設定
|
|
905
818
|
return (
|
|
906
819
|
<IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
|
|
907
820
|
);
|
|
@@ -921,7 +834,7 @@ export const LocaleRouter = ({ children }) => (
|
|
|
921
834
|
)
|
|
922
835
|
.map((locale) => (
|
|
923
836
|
<Route
|
|
924
|
-
//
|
|
837
|
+
// ロケールをキャプチャするルートパターン(例:/en/、/fr/)およびその後のすべてのパスにマッチ
|
|
925
838
|
path={`/${locale}/*`}
|
|
926
839
|
key={locale}
|
|
927
840
|
element={<AppLocalized locale={locale}>{children}</AppLocalized>} // ロケール管理で子要素をラップ
|
|
@@ -954,14 +867,14 @@ const {
|
|
|
954
867
|
Route,
|
|
955
868
|
Navigate,
|
|
956
869
|
useLocation,
|
|
957
|
-
} = require("react-router-dom"); //
|
|
870
|
+
} = require("react-router-dom"); // ナビゲーション管理のためのルーターコンポーネント
|
|
958
871
|
|
|
959
872
|
// Intlayerからの設定の分割代入
|
|
960
873
|
const { internationalization, middleware } = configuration;
|
|
961
874
|
const { locales, defaultLocale } = internationalization;
|
|
962
875
|
|
|
963
876
|
/**
|
|
964
|
-
*
|
|
877
|
+
* ローカリゼーションを処理し、子要素を適切なロケールコンテキストでラップするコンポーネント。
|
|
965
878
|
* URLベースのロケール検出と検証を管理する。
|
|
966
879
|
*/
|
|
967
880
|
const AppLocalized = ({ children, locale }) => {
|
|
@@ -970,7 +883,7 @@ const AppLocalized = ({ children, locale }) => {
|
|
|
970
883
|
// 現在のロケールを決定。指定がなければデフォルトロケールを使用
|
|
971
884
|
const currentLocale = locale ?? defaultLocale;
|
|
972
885
|
|
|
973
|
-
//
|
|
886
|
+
// パスからロケールのプレフィックスを取り除き、ベースパスを作成
|
|
974
887
|
const pathWithoutLocale = getPathWithoutLocale(
|
|
975
888
|
pathname // 現在のURLパス
|
|
976
889
|
);
|
|
@@ -990,7 +903,7 @@ const AppLocalized = ({ children, locale }) => {
|
|
|
990
903
|
);
|
|
991
904
|
}
|
|
992
905
|
|
|
993
|
-
// IntlayerProvider
|
|
906
|
+
// IntlayerProviderで子要素をラップし、現在のロケールを設定します
|
|
994
907
|
return (
|
|
995
908
|
<IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
|
|
996
909
|
);
|
|
@@ -1011,7 +924,7 @@ const AppLocalized = ({ children, locale }) => {
|
|
|
1011
924
|
return <Navigate to={`${pathWithoutLocale}${search}`} replace />;
|
|
1012
925
|
}
|
|
1013
926
|
|
|
1014
|
-
// IntlayerProvider
|
|
927
|
+
// IntlayerProviderで子要素をラップし、現在のロケールを設定
|
|
1015
928
|
return (
|
|
1016
929
|
<IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
|
|
1017
930
|
);
|
|
@@ -1093,7 +1006,7 @@ const App = () => (
|
|
|
1093
1006
|
);
|
|
1094
1007
|
```
|
|
1095
1008
|
|
|
1096
|
-
並行して、`intLayerMiddlewarePlugin`
|
|
1009
|
+
並行して、`intLayerMiddlewarePlugin` を使用してアプリケーションにサーバーサイドルーティングを追加することもできます。このプラグインは、URL に基づいて現在のロケールを自動的に検出し、適切なロケールクッキーを設定します。ロケールが指定されていない場合、プラグインはユーザーのブラウザの言語設定に基づいて最も適切なロケールを判断します。ロケールが検出されない場合は、デフォルトのロケールにリダイレクトします。
|
|
1097
1010
|
|
|
1098
1011
|
```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
|
|
1099
1012
|
import { defineConfig } from "vite";
|
|
@@ -1128,9 +1041,9 @@ module.exports = defineConfig({
|
|
|
1128
1041
|
});
|
|
1129
1042
|
```
|
|
1130
1043
|
|
|
1131
|
-
### (オプション)ステップ8
|
|
1044
|
+
### (オプション)ステップ8:ロケールが変更されたときにURLを変更する
|
|
1132
1045
|
|
|
1133
|
-
ロケールが変更されたときにURLを変更するには、`useLocale`フックが提供する`onLocaleChange`プロパティを使用できます。同時に、`react-router-dom`の`useLocation`と`useNavigate
|
|
1046
|
+
ロケールが変更されたときにURLを変更するには、`useLocale`フックが提供する`onLocaleChange`プロパティを使用できます。同時に、`react-router-dom`の`useLocation`と`useNavigate`フックを使用してURLパスを更新できます。
|
|
1134
1047
|
|
|
1135
1048
|
```tsx fileName="src/components/LocaleSwitcher.tsx" codeFormat="typescript"
|
|
1136
1049
|
import { useLocation, useNavigate } from "react-router-dom";
|
|
@@ -1246,7 +1159,7 @@ const LocaleSwitcher = () => {
|
|
|
1246
1159
|
{getLocaleName(localeItem, locale)}
|
|
1247
1160
|
</span>
|
|
1248
1161
|
<span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
|
|
1249
|
-
{/* 現在のロケールでの言語名 - 例:
|
|
1162
|
+
{/* 現在のロケールでの言語名 - 例: Locales.SPANISH に設定された現在のロケールでの "Francés" */}
|
|
1250
1163
|
{getLocaleName(localeItem)}
|
|
1251
1164
|
</span>
|
|
1252
1165
|
<span dir="ltr" lang={Locales.ENGLISH}>
|
|
@@ -1310,7 +1223,7 @@ const LocaleSwitcher = () => {
|
|
|
1310
1223
|
{getLocaleName(localeItem, locale)}
|
|
1311
1224
|
</span>
|
|
1312
1225
|
<span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
|
|
1313
|
-
{/* 現在のロケールでの言語名 - 例: Locales.SPANISH
|
|
1226
|
+
{/* 現在のロケールでの言語名 - 例: Locales.SPANISHに設定された現在のロケールでのFrancés */}
|
|
1314
1227
|
{getLocaleName(localeItem)}
|
|
1315
1228
|
</span>
|
|
1316
1229
|
<span dir="ltr" lang={Locales.ENGLISH}>
|
|
@@ -1340,13 +1253,13 @@ const LocaleSwitcher = () => {
|
|
|
1340
1253
|
|
|
1341
1254
|
---
|
|
1342
1255
|
|
|
1343
|
-
###
|
|
1256
|
+
### (オプション)ステップ9: HTMLの言語属性と方向属性を切り替える
|
|
1344
1257
|
|
|
1345
|
-
アプリケーションが複数の言語をサポートしている場合、`<html>`タグの`lang`属性と`dir
|
|
1258
|
+
アプリケーションが複数の言語をサポートしている場合、`<html>`タグの`lang`属性と`dir`属性を現在のロケールに合わせて更新することが非常に重要です。これにより、以下が保証されます:
|
|
1346
1259
|
|
|
1347
1260
|
- **アクセシビリティ**:スクリーンリーダーや支援技術は、正しい`lang`属性に依存してコンテンツを正確に発音・解釈します。
|
|
1348
|
-
- **テキストのレンダリング**:`dir
|
|
1349
|
-
- **SEO**:検索エンジンは`lang
|
|
1261
|
+
- **テキストのレンダリング**:`dir`(方向)属性は、テキストが適切な順序(例:英語は左から右、アラビア語やヘブライ語は右から左)で表示されることを保証し、読みやすさに不可欠です。
|
|
1262
|
+
- **SEO**:検索エンジンは`lang`属性を使用してページの言語を判別し、適切なローカライズされたコンテンツを検索結果に提供します。
|
|
1350
1263
|
|
|
1351
1264
|
ロケールが変更されるたびにこれらの属性を動的に更新することで、すべての対応言語において一貫性がありアクセシブルなユーザー体験を保証します。
|
|
1352
1265
|
|
|
@@ -1362,7 +1275,7 @@ import { getHTMLTextDir } from "intlayer";
|
|
|
1362
1275
|
/**
|
|
1363
1276
|
* 現在のロケールに基づいてHTMLの<html>要素の`lang`および`dir`属性を更新します。
|
|
1364
1277
|
* - `lang`: ブラウザや検索エンジンにページの言語を通知します。
|
|
1365
|
-
* - `dir`:
|
|
1278
|
+
* - `dir`: 正しい読み順を保証します(例:英語は'ltr'、アラビア語は'rtl')。
|
|
1366
1279
|
*
|
|
1367
1280
|
* この動的な更新は、適切なテキストレンダリング、アクセシビリティ、およびSEOに不可欠です。
|
|
1368
1281
|
*/
|
|
@@ -1457,13 +1370,39 @@ const App: FC = () => (
|
|
|
1457
1370
|
export default App;
|
|
1458
1371
|
```
|
|
1459
1372
|
|
|
1373
|
+
#### アプリケーションでのフックの使用
|
|
1374
|
+
|
|
1375
|
+
フックをメインコンポーネントに統合し、ロケールが変更されるたびにHTML属性が更新されるようにします:
|
|
1376
|
+
|
|
1377
|
+
```tsx fileName="src/App.tsx" codeFormat="typescript"
|
|
1378
|
+
import type { FC } from "react";
|
|
1379
|
+
import { IntlayerProvider, useIntlayer } from "react-intlayer";
|
|
1380
|
+
import { useI18nHTMLAttributes } from "./hooks/useI18nHTMLAttributes";
|
|
1381
|
+
import "./App.css";
|
|
1382
|
+
|
|
1383
|
+
const AppContent: FC = () => {
|
|
1384
|
+
// ロケールに基づいて<html>タグのlangとdir属性を更新するためにフックを適用します。
|
|
1385
|
+
useI18nHTMLAttributes();
|
|
1386
|
+
|
|
1387
|
+
// ... コンポーネントの残りの部分
|
|
1388
|
+
};
|
|
1389
|
+
|
|
1390
|
+
const App: FC = () => (
|
|
1391
|
+
<IntlayerProvider>
|
|
1392
|
+
<AppContent />
|
|
1393
|
+
</IntlayerProvider>
|
|
1394
|
+
);
|
|
1395
|
+
|
|
1396
|
+
export default App;
|
|
1397
|
+
```
|
|
1398
|
+
|
|
1460
1399
|
```jsx fileName="src/App.msx" codeFormat="esm"
|
|
1461
|
-
import { IntlayerProvider, useIntlayer } from "react
|
|
1400
|
+
import { IntlayerProvider, useIntlayer } from "react-intlayer";
|
|
1462
1401
|
import { useI18nHTMLAttributes } from "./hooks/useI18nHTMLAttributes";
|
|
1463
1402
|
import "./App.css";
|
|
1464
1403
|
|
|
1465
1404
|
const AppContent = () => {
|
|
1466
|
-
//
|
|
1405
|
+
// ロケールに基づいて<html>タグのlangとdir属性を更新するためにフックを適用します。
|
|
1467
1406
|
useI18nHTMLAttributes();
|
|
1468
1407
|
|
|
1469
1408
|
// ... コンポーネントの残りの部分
|
|
@@ -1485,12 +1424,7 @@ const { useI18nHTMLAttributes } = require("./hooks/useI18nHTMLAttributes");
|
|
|
1485
1424
|
require("./App.css");
|
|
1486
1425
|
|
|
1487
1426
|
const AppContent = () => {
|
|
1488
|
-
//
|
|
1489
|
-
useI18nHTMLAttributes();
|
|
1490
|
-
|
|
1491
|
-
// ... コンポーネントの残りの部分
|
|
1492
|
-
};
|
|
1493
|
-
// ロケールに基づいて <html> タグの lang および dir 属性を更新するためのフックを適用します。
|
|
1427
|
+
// ロケールに基づいて<html>タグのlangとdir属性を更新するためにフックを適用します。
|
|
1494
1428
|
useI18nHTMLAttributes();
|
|
1495
1429
|
|
|
1496
1430
|
// ... コンポーネントの残りの部分
|
|
@@ -1505,9 +1439,17 @@ const App = () => (
|
|
|
1505
1439
|
module.exports = App;
|
|
1506
1440
|
```
|
|
1507
1441
|
|
|
1508
|
-
|
|
1442
|
+
これらの変更を適用することで、アプリケーションは以下を実現します:
|
|
1509
1443
|
|
|
1510
|
-
-
|
|
1444
|
+
- 現在のロケールを正確に反映する**言語**(`lang`)属性を確実に設定し、SEOやブラウザの動作に重要な役割を果たします。
|
|
1445
|
+
- ロケールに応じて**テキストの方向**(`dir`)を調整し、異なる読み順の言語に対して読みやすさと使いやすさを向上させます。
|
|
1446
|
+
- これらの属性に依存する支援技術のために、より**アクセシブル**な体験を提供します。
|
|
1447
|
+
|
|
1448
|
+
### (オプション)ステップ10:ローカライズされたリンクコンポーネントの作成
|
|
1449
|
+
|
|
1450
|
+
これらの変更を適用することで、アプリケーションは以下を実現します:
|
|
1451
|
+
|
|
1452
|
+
- **言語**(`lang`)属性が現在のロケールを正確に反映し、SEOやブラウザの動作に重要な役割を果たします。
|
|
1511
1453
|
- ロケールに応じて**テキストの方向**(`dir`)を調整し、異なる読み方向の言語に対して読みやすさと使いやすさを向上させます。
|
|
1512
1454
|
- 支援技術がこれらの属性に依存して最適に機能するため、より**アクセシブル**な体験を提供します。
|
|
1513
1455
|
|
|
@@ -1517,11 +1459,11 @@ module.exports = App;
|
|
|
1517
1459
|
|
|
1518
1460
|
この動作は以下の理由で有用です:
|
|
1519
1461
|
|
|
1520
|
-
- **SEO
|
|
1462
|
+
- **SEOとユーザー体験**:ローカライズされたURLは、検索エンジンが言語別のページを正しくインデックスし、ユーザーに好みの言語でコンテンツを提供するのに役立ちます。
|
|
1521
1463
|
- **一貫性**:アプリケーション全体でローカライズされたリンクを使用することで、ナビゲーションが現在のロケール内に留まり、予期しない言語の切り替えを防ぎます。
|
|
1522
1464
|
- **保守性**: ローカリゼーションのロジックを単一のコンポーネントに集約することで、URLの管理が簡素化され、アプリケーションの成長に伴いコードベースの保守や拡張が容易になります。
|
|
1523
1465
|
|
|
1524
|
-
以下は、TypeScript
|
|
1466
|
+
以下は、TypeScriptで実装されたローカライズされた `Link` コンポーネントの例です。
|
|
1525
1467
|
|
|
1526
1468
|
```tsx fileName="src/components/Link.tsx" codeFormat="typescript"
|
|
1527
1469
|
import { getLocalizedUrl } from "intlayer";
|
|
@@ -1546,7 +1488,7 @@ export const checkIsExternalLink = (href?: string): boolean =>
|
|
|
1546
1488
|
/^https?:\/\//.test(href ?? "");
|
|
1547
1489
|
|
|
1548
1490
|
/**
|
|
1549
|
-
* 現在のロケールに基づいてhref
|
|
1491
|
+
* 現在のロケールに基づいてhref属性を適応するカスタムLinkコンポーネント。
|
|
1550
1492
|
* 内部リンクの場合、`getLocalizedUrl`を使用してURLの先頭にロケールを付加します(例:/fr/about)。
|
|
1551
1493
|
* これにより、ナビゲーションが同じロケールコンテキスト内に留まることを保証します。
|
|
1552
1494
|
*/
|
|
@@ -1585,13 +1527,13 @@ export const checkIsExternalLink = (href?: string): boolean =>
|
|
|
1585
1527
|
/**
|
|
1586
1528
|
* 現在のロケールに基づいてhref属性を適応させるカスタムLinkコンポーネント。
|
|
1587
1529
|
* 内部リンクの場合、`getLocalizedUrl`を使用してURLにロケールのプレフィックスを付けます(例:/fr/about)。
|
|
1588
|
-
*
|
|
1530
|
+
* これにより、ナビゲーションが同じロケールのコンテキスト内に留まることが保証されます。
|
|
1589
1531
|
*/
|
|
1590
1532
|
export const Link = forwardRef(({ href, children, ...props }, ref) => {
|
|
1591
1533
|
const { locale } = useLocale();
|
|
1592
1534
|
const isExternalLink = checkIsExternalLink(href);
|
|
1593
1535
|
|
|
1594
|
-
// リンクが内部リンクで有効な
|
|
1536
|
+
// リンクが内部リンクで有効なhrefが提供されている場合、ローカライズされたURLを取得します。
|
|
1595
1537
|
const hrefI18n =
|
|
1596
1538
|
href && !isExternalLink ? getLocalizedUrl(href, locale) : href;
|
|
1597
1539
|
|
|
@@ -1611,21 +1553,21 @@ const { useLocale } = require("react-intlayer");
|
|
|
1611
1553
|
const { forwardRef } = require("react");
|
|
1612
1554
|
|
|
1613
1555
|
/**
|
|
1614
|
-
* 指定された
|
|
1615
|
-
* URL
|
|
1556
|
+
* 指定されたURLが外部リンクかどうかをチェックするユーティリティ関数。
|
|
1557
|
+
* URLが http:// または https:// で始まる場合、外部リンクと見なされます。
|
|
1616
1558
|
*/
|
|
1617
1559
|
const checkIsExternalLink = (href) => /^https?:\/\//.test(href ?? "");
|
|
1618
1560
|
|
|
1619
1561
|
/**
|
|
1620
|
-
* 現在のロケールに基づいてhref
|
|
1621
|
-
* 内部リンクの場合、`getLocalizedUrl
|
|
1622
|
-
*
|
|
1562
|
+
* 現在のロケールに基づいて href 属性を適応するカスタム Link コンポーネント。
|
|
1563
|
+
* 内部リンクの場合、`getLocalizedUrl` を使用して URL にロケールをプレフィックスします(例: /fr/about)。
|
|
1564
|
+
* これにより、ナビゲーションが同じロケールのコンテキスト内に留まることが保証されます。
|
|
1623
1565
|
*/
|
|
1624
1566
|
const Link = forwardRef(({ href, children, ...props }, ref) => {
|
|
1625
1567
|
const { locale } = useLocale();
|
|
1626
1568
|
const isExternalLink = checkIsExternalLink(href);
|
|
1627
1569
|
|
|
1628
|
-
// リンクが内部リンクで有効なhrefが提供されている場合、ローカライズされたURLを取得します。
|
|
1570
|
+
// リンクが内部リンクで有効な href が提供されている場合、ローカライズされた URL を取得します。
|
|
1629
1571
|
const localizedHref = isExternalLink ? href : getLocalizedUrl(href, locale);
|
|
1630
1572
|
|
|
1631
1573
|
return (
|
|
@@ -1646,77 +1588,73 @@ Link.displayName = "Link";
|
|
|
1646
1588
|
#### 動作の仕組み
|
|
1647
1589
|
|
|
1648
1590
|
- **外部リンクの検出**:
|
|
1649
|
-
ヘルパー関数 `checkIsExternalLink` は、URL
|
|
1591
|
+
ヘルパー関数 `checkIsExternalLink` は、URLが外部リンクかどうかを判定します。外部リンクはローカライズの必要がないため、そのままにされます。
|
|
1650
1592
|
|
|
1651
1593
|
- **現在のロケールの取得**:
|
|
1652
|
-
`useLocale`
|
|
1594
|
+
`useLocale` フックは現在のロケール(例:フランス語の場合は `fr`)を提供します。
|
|
1653
1595
|
|
|
1654
1596
|
- **URLのローカライズ**:
|
|
1655
|
-
|
|
1597
|
+
内部リンク(すなわち外部リンクでない場合)には、`getLocalizedUrl` が使用され、URLの先頭に現在のロケールを自動的に付加します。例えば、ユーザーがフランス語環境にいる場合、`href` に `/about` を渡すと `/fr/about` に変換されます。
|
|
1656
1598
|
|
|
1657
1599
|
- **リンクの返却**:
|
|
1658
|
-
コンポーネントはローカライズされたURLを持つ `<a>`
|
|
1600
|
+
コンポーネントはローカライズされたURLを持つ `<a>` 要素を返し、ナビゲーションがロケールに一貫して対応するようにします。
|
|
1659
1601
|
|
|
1660
|
-
この `Link` コンポーネントをアプリケーション全体に統合することで、一貫性のある言語対応のユーザー体験を維持しつつ、SEO
|
|
1602
|
+
この `Link` コンポーネントをアプリケーション全体に統合することで、一貫性のある言語対応のユーザー体験を維持しつつ、SEOや使いやすさの向上も実現できます。
|
|
1661
1603
|
|
|
1662
|
-
### TypeScriptの設定
|
|
1604
|
+
### TypeScript の設定
|
|
1663
1605
|
|
|
1664
|
-
Intlayer
|
|
1606
|
+
Intlayer はモジュール拡張を利用して TypeScript の利点を活かし、コードベースをより強固にします。
|
|
1665
1607
|
|
|
1666
1608
|

|
|
1667
1609
|
|
|
1668
1610
|

|
|
1669
1611
|
|
|
1670
|
-
TypeScriptの設定に自動生成された型が含まれていることを確認してください。
|
|
1612
|
+
TypeScript の設定に自動生成された型が含まれていることを確認してください。
|
|
1671
1613
|
|
|
1672
|
-
|
|
1673
|
-
{
|
|
1674
|
-
// ... 既存のTypeScript設定
|
|
1675
|
-
"include": [
|
|
1676
|
-
コンポーネントはローカライズされたURLを持つ `<a>` 要素を返し、ロケールに応じたナビゲーションの一貫性を保証します。
|
|
1614
|
+
コンポーネントはローカライズされたURLを持つ`<a>`要素を返し、ナビゲーションがロケールに沿って一貫して行われることを保証します。
|
|
1677
1615
|
|
|
1678
|
-
|
|
1616
|
+
この`Link`コンポーネントをアプリケーション全体に統合することで、一貫性のある言語対応のユーザー体験を維持しつつ、SEOや使いやすさの向上も期待できます。
|
|
1679
1617
|
|
|
1680
|
-
### TypeScript
|
|
1618
|
+
### TypeScriptの設定
|
|
1681
1619
|
|
|
1682
|
-
Intlayer
|
|
1620
|
+
Intlayerはモジュール拡張を利用してTypeScriptの利点を活かし、コードベースをより堅牢にします。
|
|
1683
1621
|
|
|
1684
1622
|

|
|
1685
1623
|
|
|
1686
1624
|

|
|
1687
1625
|
|
|
1688
|
-
TypeScript
|
|
1626
|
+
TypeScriptの設定に自動生成された型を含めることを確認してください。
|
|
1689
1627
|
|
|
1690
1628
|
```json5 fileName="tsconfig.json"
|
|
1691
1629
|
{
|
|
1692
|
-
// ... 既存の
|
|
1630
|
+
// ... 既存のTypeScript設定
|
|
1693
1631
|
"include": [
|
|
1694
|
-
// ... 既存の
|
|
1632
|
+
// ... 既存のTypeScript設定
|
|
1695
1633
|
".intlayer/**/*.ts", // 自動生成された型を含める
|
|
1696
1634
|
],
|
|
1697
1635
|
}
|
|
1698
|
-
|
|
1636
|
+
```
|
|
1699
1637
|
|
|
1700
|
-
### Git
|
|
1638
|
+
### Gitの設定
|
|
1701
1639
|
|
|
1702
|
-
Intlayer
|
|
1640
|
+
Intlayerによって生成されたファイルはGitリポジトリにコミットしないように無視することを推奨します。
|
|
1703
1641
|
|
|
1704
|
-
これを行うには、`.gitignore
|
|
1642
|
+
これを行うには、`.gitignore`ファイルに以下の指示を追加してください。
|
|
1705
1643
|
|
|
1706
1644
|
```plaintext
|
|
1707
|
-
# Intlayer
|
|
1645
|
+
# Intlayerによって生成されたファイルを無視する
|
|
1708
1646
|
.intlayer
|
|
1709
1647
|
```
|
|
1710
1648
|
|
|
1711
|
-
### VS Code
|
|
1649
|
+
### VS Code拡張機能
|
|
1712
1650
|
|
|
1713
|
-
Intlayer
|
|
1651
|
+
Intlayerでの開発体験を向上させるために、公式の**Intlayer VS Code拡張機能**をインストールできます。
|
|
1714
1652
|
|
|
1715
|
-
[VS Code
|
|
1653
|
+
[VS Codeマーケットプレイスからインストール](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
1716
1654
|
|
|
1717
1655
|
この拡張機能は以下を提供します:
|
|
1718
1656
|
|
|
1719
|
-
-
|
|
1657
|
+
- 翻訳キーの**オートコンプリート**。
|
|
1720
1658
|
- **翻訳が不足している場合のリアルタイムエラー検出**。
|
|
1721
1659
|
- **翻訳内容のインラインプレビュー**。
|
|
1722
1660
|
- **翻訳の作成や更新を簡単に行うクイックアクション**。
|
|
@@ -1727,7 +1665,7 @@ Intlayer の開発体験を向上させるために、公式の **Intlayer VS Co
|
|
|
1727
1665
|
|
|
1728
1666
|
### さらに進むために
|
|
1729
1667
|
|
|
1730
|
-
|
|
1668
|
+
さらに進むには、[ビジュアルエディター](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_visual_editor.md)を実装するか、[CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_CMS.md)を使用してコンテンツを外部化することができます。
|
|
1731
1669
|
|
|
1732
1670
|
---
|
|
1733
1671
|
|