@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
|
@@ -0,0 +1,1042 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-09-07
|
|
3
|
+
updatedAt: 2025-09-07
|
|
4
|
+
title: Vite ve Vue web sitenizi çevirin (i18n)
|
|
5
|
+
description: Vite ve Vue web sitenizi çok dilli hale getirmeyi öğrenin. Dokümantasyonu takip ederek uluslararasılaştırma (i18n) ve çevirisini yapın.
|
|
6
|
+
keywords:
|
|
7
|
+
- Uluslararasılaştırma
|
|
8
|
+
- Dokümantasyon
|
|
9
|
+
- Intlayer
|
|
10
|
+
- Vite
|
|
11
|
+
- Vue
|
|
12
|
+
- JavaScript
|
|
13
|
+
slugs:
|
|
14
|
+
- doc
|
|
15
|
+
- environment
|
|
16
|
+
- vite-and-vue
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-vite-vue-template
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Intlayer ve Vite ve Vue ile Uluslararasılaştırma Başlangıç Kılavuzu (i18n)
|
|
21
|
+
|
|
22
|
+
GitHub'da [Uygulama Şablonu](https://github.com/aymericzip/intlayer-vite-vue-template)'na bakın.
|
|
23
|
+
|
|
24
|
+
## Intlayer Nedir?
|
|
25
|
+
|
|
26
|
+
**Intlayer**, modern web uygulamalarında çok dilli desteği basitleştirmek için tasarlanmış yenilikçi, açık kaynaklı bir uluslararasılaştırma (i18n) kütüphanesidir.
|
|
27
|
+
|
|
28
|
+
Intlayer ile şunları yapabilirsiniz:
|
|
29
|
+
|
|
30
|
+
- **Bileşen düzeyinde açıklayıcı sözlükler kullanarak çevirileri kolayca yönetin**.
|
|
31
|
+
- **Meta verileri, rotaları ve içeriği dinamik olarak yerelleştirin**.
|
|
32
|
+
- **Otomatik oluşturulan türlerle TypeScript desteği sağlayın**, böylece otomatik tamamlama ve hata algılama iyileşir.
|
|
33
|
+
- **Dinamik yerel ayar algılama ve anahtarlama gibi gelişmiş özelliklerden yararlanın**.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Vite ve Vue Uygulamasında Intlayer Kurulumu İçin Adım Adım Kılavuz
|
|
38
|
+
|
|
39
|
+
### Adım 1: Bağımlılıkları Kurma
|
|
40
|
+
|
|
41
|
+
Gerekli paketleri npm kullanarak kurun:
|
|
42
|
+
|
|
43
|
+
```bash packageManager="npm"
|
|
44
|
+
npm install intlayer vue-intlayer
|
|
45
|
+
npm install vite-intlayer --save-dev
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```bash packageManager="pnpm"
|
|
49
|
+
pnpm add intlayer vue-intlayer
|
|
50
|
+
pnpm add vite-intlayer --save-dev
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```bash packageManager="yarn"
|
|
54
|
+
yarn add intlayer vue-intlayer
|
|
55
|
+
yarn add vite-intlayer --save-dev
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- **intlayer**
|
|
59
|
+
|
|
60
|
+
Yapılandırma yönetimi, çeviri, [içerik bildirimi](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md), dönüştürme ve [CLI komutları](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_cli.md) için uluslararasılaştırma araçları sağlayan çekirdek paket.
|
|
61
|
+
|
|
62
|
+
- **vue-intlayer**
|
|
63
|
+
Vue uygulamasıyla Intlayer'ı entegre eden paket. Vue uluslararasılaştırması için bağlam sağlayıcıları ve composables sağlar.
|
|
64
|
+
|
|
65
|
+
- **vite-intlayer**
|
|
66
|
+
[Vite bundler](https://vite.dev/guide/why.html#why-bundle-for-production) ile Intlayer'ı entegre etmek için Vite eklentisini ve kullanıcının tercih ettiği yerel ayarı algılamak, çerezleri yönetmek ve URL yönlendirmesi yapmak için middleware'i içerir.
|
|
67
|
+
|
|
68
|
+
### Adım 2: Projenizi Yapılandırma
|
|
69
|
+
|
|
70
|
+
Uygulamanızın dillerini yapılandırmak için bir yapılandırma dosyası oluşturun:
|
|
71
|
+
|
|
72
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
73
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
74
|
+
|
|
75
|
+
const config: IntlayerConfig = {
|
|
76
|
+
internationalization: {
|
|
77
|
+
locales: [
|
|
78
|
+
Locales.ENGLISH,
|
|
79
|
+
Locales.FRENCH,
|
|
80
|
+
Locales.SPANISH,
|
|
81
|
+
// Diğer yerel ayarlarınız
|
|
82
|
+
],
|
|
83
|
+
defaultLocale: Locales.ENGLISH,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export default config;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
91
|
+
import { Locales } from "intlayer";
|
|
92
|
+
|
|
93
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
94
|
+
const config = {
|
|
95
|
+
internationalization: {
|
|
96
|
+
locales: [
|
|
97
|
+
Locales.ENGLISH,
|
|
98
|
+
Locales.FRENCH,
|
|
99
|
+
Locales.SPANISH,
|
|
100
|
+
// Diğer yerel ayarlarınız
|
|
101
|
+
],
|
|
102
|
+
defaultLocale: Locales.ENGLISH,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export default config;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
110
|
+
const { Locales } = require("intlayer");
|
|
111
|
+
|
|
112
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
113
|
+
const config = {
|
|
114
|
+
internationalization: {
|
|
115
|
+
locales: [
|
|
116
|
+
Locales.ENGLISH,
|
|
117
|
+
Locales.FRENCH,
|
|
118
|
+
Locales.SPANISH,
|
|
119
|
+
// Diğer yerel ayarlarınız
|
|
120
|
+
],
|
|
121
|
+
defaultLocale: Locales.ENGLISH,
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
module.exports = config;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
> Bu yapılandırma dosyası aracılığıyla, yerelleştirilmiş URL'leri, middleware yönlendirmesini, çerez adlarını, içerik bildiriminizin konumunu ve uzantısını, Intlayer günlüklerini konsolda devre dışı bırakmayı ve daha fazlasını ayarlayabilirsiniz. Kullanılabilir parametrelerin tam listesi için [yapılandırma dokümantasyonuna](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md) bakın.
|
|
129
|
+
|
|
130
|
+
### Adım 3: Intlayer'ı Vite Yapılandırmanıza Entegre Etme
|
|
131
|
+
|
|
132
|
+
Yapılandırmanıza intlayer eklentisini ekleyin.
|
|
133
|
+
|
|
134
|
+
```typescript fileName="vite.config.ts" codeFormat="typescript"
|
|
135
|
+
import { defineConfig } from "vite";
|
|
136
|
+
import vue from "@vitejs/plugin-vue";
|
|
137
|
+
import { intlayerPlugin } from "vite-intlayer";
|
|
138
|
+
|
|
139
|
+
// https://vitejs.dev/config/
|
|
140
|
+
export default defineConfig({
|
|
141
|
+
plugins: [vue(), intlayerPlugin()],
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
```javascript fileName="vite.config.mjs" codeFormat="esm"
|
|
146
|
+
import { defineConfig } from "vite";
|
|
147
|
+
import vue from "@vitejs/plugin-vue";
|
|
148
|
+
import { intlayerPlugin } from "vite-intlayer";
|
|
149
|
+
|
|
150
|
+
// https://vitejs.dev/config/
|
|
151
|
+
export default defineConfig({
|
|
152
|
+
plugins: [vue(), intlayerPlugin()],
|
|
153
|
+
});
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
```javascript fileName="vite.config.cjs" codeFormat="commonjs"
|
|
157
|
+
const { defineConfig } = require("vite");
|
|
158
|
+
const vue = require("@vitejs/plugin-vue");
|
|
159
|
+
const { intlayerPlugin } = require("vite-intlayer");
|
|
160
|
+
|
|
161
|
+
// https://vitejs.dev/config/
|
|
162
|
+
module.exports = defineConfig({
|
|
163
|
+
plugins: [vue(), intlayerPlugin()],
|
|
164
|
+
});
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
> `intlayerPlugin()` Vite eklentisi, Vite ile Intlayer'ı entegre etmek için kullanılır. İçerik bildirimi dosyalarının oluşturulmasını sağlar ve bunları geliştirme modunda izler. Ayrıca Intlayer ortam değişkenlerini Vite uygulaması içinde tanımlar. Ek olarak, performansı optimize etmek için takma adlar sağlar.
|
|
168
|
+
|
|
169
|
+
### Adım 4: İçeriğinizi Bildirin
|
|
170
|
+
|
|
171
|
+
Çevirileri depolamak için içerik bildiriminizi oluşturun ve yönetin:
|
|
172
|
+
|
|
173
|
+
```tsx fileName="src/helloWorld.content.ts" contentDeclarationFormat="typescript"
|
|
174
|
+
import { t, type Dictionary } from "intlayer";
|
|
175
|
+
|
|
176
|
+
const helloWorldContent = {
|
|
177
|
+
key: "helloworld",
|
|
178
|
+
content: {
|
|
179
|
+
count: t({ en: "count is ", fr: "le compte est ", es: "el recuento es " }),
|
|
180
|
+
edit: t({
|
|
181
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
182
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
183
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
184
|
+
}),
|
|
185
|
+
checkOut: t({ en: "Check out ", fr: "Vérifiez ", es: "Compruebe " }),
|
|
186
|
+
officialStarter: t({
|
|
187
|
+
en: "the official Vue + Vite starter",
|
|
188
|
+
fr: "le starter officiel Vue + Vite",
|
|
189
|
+
es: "el starter oficial Vue + Vite",
|
|
190
|
+
}),
|
|
191
|
+
learnMore: t({
|
|
192
|
+
en: "Learn more about IDE Support for Vue in the ",
|
|
193
|
+
fr: "En savoir plus sur le support IDE pour Vue dans le ",
|
|
194
|
+
es: "Aprenda más sobre el soporte IDE para Vue en el ",
|
|
195
|
+
}),
|
|
196
|
+
vueDocs: t({
|
|
197
|
+
en: "Vue Docs Scaling up Guide",
|
|
198
|
+
fr: "Vue Docs Scaling up Guide",
|
|
199
|
+
es: "Vue Docs Scaling up Guide",
|
|
200
|
+
}),
|
|
201
|
+
readTheDocs: t({
|
|
202
|
+
en: "Click on the Vite and Vue logos to learn more",
|
|
203
|
+
fr: "Cliquez sur les logos Vite et Vue pour en savoir plus",
|
|
204
|
+
es: "Haga clic en los logotipos de Vite y Vue para obtener más información",
|
|
205
|
+
}),
|
|
206
|
+
},
|
|
207
|
+
} satisfies Dictionary;
|
|
208
|
+
|
|
209
|
+
export default helloWorldContent;
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
```javascript fileName="src/helloWorld.content.mjs" contentDeclarationFormat="esm"
|
|
213
|
+
import { t } from "intlayer";
|
|
214
|
+
|
|
215
|
+
/** @type {import('intlayer').Dictionary} */
|
|
216
|
+
const helloWorldContent = {
|
|
217
|
+
key: "helloworld",
|
|
218
|
+
content: {
|
|
219
|
+
count: t({ en: "count is ", fr: "le compte est ", es: "el recuento es " }),
|
|
220
|
+
edit: t({
|
|
221
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
222
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
223
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
224
|
+
}),
|
|
225
|
+
checkOut: t({ en: "Check out ", fr: "Vérifiez ", es: "Compruebe " }),
|
|
226
|
+
officialStarter: t({
|
|
227
|
+
en: "the official Vue + Vite starter",
|
|
228
|
+
fr: "le starter officiel Vue + Vite",
|
|
229
|
+
es: "el starter oficial Vue + Vite",
|
|
230
|
+
}),
|
|
231
|
+
learnMore: t({
|
|
232
|
+
en: "Learn more about IDE Support for Vue in the ",
|
|
233
|
+
fr: "En savoir plus sur le support IDE pour Vue dans le ",
|
|
234
|
+
es: "Aprenda más sobre el soporte IDE para Vue en el ",
|
|
235
|
+
}),
|
|
236
|
+
vueDocs: t({
|
|
237
|
+
en: "Vue Docs Scaling up Guide",
|
|
238
|
+
fr: "Vue Docs Scaling up Guide",
|
|
239
|
+
es: "Vue Docs Scaling up Guide",
|
|
240
|
+
}),
|
|
241
|
+
readTheDocs: t({
|
|
242
|
+
en: "Click on the Vite and Vue logos to learn more",
|
|
243
|
+
fr: "Cliquez sur les logos Vite et Vue pour en savoir plus",
|
|
244
|
+
es: "Haga clic en los logotipos de Vite y Vue para obtener más información",
|
|
245
|
+
}),
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export default helloWorldContent;
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
```javascript fileName="src/helloWorld.content.cjs" codeFormat="commonjs"
|
|
253
|
+
const { t } = require("intlayer");
|
|
254
|
+
|
|
255
|
+
/** @type {import('intlayer').Dictionary} */
|
|
256
|
+
const appContent = {
|
|
257
|
+
key: "helloworld",
|
|
258
|
+
content: {
|
|
259
|
+
count: t({ en: "count is ", fr: "le compte est ", es: "el recuento es " }),
|
|
260
|
+
edit: t({
|
|
261
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
262
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
263
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
264
|
+
}),
|
|
265
|
+
checkOut: t({ en: "Check out ", fr: "Vérifiez ", es: "Compruebe " }),
|
|
266
|
+
officialStarter: t({
|
|
267
|
+
en: "the official Vue + Vite starter",
|
|
268
|
+
fr: "le starter officiel Vue + Vite",
|
|
269
|
+
es: "el starter oficial Vue + Vite",
|
|
270
|
+
}),
|
|
271
|
+
learnMore: t({
|
|
272
|
+
en: "Learn more about IDE Support for Vue in the ",
|
|
273
|
+
fr: "En savoir plus sur le support IDE pour Vue dans le ",
|
|
274
|
+
es: "Aprenda más sobre el soporte IDE para Vue en el ",
|
|
275
|
+
}),
|
|
276
|
+
vueDocs: t({
|
|
277
|
+
en: "Vue Docs Scaling up Guide",
|
|
278
|
+
fr: "Vue Docs Scaling up Guide",
|
|
279
|
+
es: "Vue Docs Scaling up Guide",
|
|
280
|
+
}),
|
|
281
|
+
readTheDocs: t({
|
|
282
|
+
en: "Click on the Vite and Vue logos to learn more",
|
|
283
|
+
fr: "Cliquez sur les logos Vite et Vue pour en savoir plus",
|
|
284
|
+
es: "Haga clic en los logotipos de Vite y Vue para obtener más información",
|
|
285
|
+
}),
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
module.exports = appContent;
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
```json fileName="src/helloWorld.content.json" contentDeclarationFormat="json"
|
|
293
|
+
{
|
|
294
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
295
|
+
"key": "helloworld",
|
|
296
|
+
"content": {
|
|
297
|
+
"count": {
|
|
298
|
+
"nodeType": "translation",
|
|
299
|
+
"translation": {
|
|
300
|
+
"en": "count is ",
|
|
301
|
+
"fr": "le compte est ",
|
|
302
|
+
"es": "el recuento es "
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
"edit": {
|
|
306
|
+
"nodeType": "translation",
|
|
307
|
+
"translation": {
|
|
308
|
+
"en": "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
309
|
+
"fr": "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
310
|
+
"es": "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR"
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"checkOut": {
|
|
314
|
+
"nodeType": "translation",
|
|
315
|
+
"translation": {
|
|
316
|
+
"en": "Check out ",
|
|
317
|
+
"fr": "Vérifiez ",
|
|
318
|
+
"es": "Compruebe "
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"officialStarter": {
|
|
322
|
+
"nodeType": "translation",
|
|
323
|
+
"translation": {
|
|
324
|
+
"en": "the official Vue + Vite starter",
|
|
325
|
+
"fr": "le starter officiel Vue + Vite",
|
|
326
|
+
"es": "el starter oficial Vue + Vite"
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
"learnMore": {
|
|
330
|
+
"nodeType": "translation",
|
|
331
|
+
"translation": {
|
|
332
|
+
"en": "Learn more about IDE Support for Vue in the ",
|
|
333
|
+
"fr": "En savoir plus sur le support IDE pour Vue dans le ",
|
|
334
|
+
"es": "Aprenda más sobre el soporte IDE para Vue en el "
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"vueDocs": {
|
|
338
|
+
"nodeType": "translation",
|
|
339
|
+
"translation": {
|
|
340
|
+
"en": "Vue Docs Scaling up Guide",
|
|
341
|
+
"fr": "Vue Docs Scaling up Guide",
|
|
342
|
+
"es": "Vue Docs Scaling up Guide"
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"readTheDocs": {
|
|
346
|
+
"nodeType": "translation",
|
|
347
|
+
"translation": {
|
|
348
|
+
"en": "Click on the Vite and Vue logos to learn more",
|
|
349
|
+
"fr": "Cliquez sur les logos Vite et Vue pour en savoir plus",
|
|
350
|
+
"es": "Haga clic en los logotipos de Vite y Vue para obtener más información"
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
> İçerik bildiriminiz uygulamanızın herhangi bir yerine yerleştirilebilir, yeter ki `contentDir` dizinine dahil edilsin (varsayılan olarak `./src`). Ve içerik bildirimi dosya uzantısı ile eşleşsin (varsayılan olarak `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
|
|
358
|
+
|
|
359
|
+
> Daha fazla ayrıntı için [içerik bildirimi dokümantasyonuna](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md) bakın.
|
|
360
|
+
|
|
361
|
+
### Adım 5: Kodunuzda Intlayer'ı Kullanın
|
|
362
|
+
|
|
363
|
+
Vue uygulamanız boyunca Intlayer'ın uluslararasılaştırma özelliklerine erişmek için, ana dosyanızda Intlayer singleton örneğini kaydetmeniz gerekir. Bu adım, çevirilerin bileşen ağacınızın herhangi bir yerinde erişilebilir olmasını sağlamak için çok önemlidir.
|
|
364
|
+
|
|
365
|
+
```javascript fileName=main.js
|
|
366
|
+
import { createApp } from "vue";
|
|
367
|
+
import { installIntlayer } from "vue-intlayer";
|
|
368
|
+
import App from "./App.vue";
|
|
369
|
+
import "./style.css";
|
|
370
|
+
|
|
371
|
+
const app = createApp(App);
|
|
372
|
+
|
|
373
|
+
// Üst düzeyde sağlayıcıyı enjekte edin
|
|
374
|
+
installIntlayer(app);
|
|
375
|
+
|
|
376
|
+
// Uygulamayı bağlayın
|
|
377
|
+
app.mount("#app");
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
İçerik sözlüklerinize uygulamanız boyunca erişin ve `useIntlayer` composables kullanarak bir ana Vue bileşeni oluşturun:
|
|
381
|
+
|
|
382
|
+
```vue fileName="src/HelloWord.vue"
|
|
383
|
+
<script setup lang="ts">
|
|
384
|
+
import { ref } from "vue";
|
|
385
|
+
import { useIntlayer } from "vue-intlayer";
|
|
386
|
+
|
|
387
|
+
defineProps({
|
|
388
|
+
msg: String,
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
const {
|
|
392
|
+
count,
|
|
393
|
+
edit,
|
|
394
|
+
checkOut,
|
|
395
|
+
officialStarter,
|
|
396
|
+
learnMore,
|
|
397
|
+
vueDocs,
|
|
398
|
+
readTheDocs,
|
|
399
|
+
} = useIntlayer("helloworld");
|
|
400
|
+
const countRef = ref(0);
|
|
401
|
+
</script>
|
|
402
|
+
|
|
403
|
+
<template>
|
|
404
|
+
<h1>{{ msg }}</h1>
|
|
405
|
+
|
|
406
|
+
<div class="card">
|
|
407
|
+
<button type="button" @click="countRef++">
|
|
408
|
+
<count />
|
|
409
|
+
{{ countRef }}
|
|
410
|
+
</button>
|
|
411
|
+
<p v-html="edit"></p>
|
|
412
|
+
</div>
|
|
413
|
+
|
|
414
|
+
<p>
|
|
415
|
+
<checkOut />
|
|
416
|
+
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
|
|
417
|
+
>create-vue</a
|
|
418
|
+
>, <officialStarter />
|
|
419
|
+
</p>
|
|
420
|
+
<p>
|
|
421
|
+
<learnMore />
|
|
422
|
+
<a
|
|
423
|
+
href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
|
|
424
|
+
target="_blank"
|
|
425
|
+
><vueDocs /></a
|
|
426
|
+
>.
|
|
427
|
+
</p>
|
|
428
|
+
<p class="read-the-docs"><readTheDocs /></p>
|
|
429
|
+
<p class="read-the-docs">{{ readTheDocs }}</p>
|
|
430
|
+
</template>
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
#### Intlayer'da İçeriğe Erişim
|
|
434
|
+
|
|
435
|
+
Intlayer, içeriğinize erişmek için farklı API'ler sunar:
|
|
436
|
+
|
|
437
|
+
- **Bileşen tabanlı sözdizimi** (önerilen):
|
|
438
|
+
İçeriği Intlayer Düğümü olarak işlemek için `<myContent />` veya `<Component :is="myContent" />` sözdizimini kullanın. Bu, [Görsel Düzenleyici](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md) ve [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md) ile sorunsuz bir şekilde entegre olur.
|
|
439
|
+
|
|
440
|
+
- **Dize tabanlı sözdizimi**:
|
|
441
|
+
İçeriği düz metin olarak işlemek için `{{ myContent }}` kullanın, Görsel Düzenleyici desteği olmadan.
|
|
442
|
+
|
|
443
|
+
- **Ham HTML sözdizimi**:
|
|
444
|
+
İçeriği ham HTML olarak işlemek için `<div v-html="myContent" />` kullanın, Görsel Düzenleyici desteği olmadan.
|
|
445
|
+
|
|
446
|
+
- **Yıkım sözdizimi**:
|
|
447
|
+
`useIntlayer` composable, içeriği erişirken reaktifliği koruyan bir Proxy döndürür.
|
|
448
|
+
- `const content = useIntlayer("myContent");` Ve `{{ content.myContent }}` / `<content.myContent />` kullanın.
|
|
449
|
+
- Veya `const { myContent } = useIntlayer("myContent");` Ve `{{ myContent}}` / `<myContent/>` kullanarak içeriği yıkın.
|
|
450
|
+
|
|
451
|
+
### (İsteğe Bağlı) Adım 6: İçeriğinizin Dilini Değiştirin
|
|
452
|
+
|
|
453
|
+
İçeriğinizin dilini değiştirmek için `useLocale` composable tarafından sağlanan `setLocale` işlevini kullanabilirsiniz. Bu işlev, uygulamanın yerel ayarını ayarlamanıza ve içeriği buna göre güncellemenize olanak tanır.
|
|
454
|
+
|
|
455
|
+
Dilleri değiştirmek için bir bileşen oluşturun:
|
|
456
|
+
|
|
457
|
+
```vue fileName="src/components/LocaleSwitcher.vue"
|
|
458
|
+
<template>
|
|
459
|
+
<div class="locale-switcher">
|
|
460
|
+
<select v-model="selectedLocale" @change="changeLocale">
|
|
461
|
+
<option v-for="loc in availableLocales" :key="loc" :value="loc">
|
|
462
|
+
{{ getLocaleName(loc) }}
|
|
463
|
+
</option>
|
|
464
|
+
</select>
|
|
465
|
+
</div>
|
|
466
|
+
</template>
|
|
467
|
+
|
|
468
|
+
<script setup lang="ts">
|
|
469
|
+
import { ref, watch } from "vue";
|
|
470
|
+
import { getLocaleName } from "intlayer";
|
|
471
|
+
import { useLocale } from "vue-intlayer";
|
|
472
|
+
|
|
473
|
+
// Yerel ayar bilgilerini ve setLocale işlevini alın
|
|
474
|
+
const { locale, availableLocales, setLocale } = useLocale();
|
|
475
|
+
|
|
476
|
+
// Seçilen yerel ayarı bir ref ile takip edin
|
|
477
|
+
const selectedLocale = ref(locale.value);
|
|
478
|
+
|
|
479
|
+
// Seçim değiştiğinde yerel ayarı güncelleyin
|
|
480
|
+
const changeLocale = () => setLocale(selectedLocale.value);
|
|
481
|
+
|
|
482
|
+
// Seçilen yerel ayarı genel yerel ayar ile senkronize tutun
|
|
483
|
+
watch(
|
|
484
|
+
() => locale.value,
|
|
485
|
+
(newLocale) => {
|
|
486
|
+
selectedLocale.value = newLocale;
|
|
487
|
+
}
|
|
488
|
+
);
|
|
489
|
+
</script>
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
Ardından, bu bileşeni App.vue'nuzda kullanın:
|
|
493
|
+
|
|
494
|
+
```vue fileName="src/App.vue"
|
|
495
|
+
<script setup lang="ts">
|
|
496
|
+
import { useIntlayer } from "vue-intlayer";
|
|
497
|
+
import HelloWorld from "@components/HelloWorld.vue";
|
|
498
|
+
import LocaleSwitcher from "@components/LocaleSwitcher.vue";
|
|
499
|
+
import { ref, watch } from "vue";
|
|
500
|
+
|
|
501
|
+
const content = useIntlayer("app"); // İlgili intlayer bildirim dosyası oluşturun
|
|
502
|
+
</script>
|
|
503
|
+
|
|
504
|
+
<template>
|
|
505
|
+
<div>
|
|
506
|
+
<LocaleSwitcher />
|
|
507
|
+
<a href="https://vite.dev" target="_blank">
|
|
508
|
+
<img src="/vite.svg" class="logo" :alt="content.viteLogo" />
|
|
509
|
+
</a>
|
|
510
|
+
<a href="https://vuejs.org/" target="_blank">
|
|
511
|
+
<img src="./assets/vue.svg" class="logo vue" :alt="content.vueLogo" />
|
|
512
|
+
</a>
|
|
513
|
+
</div>
|
|
514
|
+
<HelloWorld :msg="content.title" />
|
|
515
|
+
</template>
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
### (İsteğe Bağlı) Adım 7: Uygulamanıza Yerelleştirilmiş Yönlendirme Ekleyin
|
|
519
|
+
|
|
520
|
+
Vue uygulamasında yerelleştirilmiş yönlendirme eklemek genellikle yerel ayar önekleriyle Vue Router kullanmayı içerir. Bu, her dil için benzersiz rotalar oluşturur, SEO ve SEO dostu URL'ler için kullanışlıdır.
|
|
521
|
+
Örnek:
|
|
522
|
+
|
|
523
|
+
```plaintext
|
|
524
|
+
- https://example.com/about
|
|
525
|
+
- https://example.com/es/about
|
|
526
|
+
- https://example.com/fr/about
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
Öncelikle Vue Router'ı kurun:
|
|
530
|
+
|
|
531
|
+
```bash packageManager="npm"
|
|
532
|
+
npm install intlayer vue-router
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
```bash packageManager="pnpm"
|
|
536
|
+
pnpm add intlayer vue-router
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
```bash packageManager="yarn"
|
|
540
|
+
yarn add intlayer vue-router
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
Ardından, yerel ayar tabanlı yönlendirmeyi yöneten bir yönlendirici yapılandırması oluşturun:
|
|
544
|
+
|
|
545
|
+
```js fileName="src/router/index.ts"
|
|
546
|
+
import {
|
|
547
|
+
configuration,
|
|
548
|
+
getPathWithoutLocale,
|
|
549
|
+
localeFlatMap,
|
|
550
|
+
type Locales,
|
|
551
|
+
} from 'intlayer';
|
|
552
|
+
import { createIntlayerClient } from 'vue-intlayer';
|
|
553
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
554
|
+
import HomeView from './views/home/HomeView.vue';
|
|
555
|
+
import RootView from './views/root/Root.vue';
|
|
556
|
+
|
|
557
|
+
// Uluslararasılaştırma yapılandırmasını çıkar
|
|
558
|
+
const { internationalization, middleware } = configuration;
|
|
559
|
+
const { defaultLocale } = internationalization;
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Yerel ayar özel yollarla ve meta verilerle rotaları bildirin.
|
|
563
|
+
*/
|
|
564
|
+
const routes = localeFlatMap((localizedData) => [
|
|
565
|
+
{
|
|
566
|
+
path: `${localizedData.urlPrefix}/`,
|
|
567
|
+
name: `Root-${localizedData.locale}`,
|
|
568
|
+
component: RootView,
|
|
569
|
+
meta: {
|
|
570
|
+
locale: localizedData.locale,
|
|
571
|
+
},
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
path: `${localizedData.urlPrefix}/home`,
|
|
575
|
+
name: `Home-${localizedData.locale}`,
|
|
576
|
+
component: HomeView,
|
|
577
|
+
meta: {
|
|
578
|
+
locale: localizedData.locale,
|
|
579
|
+
},
|
|
580
|
+
},
|
|
581
|
+
]);
|
|
582
|
+
|
|
583
|
+
// Yönlendirici örneğini oluştur
|
|
584
|
+
export const router = createRouter({
|
|
585
|
+
history: createWebHistory(),
|
|
586
|
+
routes,
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
// Yerel ayar yönetimi için navigasyon koruması ekleyin
|
|
590
|
+
router.beforeEach((to, _from, next) => {
|
|
591
|
+
const client = createIntlayerClient();
|
|
592
|
+
|
|
593
|
+
const metaLocale = to.meta.locale as Locales | undefined;
|
|
594
|
+
|
|
595
|
+
if (metaLocale) {
|
|
596
|
+
// Rota meta'sında tanımlanan yerel ayarı yeniden kullan
|
|
597
|
+
client.setLocale(metaLocale);
|
|
598
|
+
next();
|
|
599
|
+
} else {
|
|
600
|
+
// Geri dönüş: meta'da yerel ayar yok, muhtemelen eşleşmeyen rota
|
|
601
|
+
// İsteğe bağlı: 404'ü yönetin veya varsayılan yerel ayara yönlendirin
|
|
602
|
+
client.setLocale(defaultLocale);
|
|
603
|
+
|
|
604
|
+
if (middleware.prefixDefault) {
|
|
605
|
+
next(`/${defaultLocale}${getPathWithoutLocale(to.path)}`);
|
|
606
|
+
} else {
|
|
607
|
+
next(getPathWithoutLocale(to.path));
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
> Ad, tüm rotalar arasında benzersiz olmalı ve çakışmaları önlemek için yönlendirme ve bağlantıyı sağlamak için kullanılır.
|
|
614
|
+
|
|
615
|
+
Ardından, yönlendiriciyi main.js dosyanızda kaydedin:
|
|
616
|
+
|
|
617
|
+
```js fileName="src/main.ts"
|
|
618
|
+
import { createApp } from "vue";
|
|
619
|
+
import App from "./App.vue";
|
|
620
|
+
import { router } from "./router";
|
|
621
|
+
import "./style.css";
|
|
622
|
+
|
|
623
|
+
const app = createApp(App);
|
|
624
|
+
|
|
625
|
+
// Uygulamaya yönlendiriciyi ekleyin
|
|
626
|
+
app.use(router);
|
|
627
|
+
|
|
628
|
+
// Uygulamayı bağlayın
|
|
629
|
+
app.mount("#app");
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
Ardından, RouterView bileşenini işlemek için App.vue dosyanızı güncelleyin. Bu bileşen, geçerli rota için eşleşen bileşeni görüntüler.
|
|
633
|
+
|
|
634
|
+
```vue fileName="src/App.vue"
|
|
635
|
+
<script setup lang="ts">
|
|
636
|
+
import LocaleSwitcher from "@components/LocaleSwitcher.vue";
|
|
637
|
+
</script>
|
|
638
|
+
|
|
639
|
+
<template>
|
|
640
|
+
<nav>
|
|
641
|
+
<LocaleSwitcher />
|
|
642
|
+
</nav>
|
|
643
|
+
<RouterView />
|
|
644
|
+
</template>
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
Paralel olarak, uygulamanıza sunucu tarafı yönlendirme eklemek için `intlayerMiddlewarePlugin`'i de kullanabilirsiniz. Bu eklenti, URL'ye göre geçerli yerel ayarı otomatik olarak algılar ve uygun yerel ayar çerezini ayarlar. Hiç yerel ayar belirtilmezse, eklenti kullanıcının tarayıcı dil tercihlerine göre en uygun yerel ayarı belirler. Hiç yerel ayar algılanmazsa, varsayılan yerel ayara yönlendirir.
|
|
648
|
+
|
|
649
|
+
> Not: Üretimde `intlayerMiddlewarePlugin`'i kullanmak için `vite-intlayer` paketini `devDependencies`'den `dependencies`'e taşımalısınız.
|
|
650
|
+
|
|
651
|
+
```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
|
|
652
|
+
import { defineConfig } from "vite";
|
|
653
|
+
import vue from "@vitejs/plugin-vue";
|
|
654
|
+
import { intlayerPlugin, intlayerMiddlewarePlugin } from "vite-intlayer";
|
|
655
|
+
|
|
656
|
+
// https://vitejs.dev/config/
|
|
657
|
+
export default defineConfig({
|
|
658
|
+
plugins: [vue(), intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
659
|
+
});
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
```javascript {3,7} fileName="vite.config.mjs" codeFormat="esm"
|
|
663
|
+
import { defineConfig } from "vite";
|
|
664
|
+
import vue from "@vitejs/plugin-vue";
|
|
665
|
+
import { intlayerPlugin, intlayerMiddlewarePlugin } from "vite-intlayer";
|
|
666
|
+
|
|
667
|
+
// https://vitejs.dev/config/
|
|
668
|
+
export default defineConfig({
|
|
669
|
+
plugins: [vue(), intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
670
|
+
});
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
```javascript fileName="vite.config.cjs" codeFormat="commonjs"
|
|
674
|
+
const { defineConfig } = require("vite");
|
|
675
|
+
const vue = require("@vitejs/plugin-vue");
|
|
676
|
+
const { intlayerPlugin, intlayerMiddlewarePlugin } = require("vite-intlayer");
|
|
677
|
+
|
|
678
|
+
// https://vitejs.dev/config/
|
|
679
|
+
module.exports = defineConfig({
|
|
680
|
+
plugins: [vue(), intlayerPlugin(), intlayerMiddlewarePlugin()],
|
|
681
|
+
});
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
### (İsteğe Bağlı) Adım 8: Yerel ayar değiştiğinde URL'yi değiştirin
|
|
685
|
+
|
|
686
|
+
Kullanıcı dili değiştirdiğinde URL'yi otomatik olarak güncellemek için `LocaleSwitcher` bileşenini Vue Router kullanacak şekilde değiştirebilirsiniz:
|
|
687
|
+
|
|
688
|
+
```vue fileName="src/components/LocaleSwitcher.vue"
|
|
689
|
+
<template>
|
|
690
|
+
<div class="locale-switcher">
|
|
691
|
+
<select v-model="selectedLocale" @change="changeLocale">
|
|
692
|
+
<option v-for="loc in availableLocales" :key="loc" :value="loc">
|
|
693
|
+
{{ getLocaleName(loc) }}
|
|
694
|
+
</option>
|
|
695
|
+
</select>
|
|
696
|
+
</div>
|
|
697
|
+
</template>
|
|
698
|
+
|
|
699
|
+
<script setup lang="ts">
|
|
700
|
+
import { ref, watch } from "vue";
|
|
701
|
+
import { useRouter } from "vue-router";
|
|
702
|
+
import { Locales, getLocaleName, getLocalizedUrl } from "intlayer";
|
|
703
|
+
import { useLocale } from "vue-intlayer";
|
|
704
|
+
|
|
705
|
+
// Vue Router'ı alın
|
|
706
|
+
const router = useRouter();
|
|
707
|
+
|
|
708
|
+
// Yerel ayar bilgilerini ve setLocale işlevini alın
|
|
709
|
+
const { locale, availableLocales, setLocale } = useLocale({
|
|
710
|
+
onLocaleChange: (newLocale) => {
|
|
711
|
+
// Geçerli rotayı alın ve yerelleştirilmiş bir URL oluşturun
|
|
712
|
+
const currentPath = router.currentRoute.value.fullPath;
|
|
713
|
+
const localizedPath = getLocalizedUrl(currentPath, newLocale);
|
|
714
|
+
|
|
715
|
+
// Sayfayı yeniden yüklemeden yerelleştirilmiş rotaya gidin
|
|
716
|
+
router.push(localizedPath);
|
|
717
|
+
},
|
|
718
|
+
});
|
|
719
|
+
|
|
720
|
+
// Seçilen yerel ayarı bir ref ile takip edin
|
|
721
|
+
const selectedLocale = ref(locale.value);
|
|
722
|
+
|
|
723
|
+
// Seçim değiştiğinde yerel ayarı güncelleyin
|
|
724
|
+
const changeLocale = () => {
|
|
725
|
+
setLocale(selectedLocale.value);
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
// Seçilen yerel ayarı genel yerel ayar ile senkronize tutun
|
|
729
|
+
watch(
|
|
730
|
+
() => locale.value,
|
|
731
|
+
(newLocale) => {
|
|
732
|
+
selectedLocale.value = newLocale;
|
|
733
|
+
}
|
|
734
|
+
);
|
|
735
|
+
</script>
|
|
736
|
+
```
|
|
737
|
+
|
|
738
|
+
İpucu: Daha iyi SEO ve erişilebilirlik için, dil özel sayfalarına bağlanmak üzere `<a href="/fr/home" hreflang="fr">` gibi etiketleri kullanın. Bu, arama motorlarının dil özel URL'lerini keşfetmesine ve uygun şekilde indekslemesine olanak tanır. SPA davranışını korumak için varsayılan navigasyonu @click.prevent ile önleyin, useLocale ile yerel ayarı değiştirin ve Vue Router kullanarak programatik olarak gidin.
|
|
739
|
+
|
|
740
|
+
```html
|
|
741
|
+
<ol class="divide-text/20 divide-y divide-dashed overflow-y-auto p-1">
|
|
742
|
+
<li>
|
|
743
|
+
<a
|
|
744
|
+
hreflang="x-default"
|
|
745
|
+
aria-label="Switch to English"
|
|
746
|
+
target="_self"
|
|
747
|
+
aria-current="page"
|
|
748
|
+
href="/doc/get-started"
|
|
749
|
+
>
|
|
750
|
+
<div>
|
|
751
|
+
<span dir="ltr" lang="en">English</span>
|
|
752
|
+
<span>English</span>
|
|
753
|
+
<span>EN</span>
|
|
754
|
+
</div>
|
|
755
|
+
</a>
|
|
756
|
+
</li>
|
|
757
|
+
<li>
|
|
758
|
+
<a
|
|
759
|
+
hreflang="es"
|
|
760
|
+
aria-label="Switch to Spanish"
|
|
761
|
+
target="_self"
|
|
762
|
+
href="/es/doc/get-started"
|
|
763
|
+
>
|
|
764
|
+
<div>
|
|
765
|
+
<span dir="ltr" lang="es">Español</span>
|
|
766
|
+
<span>Spanish</span>
|
|
767
|
+
<span>ES</span>
|
|
768
|
+
</div>
|
|
769
|
+
</a>
|
|
770
|
+
</li>
|
|
771
|
+
</ol>
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
### (İsteğe Bağlı) Adım 9: HTML Dil ve Yön Niteliklerini Değiştirin
|
|
775
|
+
|
|
776
|
+
Uygulamanız birden fazla dili desteklediğinde, `<html>` etiketinin `lang` ve `dir` niteliklerini geçerli yerel ayar ile eşleşecek şekilde güncellemek önemlidir. Bunu yapmak şunları sağlar:
|
|
777
|
+
|
|
778
|
+
- **Erişilebilirlik**: Ekran okuyucular ve yardımcı teknolojiler, içeriği doğru şekilde telaffuz etmek ve yorumlamak için doğru `lang` niteliğine güvenir.
|
|
779
|
+
- **Metin İşleme**: `dir` (yön) niteliği, metnin doğru sırada işlenmesini sağlar (örneğin, İngilizce için soldan sağa, Arapça veya İbranice için sağdan sola), okunabilirlik için gereklidir.
|
|
780
|
+
- **SEO**: Arama motorları, sayfanızın dilini belirlemek için `lang` niteliğini kullanır, arama sonuçlarında doğru yerelleştirilmiş içeriği sunmaya yardımcı olur.
|
|
781
|
+
|
|
782
|
+
Yerel ayar değiştiğinde bu nitelikleri dinamik olarak güncellemek, tüm desteklenen diller için tutarlı ve erişilebilir bir deneyim sağlar.
|
|
783
|
+
|
|
784
|
+
```js fileName="src/composables/useI18nHTMLAttributes.ts"
|
|
785
|
+
import { watch } from "vue";
|
|
786
|
+
import { useLocale } from "vue-intlayer";
|
|
787
|
+
import { getHTMLTextDir } from "intlayer";
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Geçerli yerel ayara göre HTML <html> etiketinin `lang` ve `dir` niteliklerini günceller.
|
|
791
|
+
*
|
|
792
|
+
* @example
|
|
793
|
+
* // App.vue'nuzda veya genel bir bileşende
|
|
794
|
+
* import { useI18nHTMLAttributes } from './composables/useI18nHTMLAttributes'
|
|
795
|
+
*
|
|
796
|
+
* useI18nHTMLAttributes()
|
|
797
|
+
*/
|
|
798
|
+
export const useI18nHTMLAttributes = () => {
|
|
799
|
+
const { locale } = useLocale();
|
|
800
|
+
|
|
801
|
+
// Yerel ayar değiştiğinde HTML niteliklerini güncelleyin
|
|
802
|
+
watch(
|
|
803
|
+
() => locale.value,
|
|
804
|
+
(newLocale) => {
|
|
805
|
+
if (!newLocale) return;
|
|
806
|
+
|
|
807
|
+
// Dil niteliğini güncelleyin
|
|
808
|
+
document.documentElement.lang = newLocale;
|
|
809
|
+
|
|
810
|
+
// Metin yönünü ayarlayın (çoğu dil için ltr, Arapça, İbranice vb. için rtl)
|
|
811
|
+
document.documentElement.dir = getHTMLTextDir(newLocale);
|
|
812
|
+
},
|
|
813
|
+
{ immediate: true }
|
|
814
|
+
);
|
|
815
|
+
};
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
Bu composable'ı App.vue'nuzda veya genel bir bileşende kullanın:
|
|
819
|
+
|
|
820
|
+
```vue fileName="src/App.vue"
|
|
821
|
+
<script setup lang="ts">
|
|
822
|
+
import { useI18nHTMLAttributes } from "@composables/useI18nHTMLAttributes";
|
|
823
|
+
|
|
824
|
+
// Geçerli yerel ayara göre HTML niteliklerini uygulayın
|
|
825
|
+
useI18nHTMLAttributes();
|
|
826
|
+
</script>
|
|
827
|
+
|
|
828
|
+
<template>
|
|
829
|
+
<!-- Uygulama şablonunuz -->
|
|
830
|
+
</template>
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
### (İsteğe Bağlı) Adım 10: Yerelleştirilmiş Bağlantı Bileşeni Oluşturun
|
|
834
|
+
|
|
835
|
+
Uygulamanızın navigasyonunun geçerli yerel ayarı saygı gösterdiğinden emin olmak için özel bir `Link` bileşeni oluşturabilirsiniz. Bu bileşen, dahili URL'leri otomatik olarak geçerli dille önekler, böylece. Örneğin, bir Fransızca konuşan kullanıcı "Hakkında" sayfasına giden bir bağlantıya tıkladığında, `/about` yerine `/fr/about`'a yönlendirilir.
|
|
836
|
+
|
|
837
|
+
Bu davranış çeşitli nedenlerle kullanışlıdır:
|
|
838
|
+
|
|
839
|
+
- **SEO ve Kullanıcı Deneyimi**: Yerelleştirilmiş URL'ler, arama motorlarının dil özel sayfalarını doğru şekilde indekslemesine yardımcı olur ve kullanıcılara tercih ettikleri dilde içerik sunar.
|
|
840
|
+
- **Tutarlılık**: Uygulamanız boyunca yerelleştirilmiş bir bağlantı kullanarak, navigasyonun aynı yerel ayar bağlamında kalmasını garanti edersiniz, beklenmedik dil anahtarlarını önlersiniz.
|
|
841
|
+
- **Bakım Kolaylığı**: URL mantığını tek bir bileşende merkezileştirmek, yönetimini basitleştirir, uygulamanız büyüdükçe kod tabanınızı daha kolay yönetilebilir hale getirir.
|
|
842
|
+
|
|
843
|
+
```vue fileName="src/components/Link.vue"
|
|
844
|
+
<template>
|
|
845
|
+
<a :href="localizedHref" v-bind="$attrs">
|
|
846
|
+
<slot />
|
|
847
|
+
</a>
|
|
848
|
+
</template>
|
|
849
|
+
|
|
850
|
+
<script setup lang="ts">
|
|
851
|
+
import { computed } from "vue";
|
|
852
|
+
import { getLocalizedUrl } from "intlayer";
|
|
853
|
+
import { useLocale } from "vue-intlayer";
|
|
854
|
+
|
|
855
|
+
const props = defineProps({
|
|
856
|
+
href: {
|
|
857
|
+
type: String,
|
|
858
|
+
required: true,
|
|
859
|
+
},
|
|
860
|
+
});
|
|
861
|
+
|
|
862
|
+
const { locale } = useLocale();
|
|
863
|
+
|
|
864
|
+
// Bağlantının harici olup olmadığını kontrol edin
|
|
865
|
+
const isExternalLink = computed(() => /^https?:\/\//.test(props.href || ""));
|
|
866
|
+
|
|
867
|
+
// Dahili bağlantılar için yerelleştirilmiş bir href oluşturun
|
|
868
|
+
const localizedHref = computed(() =>
|
|
869
|
+
isExternalLink.value ? props.href : getLocalizedUrl(props.href, locale.value)
|
|
870
|
+
);
|
|
871
|
+
</script>
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
Vue Router ile kullanmak için yönlendiriciye özel bir sürüm oluşturun:
|
|
875
|
+
|
|
876
|
+
```vue fileName="src/components/RouterLink.vue"
|
|
877
|
+
<template>
|
|
878
|
+
<router-link :to="localizedTo" v-bind="$attrs">
|
|
879
|
+
<slot />
|
|
880
|
+
</router-link>
|
|
881
|
+
</template>
|
|
882
|
+
|
|
883
|
+
<script setup lang="ts">
|
|
884
|
+
import { computed } from "vue";
|
|
885
|
+
import { getLocalizedUrl } from "intlayer";
|
|
886
|
+
import { useLocale } from "vue-intlayer";
|
|
887
|
+
|
|
888
|
+
const props = defineProps({
|
|
889
|
+
to: {
|
|
890
|
+
type: [String, Object],
|
|
891
|
+
required: true,
|
|
892
|
+
},
|
|
893
|
+
});
|
|
894
|
+
|
|
895
|
+
const { locale } = useLocale();
|
|
896
|
+
|
|
897
|
+
// Router-link için yerelleştirilmiş to-prop oluşturun
|
|
898
|
+
const localizedTo = computed(() => {
|
|
899
|
+
if (typeof props.to === "string") {
|
|
900
|
+
return getLocalizedUrl(props.to, locale.value);
|
|
901
|
+
} else {
|
|
902
|
+
// 'to' bir nesne ise, yol özelliğini yerelleştirin
|
|
903
|
+
return {
|
|
904
|
+
...props.to,
|
|
905
|
+
path: getLocalizedUrl(props.to.path ?? "/", locale.value),
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
</script>
|
|
910
|
+
```
|
|
911
|
+
|
|
912
|
+
Uygulamanızda bu bileşenleri kullanın:
|
|
913
|
+
|
|
914
|
+
```vue fileName="src/App.vue"
|
|
915
|
+
<template>
|
|
916
|
+
<div>
|
|
917
|
+
<!-- Vue router -->
|
|
918
|
+
<RouterLink to="/">Kök</RouterLink>
|
|
919
|
+
<RouterLink to="/home">Ana Sayfa</RouterLink>
|
|
920
|
+
<!-- Diğer -->
|
|
921
|
+
<Link href="/">Kök</Link>
|
|
922
|
+
<Link href="/home">Ana Sayfa</Link>
|
|
923
|
+
</div>
|
|
924
|
+
</template>
|
|
925
|
+
|
|
926
|
+
<script setup lang="ts">
|
|
927
|
+
import Link from "@components/Link.vue";
|
|
928
|
+
import RouterLink from "@components/RouterLink.vue";
|
|
929
|
+
</script>
|
|
930
|
+
```
|
|
931
|
+
|
|
932
|
+
### (İsteğe Bağlı) Adım 11: Markdown İşleyin
|
|
933
|
+
|
|
934
|
+
Intlayer, Vue uygulamanızda Markdown içeriğini doğrudan işleme desteği sağlar. Varsayılan olarak, Markdown düz metin olarak kabul edilir. Markdown'ı zengin HTML'ye dönüştürmek için [markdown-it](https://github.com/markdown-it/markdown-it), bir Markdown ayrıştırıcısı entegre edebilirsiniz.
|
|
935
|
+
|
|
936
|
+
Bu, çevirileriniz listeler, bağlantılar veya vurgu gibi biçimlendirilmiş içerik içerdiğinde özellikle kullanışlıdır.
|
|
937
|
+
|
|
938
|
+
Varsayılan olarak Intlayer markdown'ı dize olarak işler. Ancak Intlayer, markdown'ı HTML'ye dönüştürmek için `installIntlayerMarkdown` işlevini kullanarak markdown'ı işleme konusunda bir yol sağlar.
|
|
939
|
+
|
|
940
|
+
> Markdown içeriğini `intlayer` paketi kullanarak nasıl bildireceğinizi görmek için [markdown dokümantasyonuna](https://github.com/aymericzip/intlayer/tree/main/docs/en/dictionary/markdown.md) bakın.
|
|
941
|
+
|
|
942
|
+
```ts fileName="main.ts"
|
|
943
|
+
import MarkdownIt from "markdown-it";
|
|
944
|
+
import { createApp, h } from "vue";
|
|
945
|
+
import { installIntlayer, installIntlayerMarkdown } from "vue-intlayer";
|
|
946
|
+
|
|
947
|
+
const app = createApp(App);
|
|
948
|
+
|
|
949
|
+
installIntlayer(app);
|
|
950
|
+
|
|
951
|
+
const md = new MarkdownIt({
|
|
952
|
+
html: true, // HTML etiketlerine izin ver
|
|
953
|
+
linkify: true, // URL'leri otomatik olarak bağla
|
|
954
|
+
typographer: true, // Akıllı tırnaklar, tireler vb. etkinleştir
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
// Intlayer'a markdown'ı HTML'ye dönüştürmesi gerektiğinde md.render() kullanmasını söyle
|
|
958
|
+
installIntlayerMarkdown(app, (markdown) => {
|
|
959
|
+
const html = md.render(markdown);
|
|
960
|
+
return h("div", { innerHTML: html });
|
|
961
|
+
});
|
|
962
|
+
```
|
|
963
|
+
|
|
964
|
+
Kaydedildikten sonra, bileşen tabanlı sözdizimini kullanarak Markdown içeriğini doğrudan görüntüleyebilirsiniz:
|
|
965
|
+
|
|
966
|
+
```vue
|
|
967
|
+
<template>
|
|
968
|
+
<div>
|
|
969
|
+
<myMarkdownContent />
|
|
970
|
+
</div>
|
|
971
|
+
</template>
|
|
972
|
+
|
|
973
|
+
<script setup lang="ts">
|
|
974
|
+
import { useIntlayer } from "vue-intlayer";
|
|
975
|
+
|
|
976
|
+
const { myMarkdownContent } = useIntlayer("my-component");
|
|
977
|
+
</script>
|
|
978
|
+
```
|
|
979
|
+
|
|
980
|
+
### TypeScript Yapılandırın
|
|
981
|
+
|
|
982
|
+
Intlayer, modül genişletmesi kullanarak TypeScript avantajlarından yararlanır.
|
|
983
|
+
|
|
984
|
+

|
|
985
|
+
|
|
986
|
+

|
|
987
|
+
|
|
988
|
+
Otomatik oluşturulan türleri TypeScript yapılandırmanıza dahil edin.
|
|
989
|
+
|
|
990
|
+
```json5 fileName="tsconfig.json"
|
|
991
|
+
{
|
|
992
|
+
// ... Mevcut TypeScript yapılandırmalarınız
|
|
993
|
+
"include": [
|
|
994
|
+
// ... Mevcut TypeScript yapılandırmalarınız
|
|
995
|
+
".intlayer/**/*.ts", // Otomatik oluşturulan türleri dahil et
|
|
996
|
+
],
|
|
997
|
+
}
|
|
998
|
+
```
|
|
999
|
+
|
|
1000
|
+
### Git Yapılandırması
|
|
1001
|
+
|
|
1002
|
+
Intlayer tarafından oluşturulan dosyaları Git deponuza kaydetmekten kaçınmak için bunları yok saymanız önerilir. Bu, bunları Git deponuza kaydetmekten kaçınmanıza olanak tanır.
|
|
1003
|
+
|
|
1004
|
+
Bunu yapmak için `.gitignore` dosyanıza aşağıdaki talimatları ekleyin:
|
|
1005
|
+
|
|
1006
|
+
```plaintext
|
|
1007
|
+
# Intlayer tarafından oluşturulan dosyaları yok say
|
|
1008
|
+
.intlayer
|
|
1009
|
+
```
|
|
1010
|
+
|
|
1011
|
+
### VS Code Uzantısı
|
|
1012
|
+
|
|
1013
|
+
Intlayer ile geliştirme deneyiminizi iyileştirmek için resmi **Intlayer VS Code Uzantısı**'nı kurun.
|
|
1014
|
+
|
|
1015
|
+
[VS Code Marketplace'ten yükleyin](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
1016
|
+
|
|
1017
|
+
Bu uzantı şunları sağlar:
|
|
1018
|
+
|
|
1019
|
+
- **Çeviri anahtarları için otomatik tamamlama**.
|
|
1020
|
+
- **Eksik çeviriler için gerçek zamanlı hata algılama**.
|
|
1021
|
+
- **Çevrilmiş içeriğin satır içi önizlemeleri**.
|
|
1022
|
+
- **Çevirileri kolayca oluşturmak ve güncellemek için hızlı eylemler**.
|
|
1023
|
+
|
|
1024
|
+
Uzantıyı kullanma hakkında daha fazla ayrıntı için [Intlayer VS Code Uzantısı dokümantasyonuna](https://intlayer.org/doc/vs-code-extension) bakın.
|
|
1025
|
+
|
|
1026
|
+
---
|
|
1027
|
+
|
|
1028
|
+
### Daha Fazla İlerle
|
|
1029
|
+
|
|
1030
|
+
Daha fazla ilerlemek için [görsel düzenleyici](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md) veya içeriğinizi [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md) kullanarak dışa aktarmayı uygulayabilirsiniz.
|
|
1031
|
+
|
|
1032
|
+
---
|
|
1033
|
+
|
|
1034
|
+
## Dokümantasyon Geçmişi
|
|
1035
|
+
|
|
1036
|
+
| Sürüm | Tarih | Değişiklikler |
|
|
1037
|
+
| ------ | ---------- | ----------------- |
|
|
1038
|
+
| 5.5.10 | 2025-06-29 | Geçmiş başlatıldı |
|
|
1039
|
+
|
|
1040
|
+
```
|
|
1041
|
+
|
|
1042
|
+
```
|