@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.
Files changed (378) hide show
  1. package/blog/ar/rag_powered_documentation_assistant.md +282 -0
  2. package/blog/de/rag_powered_documentation_assistant.md +282 -0
  3. package/blog/en/rag_powered_documentation_assistant.md +289 -0
  4. package/blog/en-GB/rag_powered_documentation_assistant.md +284 -0
  5. package/blog/es/rag_powered_documentation_assistant.md +308 -0
  6. package/blog/fr/rag_powered_documentation_assistant.md +308 -0
  7. package/blog/hi/rag_powered_documentation_assistant.md +284 -0
  8. package/blog/it/rag_powered_documentation_assistant.md +284 -0
  9. package/blog/ja/rag_powered_documentation_assistant.md +284 -0
  10. package/blog/ko/rag_powered_documentation_assistant.md +283 -0
  11. package/blog/pt/rag_powered_documentation_assistant.md +284 -0
  12. package/blog/ru/rag_powered_documentation_assistant.md +284 -0
  13. package/blog/tr/index.md +69 -0
  14. package/blog/tr/internationalization_and_SEO.md +273 -0
  15. package/blog/tr/intlayer_with_i18next.md +162 -0
  16. package/blog/tr/intlayer_with_next-i18next.md +367 -0
  17. package/blog/tr/intlayer_with_next-intl.md +392 -0
  18. package/blog/tr/intlayer_with_react-i18next.md +346 -0
  19. package/blog/tr/intlayer_with_react-intl.md +345 -0
  20. package/blog/tr/list_i18n_technologies/CMS/drupal.md +143 -0
  21. package/blog/tr/list_i18n_technologies/CMS/wix.md +167 -0
  22. package/blog/tr/list_i18n_technologies/CMS/wordpress.md +188 -0
  23. package/blog/tr/list_i18n_technologies/frameworks/angular.md +125 -0
  24. package/blog/tr/list_i18n_technologies/frameworks/flutter.md +150 -0
  25. package/blog/tr/list_i18n_technologies/frameworks/react-native.md +217 -0
  26. package/blog/tr/list_i18n_technologies/frameworks/react.md +155 -0
  27. package/blog/tr/list_i18n_technologies/frameworks/svelte.md +129 -0
  28. package/blog/tr/list_i18n_technologies/frameworks/vue.md +130 -0
  29. package/blog/tr/next-i18next_vs_next-intl_vs_intlayer.md +170 -0
  30. package/blog/tr/rag_powered_documentation_assistant.md +284 -0
  31. package/blog/tr/react-i18next_vs_react-intl_vs_intlayer.md +162 -0
  32. package/blog/tr/vue-i18n_vs_intlayer.md +276 -0
  33. package/blog/tr/what_is_internationalization.md +166 -0
  34. package/blog/zh/rag_powered_documentation_assistant.md +284 -0
  35. package/dist/cjs/generated/blog.entry.cjs +212 -0
  36. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  37. package/dist/cjs/generated/docs.entry.cjs +660 -132
  38. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  39. package/dist/cjs/generated/frequentQuestions.entry.cjs +84 -0
  40. package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
  41. package/dist/cjs/generated/legal.entry.cjs +6 -0
  42. package/dist/cjs/generated/legal.entry.cjs.map +1 -1
  43. package/dist/esm/generated/blog.entry.mjs +212 -0
  44. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  45. package/dist/esm/generated/docs.entry.mjs +660 -132
  46. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  47. package/dist/esm/generated/frequentQuestions.entry.mjs +84 -0
  48. package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
  49. package/dist/esm/generated/legal.entry.mjs +6 -0
  50. package/dist/esm/generated/legal.entry.mjs.map +1 -1
  51. package/dist/types/generated/blog.entry.d.ts +1 -0
  52. package/dist/types/generated/blog.entry.d.ts.map +1 -1
  53. package/dist/types/generated/docs.entry.d.ts +5 -2
  54. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  55. package/dist/types/generated/frequentQuestions.entry.d.ts.map +1 -1
  56. package/dist/types/generated/legal.entry.d.ts.map +1 -1
  57. package/docs/ar/autoFill.md +41 -40
  58. package/docs/ar/configuration.md +202 -199
  59. package/docs/ar/dictionary/content_file.md +1059 -0
  60. package/docs/ar/intlayer_CMS.md +4 -4
  61. package/docs/ar/intlayer_with_nestjs.md +271 -0
  62. package/docs/ar/intlayer_with_nextjs_page_router.md +1 -1
  63. package/docs/ar/intlayer_with_react_router_v7.md +533 -0
  64. package/docs/ar/intlayer_with_tanstack.md +465 -299
  65. package/docs/ar/intlayer_with_vite+preact.md +7 -7
  66. package/docs/ar/intlayer_with_vite+react.md +7 -7
  67. package/docs/ar/intlayer_with_vite+vue.md +9 -9
  68. package/docs/ar/packages/vite-intlayer/index.md +3 -3
  69. package/docs/ar/readme.md +261 -0
  70. package/docs/ar/testing.md +199 -0
  71. package/docs/de/autoFill.md +42 -19
  72. package/docs/de/configuration.md +155 -147
  73. package/docs/de/dictionary/content_file.md +1059 -0
  74. package/docs/de/intlayer_CMS.md +4 -5
  75. package/docs/de/intlayer_with_nestjs.md +270 -0
  76. package/docs/de/intlayer_with_nextjs_page_router.md +1 -1
  77. package/docs/de/intlayer_with_react_router_v7.md +537 -0
  78. package/docs/de/intlayer_with_tanstack.md +469 -302
  79. package/docs/de/intlayer_with_vite+preact.md +7 -7
  80. package/docs/de/intlayer_with_vite+react.md +7 -7
  81. package/docs/de/intlayer_with_vite+vue.md +9 -9
  82. package/docs/de/packages/vite-intlayer/index.md +3 -3
  83. package/docs/de/readme.md +261 -0
  84. package/docs/de/testing.md +200 -0
  85. package/docs/en/CI_CD.md +4 -6
  86. package/docs/en/autoFill.md +25 -5
  87. package/docs/en/configuration.md +45 -54
  88. package/docs/en/dictionary/content_file.md +1054 -0
  89. package/docs/en/intlayer_CMS.md +8 -7
  90. package/docs/en/intlayer_cli.md +112 -5
  91. package/docs/en/intlayer_with_nestjs.md +268 -0
  92. package/docs/en/intlayer_with_nextjs_page_router.md +1 -1
  93. package/docs/en/intlayer_with_react_router_v7.md +531 -0
  94. package/docs/en/intlayer_with_tanstack.md +463 -294
  95. package/docs/en/intlayer_with_vite+preact.md +8 -8
  96. package/docs/en/intlayer_with_vite+react.md +8 -8
  97. package/docs/en/intlayer_with_vite+vue.md +8 -8
  98. package/docs/en/packages/intlayer/getLocalizedUrl.md +102 -25
  99. package/docs/en/packages/vite-intlayer/index.md +3 -3
  100. package/docs/en/readme.md +261 -0
  101. package/docs/en/testing.md +200 -0
  102. package/docs/en-GB/autoFill.md +29 -6
  103. package/docs/en-GB/configuration.md +79 -71
  104. package/docs/en-GB/dictionary/content_file.md +1084 -0
  105. package/docs/en-GB/intlayer_CMS.md +4 -5
  106. package/docs/en-GB/intlayer_with_nestjs.md +268 -0
  107. package/docs/en-GB/intlayer_with_nextjs_page_router.md +1 -1
  108. package/docs/en-GB/intlayer_with_react_router_v7.md +533 -0
  109. package/docs/en-GB/intlayer_with_tanstack.md +466 -299
  110. package/docs/en-GB/intlayer_with_vite+preact.md +7 -7
  111. package/docs/en-GB/intlayer_with_vite+react.md +7 -7
  112. package/docs/en-GB/intlayer_with_vite+vue.md +9 -9
  113. package/docs/en-GB/packages/vite-intlayer/index.md +3 -3
  114. package/docs/en-GB/readme.md +261 -0
  115. package/docs/en-GB/testing.md +200 -0
  116. package/docs/es/autoFill.md +45 -23
  117. package/docs/es/configuration.md +171 -167
  118. package/docs/es/dictionary/content_file.md +1088 -0
  119. package/docs/es/intlayer_CMS.md +4 -5
  120. package/docs/es/intlayer_with_nestjs.md +268 -0
  121. package/docs/es/intlayer_with_nextjs_page_router.md +1 -1
  122. package/docs/es/intlayer_with_react_router_v7.md +533 -0
  123. package/docs/es/intlayer_with_tanstack.md +469 -280
  124. package/docs/es/intlayer_with_vite+preact.md +7 -7
  125. package/docs/es/intlayer_with_vite+react.md +7 -7
  126. package/docs/es/intlayer_with_vite+vue.md +9 -9
  127. package/docs/es/packages/vite-intlayer/index.md +3 -3
  128. package/docs/es/readme.md +261 -0
  129. package/docs/es/testing.md +200 -0
  130. package/docs/fr/autoFill.md +47 -24
  131. package/docs/fr/configuration.md +213 -198
  132. package/docs/fr/dictionary/content_file.md +1054 -0
  133. package/docs/fr/intlayer_CMS.md +4 -5
  134. package/docs/fr/intlayer_with_nestjs.md +268 -0
  135. package/docs/fr/intlayer_with_nextjs_page_router.md +1 -1
  136. package/docs/fr/intlayer_with_react_router_v7.md +549 -0
  137. package/docs/fr/intlayer_with_tanstack.md +465 -279
  138. package/docs/fr/intlayer_with_vite+preact.md +7 -7
  139. package/docs/fr/intlayer_with_vite+react.md +7 -7
  140. package/docs/fr/intlayer_with_vite+vue.md +9 -9
  141. package/docs/fr/packages/vite-intlayer/index.md +3 -3
  142. package/docs/fr/readme.md +261 -0
  143. package/docs/fr/testing.md +200 -0
  144. package/docs/hi/autoFill.md +47 -25
  145. package/docs/hi/configuration.md +194 -189
  146. package/docs/hi/dictionary/content_file.md +1056 -0
  147. package/docs/hi/intlayer_CMS.md +4 -5
  148. package/docs/hi/intlayer_with_nestjs.md +269 -0
  149. package/docs/hi/intlayer_with_nextjs_page_router.md +1 -1
  150. package/docs/hi/intlayer_with_react_router_v7.md +533 -0
  151. package/docs/hi/intlayer_with_tanstack.md +467 -282
  152. package/docs/hi/intlayer_with_vite+preact.md +7 -7
  153. package/docs/hi/intlayer_with_vite+react.md +7 -7
  154. package/docs/hi/intlayer_with_vite+vue.md +9 -9
  155. package/docs/hi/packages/vite-intlayer/index.md +3 -3
  156. package/docs/hi/readme.md +261 -0
  157. package/docs/hi/testing.md +200 -0
  158. package/docs/it/autoFill.md +46 -24
  159. package/docs/it/configuration.md +169 -161
  160. package/docs/it/dictionary/content_file.md +1061 -0
  161. package/docs/it/intlayer_CMS.md +4 -5
  162. package/docs/it/intlayer_with_nestjs.md +268 -0
  163. package/docs/it/intlayer_with_nextjs_page_router.md +1 -1
  164. package/docs/it/intlayer_with_react_router_v7.md +535 -0
  165. package/docs/it/intlayer_with_tanstack.md +467 -301
  166. package/docs/it/intlayer_with_vite+preact.md +7 -7
  167. package/docs/it/intlayer_with_vite+react.md +7 -7
  168. package/docs/it/intlayer_with_vite+vue.md +9 -9
  169. package/docs/it/packages/vite-intlayer/index.md +3 -3
  170. package/docs/it/readme.md +261 -0
  171. package/docs/it/testing.md +200 -0
  172. package/docs/ja/autoFill.md +45 -23
  173. package/docs/ja/configuration.md +243 -204
  174. package/docs/ja/dictionary/content_file.md +1064 -0
  175. package/docs/ja/intlayer_CMS.md +4 -5
  176. package/docs/ja/intlayer_with_nestjs.md +268 -0
  177. package/docs/ja/intlayer_with_nextjs_page_router.md +1 -1
  178. package/docs/ja/intlayer_with_react_router_v7.md +534 -0
  179. package/docs/ja/intlayer_with_tanstack.md +467 -303
  180. package/docs/ja/intlayer_with_vite+preact.md +7 -7
  181. package/docs/ja/intlayer_with_vite+react.md +7 -7
  182. package/docs/ja/intlayer_with_vite+vue.md +9 -9
  183. package/docs/ja/packages/vite-intlayer/index.md +3 -3
  184. package/docs/ja/readme.md +263 -0
  185. package/docs/ja/testing.md +200 -0
  186. package/docs/ko/autoFill.md +39 -16
  187. package/docs/ko/configuration.md +217 -197
  188. package/docs/ko/dictionary/content_file.md +1060 -0
  189. package/docs/ko/intlayer_CMS.md +4 -5
  190. package/docs/ko/intlayer_with_nestjs.md +268 -0
  191. package/docs/ko/intlayer_with_nextjs_page_router.md +1 -1
  192. package/docs/ko/intlayer_with_react_router_v7.md +540 -0
  193. package/docs/ko/intlayer_with_tanstack.md +466 -302
  194. package/docs/ko/intlayer_with_vite+preact.md +7 -7
  195. package/docs/ko/intlayer_with_vite+react.md +7 -7
  196. package/docs/ko/intlayer_with_vite+vue.md +9 -9
  197. package/docs/ko/packages/vite-intlayer/index.md +3 -3
  198. package/docs/ko/readme.md +261 -0
  199. package/docs/ko/testing.md +200 -0
  200. package/docs/pt/autoFill.md +39 -15
  201. package/docs/pt/configuration.md +165 -147
  202. package/docs/pt/dictionary/content_file.md +1062 -0
  203. package/docs/pt/intlayer_CMS.md +4 -5
  204. package/docs/pt/intlayer_with_nestjs.md +271 -0
  205. package/docs/pt/intlayer_with_nextjs_page_router.md +1 -1
  206. package/docs/pt/intlayer_with_react_router_v7.md +535 -0
  207. package/docs/pt/intlayer_with_tanstack.md +469 -300
  208. package/docs/pt/intlayer_with_vite+preact.md +7 -7
  209. package/docs/pt/intlayer_with_vite+react.md +7 -7
  210. package/docs/pt/intlayer_with_vite+vue.md +9 -9
  211. package/docs/pt/packages/vite-intlayer/index.md +3 -3
  212. package/docs/pt/readme.md +261 -0
  213. package/docs/pt/testing.md +200 -0
  214. package/docs/ru/autoFill.md +52 -30
  215. package/docs/ru/configuration.md +164 -117
  216. package/docs/ru/dictionary/content_file.md +1064 -0
  217. package/docs/ru/intlayer_CMS.md +4 -4
  218. package/docs/ru/intlayer_with_nestjs.md +270 -0
  219. package/docs/ru/intlayer_with_nextjs_page_router.md +1 -1
  220. package/docs/ru/intlayer_with_react_router_v7.md +534 -0
  221. package/docs/ru/intlayer_with_tanstack.md +470 -305
  222. package/docs/ru/intlayer_with_vite+preact.md +7 -7
  223. package/docs/ru/intlayer_with_vite+react.md +7 -7
  224. package/docs/ru/intlayer_with_vite+vue.md +9 -9
  225. package/docs/ru/packages/vite-intlayer/index.md +3 -3
  226. package/docs/ru/readme.md +261 -0
  227. package/docs/ru/testing.md +202 -0
  228. package/docs/tr/CI_CD.md +198 -0
  229. package/docs/tr/autoFill.md +201 -0
  230. package/docs/tr/configuration.md +585 -0
  231. package/docs/tr/dictionary/condition.md +243 -0
  232. package/docs/tr/dictionary/content_file.md +1055 -0
  233. package/docs/tr/dictionary/enumeration.md +251 -0
  234. package/docs/tr/dictionary/file.md +228 -0
  235. package/docs/tr/dictionary/function_fetching.md +218 -0
  236. package/docs/tr/dictionary/gender.md +279 -0
  237. package/docs/tr/dictionary/insertion.md +191 -0
  238. package/docs/tr/dictionary/markdown.md +385 -0
  239. package/docs/tr/dictionary/nesting.md +279 -0
  240. package/docs/tr/dictionary/translation.md +315 -0
  241. package/docs/tr/formatters.md +618 -0
  242. package/docs/tr/how_works_intlayer.md +254 -0
  243. package/docs/tr/index.md +168 -0
  244. package/docs/tr/interest_of_intlayer.md +288 -0
  245. package/docs/tr/intlayer_CMS.md +347 -0
  246. package/docs/tr/intlayer_cli.md +570 -0
  247. package/docs/tr/intlayer_visual_editor.md +269 -0
  248. package/docs/tr/intlayer_with_angular.md +694 -0
  249. package/docs/tr/intlayer_with_create_react_app.md +1218 -0
  250. package/docs/tr/intlayer_with_express.md +415 -0
  251. package/docs/tr/intlayer_with_lynx+react.md +511 -0
  252. package/docs/tr/intlayer_with_nestjs.md +268 -0
  253. package/docs/tr/intlayer_with_nextjs_14.md +1029 -0
  254. package/docs/tr/intlayer_with_nextjs_15.md +1506 -0
  255. package/docs/tr/intlayer_with_nextjs_page_router.md +1484 -0
  256. package/docs/tr/intlayer_with_nuxt.md +773 -0
  257. package/docs/tr/intlayer_with_react_native+expo.md +660 -0
  258. package/docs/tr/intlayer_with_react_router_v7.md +531 -0
  259. package/docs/tr/intlayer_with_tanstack.md +452 -0
  260. package/docs/tr/intlayer_with_vite+preact.md +1673 -0
  261. package/docs/tr/intlayer_with_vite+react.md +1632 -0
  262. package/docs/tr/intlayer_with_vite+solid.md +288 -0
  263. package/docs/tr/intlayer_with_vite+svelte.md +288 -0
  264. package/docs/tr/intlayer_with_vite+vue.md +1042 -0
  265. package/docs/tr/introduction.md +209 -0
  266. package/docs/tr/locale_mapper.md +244 -0
  267. package/docs/tr/mcp_server.md +207 -0
  268. package/docs/tr/packages/@intlayer/api/index.md +58 -0
  269. package/docs/tr/packages/@intlayer/chokidar/index.md +57 -0
  270. package/docs/tr/packages/@intlayer/cli/index.md +47 -0
  271. package/docs/tr/packages/@intlayer/config/index.md +142 -0
  272. package/docs/tr/packages/@intlayer/core/index.md +51 -0
  273. package/docs/tr/packages/@intlayer/design-system/index.md +47 -0
  274. package/docs/tr/packages/@intlayer/dictionary-entry/index.md +53 -0
  275. package/docs/tr/packages/@intlayer/editor/index.md +47 -0
  276. package/docs/tr/packages/@intlayer/editor-react/index.md +47 -0
  277. package/docs/tr/packages/@intlayer/webpack/index.md +61 -0
  278. package/docs/tr/packages/angular-intlayer/index.md +59 -0
  279. package/docs/tr/packages/express-intlayer/index.md +258 -0
  280. package/docs/tr/packages/express-intlayer/t.md +459 -0
  281. package/docs/tr/packages/intlayer/getConfiguration.md +151 -0
  282. package/docs/tr/packages/intlayer/getEnumeration.md +165 -0
  283. package/docs/tr/packages/intlayer/getHTMLTextDir.md +127 -0
  284. package/docs/tr/packages/intlayer/getLocaleLang.md +87 -0
  285. package/docs/tr/packages/intlayer/getLocaleName.md +124 -0
  286. package/docs/tr/packages/intlayer/getLocalizedUrl.md +324 -0
  287. package/docs/tr/packages/intlayer/getMultilingualUrls.md +225 -0
  288. package/docs/tr/packages/intlayer/getPathWithoutLocale.md +81 -0
  289. package/docs/tr/packages/intlayer/getTranslation.md +196 -0
  290. package/docs/tr/packages/intlayer/getTranslationContent.md +195 -0
  291. package/docs/tr/packages/intlayer/index.md +505 -0
  292. package/docs/tr/packages/intlayer-cli/index.md +71 -0
  293. package/docs/tr/packages/intlayer-editor/index.md +139 -0
  294. package/docs/tr/packages/lynx-intlayer/index.md +85 -0
  295. package/docs/tr/packages/next-intlayer/index.md +154 -0
  296. package/docs/tr/packages/next-intlayer/t.md +354 -0
  297. package/docs/tr/packages/next-intlayer/useDictionary.md +270 -0
  298. package/docs/tr/packages/next-intlayer/useIntlayer.md +265 -0
  299. package/docs/tr/packages/next-intlayer/useLocale.md +133 -0
  300. package/docs/tr/packages/nuxt-intlayer/index.md +59 -0
  301. package/docs/tr/packages/preact-intlayer/index.md +55 -0
  302. package/docs/tr/packages/react-intlayer/index.md +148 -0
  303. package/docs/tr/packages/react-intlayer/t.md +304 -0
  304. package/docs/tr/packages/react-intlayer/useDictionary.md +554 -0
  305. package/docs/tr/packages/react-intlayer/useI18n.md +478 -0
  306. package/docs/tr/packages/react-intlayer/useIntlayer.md +253 -0
  307. package/docs/tr/packages/react-intlayer/useLocale.md +212 -0
  308. package/docs/tr/packages/react-native-intlayer/index.md +85 -0
  309. package/docs/tr/packages/react-scripts-intlayer/index.md +82 -0
  310. package/docs/tr/packages/solid-intlayer/index.md +56 -0
  311. package/docs/tr/packages/svelte-intlayer/index.md +55 -0
  312. package/docs/tr/packages/vite-intlayer/index.md +82 -0
  313. package/docs/tr/packages/vue-intlayer/index.md +59 -0
  314. package/docs/tr/per_locale_file.md +321 -0
  315. package/docs/tr/readme.md +261 -0
  316. package/docs/tr/roadmap.md +338 -0
  317. package/docs/tr/testing.md +200 -0
  318. package/docs/tr/vs_code_extension.md +154 -0
  319. package/docs/zh/autoFill.md +40 -18
  320. package/docs/zh/configuration.md +245 -226
  321. package/docs/zh/dictionary/content_file.md +1064 -0
  322. package/docs/zh/intlayer_CMS.md +4 -5
  323. package/docs/zh/intlayer_with_nestjs.md +268 -0
  324. package/docs/zh/intlayer_with_nextjs_page_router.md +1 -1
  325. package/docs/zh/intlayer_with_react_router_v7.md +535 -0
  326. package/docs/zh/intlayer_with_tanstack.md +468 -278
  327. package/docs/zh/intlayer_with_vite+preact.md +7 -7
  328. package/docs/zh/intlayer_with_vite+react.md +7 -7
  329. package/docs/zh/intlayer_with_vite+vue.md +7 -7
  330. package/docs/zh/packages/vite-intlayer/index.md +3 -3
  331. package/docs/zh/readme.md +261 -0
  332. package/docs/zh/testing.md +198 -0
  333. package/frequent_questions/tr/SSR_Next_no_[locale].md +105 -0
  334. package/frequent_questions/tr/array_as_content_declaration.md +72 -0
  335. package/frequent_questions/tr/build_dictionaries.md +59 -0
  336. package/frequent_questions/tr/build_error_CI_CD.md +75 -0
  337. package/frequent_questions/tr/customized_locale_list.md +65 -0
  338. package/frequent_questions/tr/domain_routing.md +114 -0
  339. package/frequent_questions/tr/esbuild_error.md +30 -0
  340. package/frequent_questions/tr/get_locale_cookie.md +142 -0
  341. package/frequent_questions/tr/intlayer_command_undefined.md +156 -0
  342. package/frequent_questions/tr/locale_incorect_in_url.md +74 -0
  343. package/frequent_questions/tr/static_rendering.md +45 -0
  344. package/frequent_questions/tr/translated_path_url.md +56 -0
  345. package/frequent_questions/tr/unknown_command.md +98 -0
  346. package/legal/tr/privacy_notice.md +83 -0
  347. package/legal/tr/terms_of_service.md +55 -0
  348. package/package.json +13 -13
  349. package/src/generated/blog.entry.ts +212 -0
  350. package/src/generated/docs.entry.ts +663 -135
  351. package/src/generated/frequentQuestions.entry.ts +85 -1
  352. package/src/generated/legal.entry.ts +7 -1
  353. package/docs/ar/dictionary/content_extention_customization.md +0 -100
  354. package/docs/ar/dictionary/get_started.md +0 -527
  355. package/docs/de/dictionary/content_extention_customization.md +0 -100
  356. package/docs/de/dictionary/get_started.md +0 -531
  357. package/docs/en/dictionary/content_extention_customization.md +0 -102
  358. package/docs/en/dictionary/get_started.md +0 -529
  359. package/docs/en-GB/dictionary/content_extention_customization.md +0 -100
  360. package/docs/en-GB/dictionary/get_started.md +0 -591
  361. package/docs/es/dictionary/content_extention_customization.md +0 -100
  362. package/docs/es/dictionary/get_started.md +0 -527
  363. package/docs/fr/dictionary/content_extention_customization.md +0 -100
  364. package/docs/fr/dictionary/get_started.md +0 -527
  365. package/docs/hi/dictionary/content_extention_customization.md +0 -100
  366. package/docs/hi/dictionary/get_started.md +0 -527
  367. package/docs/it/dictionary/content_extention_customization.md +0 -113
  368. package/docs/it/dictionary/get_started.md +0 -573
  369. package/docs/ja/dictionary/content_extention_customization.md +0 -113
  370. package/docs/ja/dictionary/get_started.md +0 -576
  371. package/docs/ko/dictionary/content_extention_customization.md +0 -100
  372. package/docs/ko/dictionary/get_started.md +0 -530
  373. package/docs/pt/dictionary/content_extention_customization.md +0 -100
  374. package/docs/pt/dictionary/get_started.md +0 -532
  375. package/docs/ru/dictionary/content_extention_customization.md +0 -100
  376. package/docs/ru/dictionary/get_started.md +0 -575
  377. package/docs/zh/dictionary/content_extention_customization.md +0 -117
  378. package/docs/zh/dictionary/get_started.md +0 -533
@@ -0,0 +1,1218 @@
1
+ ---
2
+ createdAt: 2025-09-07
3
+ updatedAt: 2025-09-07
4
+ title: Create React App (CRA) web sitenizi çevirin (i18n)
5
+ description: Create React App (CRA) web sitenizi çok dilli hale getirmeyi keşfedin. Dokümantasyonu takip ederek uluslararasılaştırma (i18n) yapın ve çevirin.
6
+ keywords:
7
+ - Uluslararasılaştırma
8
+ - Dokümantasyon
9
+ - Intlayer
10
+ - Create React App
11
+ - CRA
12
+ - JavaScript
13
+ - React
14
+ slugs:
15
+ - doc
16
+ - environment
17
+ - create-react-app
18
+ applicationTemplate: https://github.com/aymericzip/intlayer-react-cra-template
19
+ ---
20
+
21
+ # Intlayer ile React Create App'ta Uluslararasılaştırma (i18n) Başlarken
22
+
23
+ GitHub'da [Uygulama Şablonu](https://github.com/aymericzip/intlayer-react-cra-template)'na bakın.
24
+
25
+ ## Intlayer Nedir?
26
+
27
+ **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.
28
+
29
+ Intlayer ile şunları yapabilirsiniz:
30
+
31
+ - **Bileşen düzeyinde bildirimsel sözlükler kullanarak çevirileri kolayca yönetin**.
32
+ - **Meta verileri, rotaları ve içeriği dinamik olarak yerelleştirin**.
33
+ - **Otomatik oluşturulan türlerle TypeScript desteği sağlayın**, otomatik tamamlama ve hata algılamayı iyileştirin.
34
+ - **Dinamik yerel algılama ve değiştirme gibi gelişmiş özelliklerden yararlanın**.
35
+
36
+ ## React Uygulamasında Intlayer'ı Kurmak İçin Adım Adım Kılavuz
37
+
38
+ ### Adım 1: Bağımlılıkları Yükleyin
39
+
40
+ Gerekli paketleri npm kullanarak yükleyin:
41
+
42
+ ```bash packageManager="npm"
43
+ npm install intlayer react-intlayer react-scripts-intlayer
44
+ ```
45
+
46
+ ```bash packageManager="pnpm"
47
+ pnpm add intlayer react-intlayer react-scripts-intlayer
48
+ ```
49
+
50
+ ```bash packageManager="yarn"
51
+ yarn add intlayer react-intlayer react-scripts-intlayer
52
+ ```
53
+
54
+ - **intlayer**
55
+
56
+ Yapılandırma yönetimi, çeviri, [içerik bildirimi](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md), transpilasyon 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 temel paket.
57
+
58
+ - **react-intlayer**
59
+
60
+ Intlayer'ı React uygulamasıyla entegre eden paket. React uluslararasılaştırması için bağlam sağlayıcıları ve hook'lar sağlar.
61
+
62
+ - **react-scripts-intlayer**
63
+
64
+ Create React App tabanlı uygulama ile Intlayer'ı entegre etmek için `react-scripts-intlayer` komutlarını ve eklentileri içerir. Bu eklentiler [craco](https://craco.js.org/) tabanlıdır ve [Webpack](https://webpack.js.org/) paketleyici için ek yapılandırma içerir.
65
+
66
+ ### Adım 2: Projenizi Yapılandırın
67
+
68
+ Uygulamanızın dillerini yapılandırmak için bir yapılandırma dosyası oluşturun:
69
+
70
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
71
+ import { Locales, type IntlayerConfig } from "intlayer";
72
+
73
+ const config: IntlayerConfig = {
74
+ internationalization: {
75
+ locales: [
76
+ Locales.ENGLISH,
77
+ Locales.FRENCH,
78
+ Locales.SPANISH,
79
+ // Diğer yerel ayarlarınız
80
+ ],
81
+ defaultLocale: Locales.ENGLISH,
82
+ },
83
+ };
84
+
85
+ export default config;
86
+ ```
87
+
88
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
89
+ import { Locales } from "intlayer";
90
+
91
+ /** @type {import('intlayer').IntlayerConfig} */
92
+ const config = {
93
+ internationalization: {
94
+ locales: [
95
+ Locales.ENGLISH,
96
+ Locales.FRENCH,
97
+ Locales.SPANISH,
98
+ // Diğer yerel ayarlarınız
99
+ ],
100
+ defaultLocale: Locales.ENGLISH,
101
+ },
102
+ };
103
+
104
+ export default config;
105
+ ```
106
+
107
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
108
+ const { Locales } = require("intlayer");
109
+
110
+ /** @type {import('intlayer').IntlayerConfig} */
111
+ const config = {
112
+ internationalization: {
113
+ locales: [
114
+ Locales.ENGLISH,
115
+ Locales.FRENCH,
116
+ Locales.SPANISH,
117
+ // Diğer yerel ayarlarınız
118
+ ],
119
+ defaultLocale: Locales.ENGLISH,
120
+ },
121
+ };
122
+
123
+ module.exports = config;
124
+ ```
125
+
126
+ > Bu yapılandırma dosyası aracılığıyla, yerelleştirilmiş URL'ler, ara yazılım yönlendirmesi, çerez adları, içerik bildirimlerinizin konumu ve uzantısı ayarlayabilir, Intlayer günlüklerini konsolda devre dışı bırakabilir ve daha fazlasını yapabilirsiniz. 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.
127
+
128
+ ### Adım 3: Intlayer'ı CRA Yapılandırmanızda Entegre Edin
129
+
130
+ Betiklerinizi Intlayer kullanacak şekilde değiştirin
131
+
132
+ ```json fileName="package.json"
133
+ "scripts": {
134
+ "build": "react-scripts-intlayer build",
135
+ "start": "react-scripts-intlayer start",
136
+ "transpile": "intlayer build"
137
+ },
138
+ ```
139
+
140
+ > `react-scripts-intlayer` betikleri [CRACO](https://craco.js.org/) tabanlıdır. Kendi kurulumunuzu CRACO'nun intlayer eklentisi temel alarak da uygulayabilirsiniz. [Örneğe buradan bakın](https://github.com/aymericzip/intlayer/blob/main/examples/react-app/craco.config.js).
141
+
142
+ ### Adım 4: İçeriğinizi Bildirin
143
+
144
+ Çevirileri depolamak için içerik bildirimlerinizi oluşturun ve yönetin:
145
+
146
+ ```tsx fileName="src/app.content.tsx" codeFormat="typescript"
147
+ import { t, type Dictionary } from "intlayer";
148
+ import React, { type ReactNode } from "react";
149
+
150
+ const appContent = {
151
+ key: "app",
152
+ content: {
153
+ getStarted: t<ReactNode>({
154
+ en: (
155
+ <>
156
+ <code>src/App.tsx</code>'i düzenleyin ve kaydedin
157
+ </>
158
+ ),
159
+ fr: (
160
+ <>
161
+ Éditez <code>src/App.tsx</code> et enregistrez pour recharger
162
+ </>
163
+ ),
164
+ es: (
165
+ <>
166
+ Edita <code>src/App.tsx</code> y guarda para recargar
167
+ </>
168
+ ),
169
+ }),
170
+ reactLink: {
171
+ href: "https://reactjs.org",
172
+ content: t({
173
+ en: "Learn React",
174
+ fr: "Apprendre React",
175
+ es: "Aprender React",
176
+ }),
177
+ },
178
+ },
179
+ } satisfies Dictionary;
180
+
181
+ export default appContent;
182
+ ```
183
+
184
+ ```jsx fileName="src/app.content.mjx" codeFormat="esm"
185
+ import { t } from "intlayer";
186
+
187
+ /** @type {import('intlayer').Dictionary} */
188
+ const appContent = {
189
+ key: "app",
190
+ content: {
191
+ getStarted: t({
192
+ en: "Get started by editing",
193
+ fr: "Commencez par éditer",
194
+ es: "Comience por editar",
195
+ }),
196
+ reactLink: {
197
+ href: "https://reactjs.org",
198
+ content: t({
199
+ en: "Learn React",
200
+ fr: "Apprendre React",
201
+ es: "Aprender React",
202
+ }),
203
+ },
204
+ },
205
+ };
206
+
207
+ export default appContent;
208
+ ```
209
+
210
+ ```jsx fileName="src/app.content.csx" codeFormat="commonjs"
211
+ const { t } = require("intlayer");
212
+
213
+ /** @type {import('intlayer').Dictionary} */
214
+ const appContent = {
215
+ key: "app",
216
+ content: {
217
+ getStarted: t({
218
+ en: "Get started by editing",
219
+ fr: "Commencez par éditer",
220
+ es: "Comience por editar",
221
+ }),
222
+ reactLink: {
223
+ href: "https://reactjs.org",
224
+ content: t({
225
+ en: "Learn React",
226
+ fr: "Apprendre React",
227
+ es: "Aprender React",
228
+ }),
229
+ },
230
+ },
231
+ };
232
+
233
+ module.exports = appContent;
234
+ ```
235
+
236
+ > İçerik bildirimleriniz uygulamanızda herhangi bir yerde tanımlanabilir, yeter ki `contentDir` dizinine dahil edilsinler (varsayılan olarak `./src`). Ve içerik bildirim dosyası uzantısıyla eşleşsinler (varsayılan olarak `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
237
+
238
+ > Daha fazla detay için [içerik bildirimi dokümantasyonuna](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md) bakın.
239
+
240
+ > Eğer içerik dosyanız TSX kodu içeriyorsa, içerik dosyanıza `import React from "react";` içe aktarmayı düşünün.
241
+
242
+ ### Adım 5: Kodunuzda Intlayer'ı Kullanın
243
+
244
+ İçerik sözlüklerinize uygulamanız genelinde erişin:
245
+
246
+ ```tsx {4,7} fileName="src/App.tsx" codeFormat="typescript"
247
+ import logo from "./logo.svg";
248
+ import "./App.css";
249
+ import type { FC } from "react";
250
+ import { IntlayerProvider, useIntlayer } from "react-intlayer";
251
+
252
+ const AppContent: FC = () => {
253
+ const content = useIntlayer("app");
254
+
255
+ return (
256
+ <div className="App">
257
+ <img src={logo} className="App-logo" alt="logo" />
258
+
259
+ {content.getStarted}
260
+ <a
261
+ className="App-link"
262
+ href={content.reactLink.href.value}
263
+ target="_blank"
264
+ rel="noopener noreferrer"
265
+ >
266
+ {content.reactLink.content}
267
+ </a>
268
+ </div>
269
+ );
270
+ };
271
+
272
+ const App: FC = () => (
273
+ <IntlayerProvider>
274
+ <AppContent />
275
+ </IntlayerProvider>
276
+ );
277
+
278
+ export default App;
279
+ ```
280
+
281
+ ```jsx {3,6} fileName="src/App.mjx" codeFormat="esm"
282
+ import "./App.css";
283
+ import logo from "./logo.svg";
284
+ import { IntlayerProvider, useIntlayer } from "react-intlayer";
285
+
286
+ const AppContent = () => {
287
+ const content = useIntlayer("app");
288
+
289
+ return (
290
+ <div className="App">
291
+ <img src={logo} className="App-logo" alt="logo" />
292
+
293
+ {content.getStarted}
294
+ <a
295
+ className="App-link"
296
+ href={content.reactLink.href.value}
297
+ target="_blank"
298
+ rel="noopener noreferrer"
299
+ >
300
+ {content.reactLink.content}
301
+ </a>
302
+ </div>
303
+ );
304
+ };
305
+
306
+ const App = () => (
307
+ <IntlayerProvider>
308
+ <AppContent />
309
+ </IntlayerProvider>
310
+ );
311
+ ```
312
+
313
+ ```jsx {3,6} fileName="src/App.csx" codeFormat="commonjs"
314
+ require("./App.css");
315
+ const logo = require("./logo.svg");
316
+ const { IntlayerProvider, useIntlayer } = require("react-intlayer");
317
+
318
+ const AppContent = () => {
319
+ const content = useIntlayer("app");
320
+
321
+ return (
322
+ <div className="App">
323
+ <img src={logo} className="App-logo" alt="logo" />
324
+
325
+ {content.getStarted}
326
+ <a
327
+ className="App-link"
328
+ href={content.reactLink.href.value}
329
+ target="_blank"
330
+ rel="noopener noreferrer"
331
+ >
332
+ {content.reactLink.content}
333
+ </a>
334
+ </div>
335
+ );
336
+ };
337
+
338
+ const App = () => (
339
+ <IntlayerProvider>
340
+ <AppContent />
341
+ </IntlayerProvider>
342
+ );
343
+ ```
344
+
345
+ > Not: Eğer içeriğinizi bir `string` özniteliğinde kullanmak istiyorsanız, `alt`, `title`, `href`, `aria-label` vb. gibi, fonksiyonun değerini çağırmanız gerekir:
346
+
347
+ > ```jsx
348
+ > <img src={content.image.src.value} alt={content.image.value} />
349
+ > ```
350
+
351
+ > `useIntlayer` hook'u hakkında daha fazla bilgi için [dokümantasyona](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useIntlayer.md) bakın.
352
+
353
+ ### (İsteğe Bağlı) Adım 6: İçeriğinizin Dilini Değiştirin
354
+
355
+ İçeriğinizin dilini değiştirmek için, `useLocale` hook'u tarafından sağlanan `setLocale` fonksiyonunu kullanabilirsiniz. Bu fonksiyon, uygulamanın yerel ayarını ayarlamanıza ve içeriği buna göre güncellemenize izin verir.
356
+
357
+ ```tsx fileName="src/components/LocaleSwitcher.tsx" codeFormat="typescript"
358
+ import { Locales } from "intlayer";
359
+ import { useLocale } from "react-intlayer";
360
+
361
+ const LocaleSwitcher = () => {
362
+ const { setLocale } = useLocale();
363
+
364
+ return (
365
+ <button onClick={() => setLocale(Locales.English)}>
366
+ Dili İngilizce'ye değiştir
367
+ </button>
368
+ );
369
+ };
370
+ ```
371
+
372
+ ```jsx fileName="src/components/LocaleSwitcher.mjx" codeFormat="esm"
373
+ import { Locales } from "intlayer";
374
+ import { useLocale } from "react-intlayer";
375
+
376
+ const LocaleSwitcher = () => {
377
+ const { setLocale } = useLocale();
378
+
379
+ return (
380
+ <button onClick={() => setLocale(Locales.English)}>
381
+ Dili İngilizce'ye değiştir
382
+ </button>
383
+ );
384
+ };
385
+ ```
386
+
387
+ ```jsx fileName="src/components/LocaleSwitcher.csx" codeFormat="commonjs"
388
+ const { Locales } = require("intlayer");
389
+ const { useLocale } = require("react-intlayer");
390
+
391
+ const LocaleSwitcher = () => {
392
+ const { setLocale } = useLocale();
393
+
394
+ return (
395
+ <button onClick={() => setLocale(Locales.English)}>
396
+ Dili İngilizce'ye değiştir
397
+ </button>
398
+ );
399
+ };
400
+ ```
401
+
402
+ > `useLocale` hook'u hakkında daha fazla bilgi için [dokümantasyona](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useLocale.md) bakın.
403
+
404
+ ### (İsteğe Bağlı) Adım 7: Uygulamanıza Yerelleştirilmiş Yönlendirme Ekleyin
405
+
406
+ Bu adımın amacı, her dil için benzersiz rotalar oluşturmaktır. Bu, SEO ve SEO dostu URL'ler için yararlıdır.
407
+ Örnek:
408
+
409
+ ```plaintext
410
+ - https://example.com/about
411
+ - https://example.com/es/about
412
+ - https://example.com/fr/about
413
+ ```
414
+
415
+ > Varsayılan olarak, rotalar varsayılan yerel ayar için öneklenmez. Varsayılan yerel ayarı öneklemek istiyorsanız, yapılandırmanızda `middleware.prefixDefault` seçeneğini `true` olarak ayarlayabilirsiniz. Daha fazla bilgi için [yapılandırma dokümantasyonuna](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md) bakın.
416
+
417
+ Uygulamanıza yerelleştirilmiş yönlendirme eklemek için, uygulamanızın rotalarını saran ve yerel tabanlı yönlendirmeyi işleyen bir `LocaleRouter` bileşeni oluşturabilirsiniz. [React Router](https://reactrouter.com/home) kullanarak bir örnek aşağıda verilmiştir:
418
+
419
+ ```tsx fileName="src/components/LocaleRouter.tsx" codeFormat="typescript"
420
+ // Gerekli bağımlılıkları ve fonksiyonları içe aktar
421
+ import { type Locales, configuration, getPathWithoutLocale } from "intlayer"; // Intlayer'dan yardımcı fonksiyonlar ve türler
422
+ // Intlayer'dan yardımcı fonksiyonlar ve türler
423
+ import type { FC, PropsWithChildren } from "react"; // React fonksiyonel bileşenler ve prop türleri
424
+ import { IntlayerProvider } from "react-intlayer"; // Uluslararasılaştırma bağlam sağlayıcısı
425
+ import {
426
+ BrowserRouter,
427
+ Routes,
428
+ Route,
429
+ Navigate,
430
+ useLocation,
431
+ } from "react-router-dom"; // Navigasyon yönetimi için yönlendirici bileşenleri
432
+
433
+ // Yapılandırmayı Intlayer'dan çıkar
434
+ const { internationalization, middleware } = configuration;
435
+ const { locales, defaultLocale } = internationalization;
436
+
437
+ /**
438
+ * Yerelleştirmeyi işleyen ve çocukları uygun yerel bağlamla saran bir bileşen.
439
+ * URL tabanlı yerel algılama ve doğrulama yönetir.
440
+ */
441
+ const AppLocalized: FC<PropsWithChildren<{ locale: Locales }>> = ({
442
+ children,
443
+ locale,
444
+ }) => {
445
+ const { pathname, search } = useLocation(); // Geçerli URL yolunu al
446
+
447
+ // Sağlanmadıysa varsayılan yerel ayara geri dön
448
+ const currentLocale = locale ?? defaultLocale;
449
+
450
+ // Temel bir yol oluşturmak için yoldan yerel öneki kaldır
451
+ const pathWithoutLocale = getPathWithoutLocale(
452
+ pathname // Geçerli URL yolu
453
+ );
454
+
455
+ /**
456
+ * middleware.prefixDefault true ise, varsayılan yerel ayar her zaman öneklenmelidir.
457
+ */
458
+ if (middleware.prefixDefault) {
459
+ // Yerel ayarı doğrula
460
+ if (!locale || !locales.includes(locale)) {
461
+ // Güncellenmiş yol ile varsayılan yerel ayara yönlendir
462
+ return (
463
+ <Navigate
464
+ to={`/${defaultLocale}/${pathWithoutLocale}${search}`}
465
+ replace // Geçerli geçmişi yeni olanla değiştir
466
+ />
467
+ );
468
+ }
469
+
470
+ // Çocukları IntlayerProvider ile sar ve geçerli yerel ayarı ayarla
471
+ return (
472
+ <IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
473
+ );
474
+ } else {
475
+ /**
476
+ * middleware.prefixDefault false olduğunda, varsayılan yerel ayar öneklenmez.
477
+ * Geçerli yerel ayar geçerli olduğundan ve varsayılan yerel ayar olmadığından emin ol.
478
+ */
479
+ if (
480
+ currentLocale.toString() !== defaultLocale.toString() &&
481
+ !locales
482
+ .filter(
483
+ (locale) => locale.toString() !== defaultLocale.toString() // Varsayılan yerel ayarı hariç tut
484
+ )
485
+ .includes(currentLocale) // Geçerli yerel ayar geçerli yerel ayarlar listesinde mi kontrol et
486
+ ) {
487
+ // Yerel önek olmadan yola yönlendir
488
+ return <Navigate to={`${pathWithoutLocale}${search}`} replace />;
489
+ }
490
+
491
+ // Çocukları IntlayerProvider ile sar ve geçerli yerel ayarı ayarla
492
+ return (
493
+ <IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
494
+ );
495
+ }
496
+ };
497
+
498
+ /**
499
+ * Yerel ayarlara özel rotalar ayarlayan bir yönlendirici bileşen.
500
+ * React Router kullanarak navigasyonu yönetir ve yerelleştirilmiş bileşenleri işler.
501
+ */
502
+ export const LocaleRouter: FC<PropsWithChildren> = ({ children }) => (
503
+ <BrowserRouter>
504
+ <Routes>
505
+ {locales
506
+ .filter(
507
+ (locale) => middleware.prefixDefault || locale !== defaultLocale
508
+ )
509
+ .map((locale) => (
510
+ <Route
511
+ // Yerel ayarı yakalayan rota deseni (ör. /en/, /fr/) ve sonraki tüm yolları eşleştir
512
+ path={`/${locale}/*`}
513
+ key={locale}
514
+ element={<AppLocalized locale={locale}>{children}</AppLocalized>} // Çocukları yerel yönetimle sar
515
+ />
516
+ ))}
517
+
518
+ {
519
+ // Varsayılan yerel ayar önekleme devre dışıysa, çocukları doğrudan kök yolda işle
520
+ !middleware.prefixDefault && (
521
+ <Route
522
+ path="*"
523
+ element={
524
+ <AppLocalized locale={defaultLocale}>{children}</AppLocalized>
525
+ } // Çocukları yerel yönetimle sar
526
+ />
527
+ )
528
+ }
529
+ </Routes>
530
+ </BrowserRouter>
531
+ );
532
+ ```
533
+
534
+ ```jsx fileName="src/components/LocaleRouter.mjx" codeFormat="esm"
535
+ // Gerekli bağımlılıkları ve fonksiyonları içe aktar
536
+ import { configuration, getPathWithoutLocale } from "intlayer"; // Intlayer'dan yardımcı fonksiyonlar ve türler
537
+ // Intlayer'dan yardımcı fonksiyonlar ve türler
538
+ import { IntlayerProvider } from "react-intlayer"; // Uluslararasılaştırma bağlam sağlayıcısı
539
+ import {
540
+ BrowserRouter,
541
+ Routes,
542
+ Route,
543
+ Navigate,
544
+ useLocation,
545
+ } from "react-router-dom"; // Navigasyon yönetimi için yönlendirici bileşenleri
546
+
547
+ // Yapılandırmayı Intlayer'dan çıkar
548
+ const { internationalization, middleware } = configuration;
549
+ const { locales, defaultLocale } = internationalization;
550
+
551
+ /**
552
+ * Yerelleştirmeyi işleyen ve çocukları uygun yerel bağlamla saran bir bileşen.
553
+ * URL tabanlı yerel algılama ve doğrulama yönetir.
554
+ */
555
+ const AppLocalized = ({ children, locale }) => {
556
+ const { pathname, search } = useLocation(); // Geçerli URL yolunu al
557
+
558
+ // Sağlanmadıysa varsayılan yerel ayara geri dön
559
+ const currentLocale = locale ?? defaultLocale;
560
+
561
+ // Temel bir yol oluşturmak için yoldan yerel öneki kaldır
562
+ const pathWithoutLocale = getPathWithoutLocale(
563
+ pathname // Geçerli URL yolu
564
+ );
565
+
566
+ /**
567
+ * middleware.prefixDefault true ise, varsayılan yerel ayar her zaman öneklenmelidir.
568
+ */
569
+ if (middleware.prefixDefault) {
570
+ // Yerel ayarı doğrula
571
+ if (!locale || !locales.includes(locale)) {
572
+ // Güncellenmiş yol ile varsayılan yerel ayara yönlendir
573
+ return (
574
+ <Navigate
575
+ to={`/${defaultLocale}/${pathWithoutLocale}${search}`}
576
+ replace // Geçerli geçmişi yeni olanla değiştir
577
+ />
578
+ );
579
+ }
580
+
581
+ // Çocukları IntlayerProvider ile sar ve geçerli yerel ayarı ayarla
582
+ return (
583
+ <IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
584
+ );
585
+ } else {
586
+ /**
587
+ * middleware.prefixDefault false olduğunda, varsayılan yerel ayar öneklenmez.
588
+ * Geçerli yerel ayar geçerli olduğundan ve varsayılan yerel ayar olmadığından emin ol.
589
+ */
590
+ if (
591
+ currentLocale.toString() !== defaultLocale.toString() &&
592
+ !locales
593
+ .filter(
594
+ (locale) => locale.toString() !== defaultLocale.toString() // Varsayılan yerel ayarı hariç tut
595
+ )
596
+ .includes(currentLocale) // Geçerli yerel ayar geçerli yerel ayarlar listesinde mi kontrol et
597
+ ) {
598
+ // Yerel önek olmadan yola yönlendir
599
+ return <Navigate to={`${pathWithoutLocale}${search}`} replace />;
600
+ }
601
+
602
+ // Çocukları IntlayerProvider ile sar ve geçerli yerel ayarı ayarla
603
+ return (
604
+ <IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
605
+ );
606
+ }
607
+ };
608
+
609
+ /**
610
+ * Yerel ayarlara özel rotalar ayarlayan bir yönlendirici bileşen.
611
+ * React Router kullanarak navigasyonu yönetir ve yerelleştirilmiş bileşenleri işler.
612
+ */
613
+ const LocaleRouter = ({ children }) => (
614
+ <BrowserRouter>
615
+ <Routes>
616
+ {locales
617
+ .filter(
618
+ (locale) => middleware.prefixDefault || locale !== defaultLocale
619
+ )
620
+ .map((locale) => (
621
+ <Route
622
+ // Yerel ayarı yakalayan rota deseni (ör. /en/, /fr/) ve sonraki tüm yolları eşleştir
623
+ path={`/${locale}/*`}
624
+ key={locale}
625
+ element={<AppLocalized locale={locale}>{children}</AppLocalized>} // Çocukları yerel yönetimle sar
626
+ />
627
+ ))}
628
+
629
+ {
630
+ // Varsayılan yerel ayar önekleme devre dışıysa, çocukları doğrudan kök yolda işle
631
+ !middleware.prefixDefault && (
632
+ <Route
633
+ path="*"
634
+ element={
635
+ <AppLocalized locale={defaultLocale}>{children}</AppLocalized>
636
+ } // Çocukları yerel yönetimle sar
637
+ />
638
+ )
639
+ }
640
+ </Routes>
641
+ </BrowserRouter>
642
+ );
643
+ ```
644
+
645
+ ```jsx fileName="src/components/LocaleRouter.cjx" codeFormat="commonjs"
646
+ // Gerekli bağımlılıkları ve fonksiyonları içe aktar
647
+ const { configuration, getPathWithoutLocale } = require("intlayer"); // Intlayer'dan yardımcı fonksiyonlar ve türler
648
+ const { IntlayerProvider, useLocale } = require("react-intlayer"); // Uluslararasılaştırma bağlam sağlayıcısı
649
+ const {
650
+ BrowserRouter,
651
+ Routes,
652
+ Route,
653
+ Navigate,
654
+ useLocation,
655
+ } = require("react-router-dom"); // Navigasyon yönetimi için yönlendirici bileşenleri
656
+
657
+ // Yapılandırmayı Intlayer'dan çıkar
658
+ const { internationalization, middleware } = configuration;
659
+ const { locales, defaultLocale } = internationalization;
660
+
661
+ /**
662
+ * Yerelleştirmeyi işleyen ve çocukları uygun yerel bağlamla saran bir bileşen.
663
+ * URL tabanlı yerel algılama ve doğrulama yönetir.
664
+ */
665
+ const AppLocalized = ({ children, locale }) => {
666
+ const { pathname, search } = useLocation(); // Geçerli URL yolunu al
667
+
668
+ // Sağlanmadıysa varsayılan yerel ayara geri dön
669
+ const currentLocale = locale ?? defaultLocale;
670
+
671
+ // Temel bir yol oluşturmak için yoldan yerel öneki kaldır
672
+ const pathWithoutLocale = getPathWithoutLocale(
673
+ pathname // Geçerli URL yolu
674
+ );
675
+
676
+ /**
677
+ * middleware.prefixDefault true ise, varsayılan yerel ayar her zaman öneklenmelidir.
678
+ */
679
+ if (middleware.prefixDefault) {
680
+ // Yerel ayarı doğrula
681
+ if (!locale || !locales.includes(locale)) {
682
+ // Güncellenmiş yol ile varsayılan yerel ayara yönlendir
683
+ return (
684
+ <Navigate
685
+ to={`/${defaultLocale}/${pathWithoutLocale}${search}`}
686
+ replace // Geçerli geçmişi yeni olanla değiştir
687
+ />
688
+ );
689
+ }
690
+
691
+ // Çocukları IntlayerProvider ile sar ve geçerli yerel ayarı ayarla
692
+ return (
693
+ <IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
694
+ );
695
+ } else {
696
+ /**
697
+ * middleware.prefixDefault false olduğunda, varsayılan yerel ayar öneklenmez.
698
+ * Geçerli yerel ayar geçerli olduğundan ve varsayılan yerel ayar olmadığından emin ol.
699
+ */
700
+ if (
701
+ currentLocale.toString() !== defaultLocale.toString() &&
702
+ !locales
703
+ .filter(
704
+ (locale) => locale.toString() !== defaultLocale.toString() // Varsayılan yerel ayarı hariç tut
705
+ )
706
+ .includes(currentLocale) // Geçerli yerel ayar geçerli yerel ayarlar listesinde mi kontrol et
707
+ ) {
708
+ // Yerel önek olmadan yola yönlendir
709
+ return <Navigate to={`${pathWithoutLocale}${search}`} replace />;
710
+ }
711
+
712
+ // Çocukları IntlayerProvider ile sar ve geçerli yerel ayarı ayarla
713
+ return (
714
+ <IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
715
+ );
716
+ }
717
+ };
718
+
719
+ /**
720
+ * Yerel ayarlara özel rotalar ayarlayan bir yönlendirici bileşen.
721
+ * React Router kullanarak navigasyonu yönetir ve yerelleştirilmiş bileşenleri işler.
722
+ */
723
+ const LocaleRouter = ({ children }) => (
724
+ <BrowserRouter>
725
+ <Routes>
726
+ {locales
727
+ .filter(
728
+ (locale) => middleware.prefixDefault || locale !== defaultLocale
729
+ )
730
+ .map((locale) => (
731
+ <Route
732
+ // Yerel ayarı yakalayan rota deseni (ör. /en/, /fr/) ve sonraki tüm yolları eşleştir
733
+ path={`/${locale}/*`}
734
+ key={locale}
735
+ element={<AppLocalized locale={locale}>{children}</AppLocalized>} // Çocukları yerel yönetimle sar
736
+ />
737
+ ))}
738
+
739
+ {
740
+ // Varsayılan yerel ayar önekleme devre dışıysa, çocukları doğrudan kök yolda işle
741
+ !middleware.prefixDefault && (
742
+ <Route
743
+ path="*"
744
+ element={
745
+ <AppLocalized locale={defaultLocale}>{children}</AppLocalized>
746
+ } // Çocukları yerel yönetimle sar
747
+ />
748
+ )
749
+ }
750
+ </Routes>
751
+ </BrowserRouter>
752
+ );
753
+ ```
754
+
755
+ Ardından, `LocaleRouter` bileşenini uygulamanızda kullanabilirsiniz:
756
+
757
+ ```tsx fileName="src/App.tsx" codeFormat="typescript"
758
+ import { LocaleRouter } from "./components/LocaleRouter";
759
+ import type { FC } from "react";
760
+
761
+ // ... AppContent bileşeniniz
762
+
763
+ const App: FC = () => (
764
+ <LocaleRouter>
765
+ <AppContent />
766
+ </LocaleRouter>
767
+ );
768
+ ```
769
+
770
+ ```jsx fileName="src/App.mjx" codeFormat="esm"
771
+ import { LocaleRouter } from "./components/LocaleRouter";
772
+
773
+ // ... AppContent bileşeniniz
774
+
775
+ const App = () => (
776
+ <LocaleRouter>
777
+ <AppContent />
778
+ </LocaleRouter>
779
+ );
780
+ ```
781
+
782
+ ```jsx fileName="src/App.cjx" codeFormat="commonjs"
783
+ const { LocaleRouter } = require("./components/LocaleRouter");
784
+
785
+ // ... AppContent bileşeniniz
786
+
787
+ const App = () => (
788
+ <LocaleRouter>
789
+ <AppContent />
790
+ </LocaleRouter>
791
+ );
792
+ ```
793
+
794
+ ### (İsteğe Bağlı) Adım 8: Yerel Ayar Değiştiğinde URL'yi Değiştirin
795
+
796
+ Yerel ayar değiştiğinde URL'yi değiştirmek için, `useLocale` hook'u tarafından sağlanan `onLocaleChange` prop'unu kullanabilirsiniz. Paralel olarak, URL yolunu güncellemek için `react-router-dom`'dan `useLocation` ve `useNavigate` hook'larını kullanabilirsiniz.
797
+
798
+ ```tsx fileName="src/components/LocaleSwitcher.tsx" codeFormat="typescript"
799
+ import { useLocation, useNavigate } from "react-router-dom";
800
+ import {
801
+ Locales,
802
+ getHTMLTextDir,
803
+ getLocaleName,
804
+ getLocalizedUrl,
805
+ } from "intlayer";
806
+ import { useLocale } from "react-intlayer";
807
+ import { type FC } from "react";
808
+
809
+ const LocaleSwitcher: FC = () => {
810
+ const { pathname, search } = useLocation(); // Geçerli URL yolunu al. Örnek: /fr/about?foo=bar
811
+ const navigate = useNavigate();
812
+
813
+ const { locale, availableLocales, setLocale } = useLocale({
814
+ onLocaleChange: (locale) => {
815
+ // Güncellenmiş yerel ayar ile URL'yi oluştur
816
+ // Örnek: /es/about?foo=bar
817
+ const pathWithLocale = getLocalizedUrl(`${pathname}${search}`, locale);
818
+
819
+ // URL yolunu güncelle
820
+ navigate(pathWithLocale);
821
+ },
822
+ });
823
+
824
+ return (
825
+ <div>
826
+ <button popoverTarget="localePopover">{getLocaleName(locale)}</button>
827
+ <div id="localePopover" popover="auto">
828
+ {availableLocales.map((localeItem) => (
829
+ <a
830
+ href={getLocalizedUrl(location.pathname, localeItem)}
831
+ hrefLang={localeItem}
832
+ aria-current={locale === localeItem ? "page" : undefined}
833
+ onClick={(e) => {
834
+ e.preventDefault();
835
+ setLocale(localeItem);
836
+ }}
837
+ key={localeItem}
838
+ >
839
+ <span>
840
+ {/* Yerel ayar - örn. FR */}
841
+ {localeItem}
842
+ </span>
843
+ <span>
844
+ {/* Kendi yerel ayarındaki dil - örn. Français */}
845
+ {getLocaleName(localeItem, locale)}
846
+ </span>
847
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
848
+ {/* Geçerli yerel ayar set edildiğinde İspanyolca'da Francés - örn. */}
849
+ {getLocaleName(localeItem)}
850
+ </span>
851
+ <span dir="ltr" lang={Locales.ENGLISH}>
852
+ {/* İngilizce'de dil - örn. French */}
853
+ {getLocaleName(localeItem, Locales.ENGLISH)}
854
+ </span>
855
+ </a>
856
+ ))}
857
+ </div>
858
+ </div>
859
+ );
860
+ };
861
+ ```
862
+
863
+ ```jsx fileName="src/components/LocaleSwitcher.msx" codeFormat="esm"
864
+ import { useLocation, useNavigate } from "react-router-dom";
865
+ import {
866
+ Locales,
867
+ getHTMLTextDir,
868
+ getLocaleName,
869
+ getLocalizedUrl,
870
+ } from "intlayer";
871
+ import { useLocale } from "react-intlayer";
872
+
873
+ const LocaleSwitcher = () => {
874
+ const { pathname, search } = useLocation(); // Geçerli URL yolunu al. Örnek: /fr/about?foo=bar
875
+ const navigate = useNavigate();
876
+
877
+ const { locale, availableLocales, setLocale } = useLocale({
878
+ onLocaleChange: (locale) => {
879
+ // Güncellenmiş yerel ayar ile URL'yi oluştur
880
+ // Örnek: /es/about?foo=bar
881
+ const pathWithLocale = getLocalizedUrl(`${pathname}${search}`, locale);
882
+
883
+ // URL yolunu güncelle
884
+ navigate(pathWithLocale);
885
+ },
886
+ });
887
+
888
+ return (
889
+ <div>
890
+ <button popoverTarget="localePopover">{getLocaleName(locale)}</button>
891
+ <div id="localePopover" popover="auto">
892
+ {availableLocales.map((localeItem) => (
893
+ <a
894
+ href={getLocalizedUrl(location.pathname, localeItem)}
895
+ hrefLang={localeItem}
896
+ aria-current={locale === localeItem ? "page" : undefined}
897
+ onClick={(e) => {
898
+ e.preventDefault();
899
+ setLocale(localeItem);
900
+ }}
901
+ key={localeItem}
902
+ >
903
+ <span>
904
+ {/* Yerel ayar - örn. FR */}
905
+ {localeItem}
906
+ </span>
907
+ <span>
908
+ {/* Kendi yerel ayarındaki dil - örn. Français */}
909
+ {getLocaleName(localeItem, locale)}
910
+ </span>
911
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
912
+ {/* Geçerli yerel ayar set edildiğinde İspanyolca'da Francés - örn. */}
913
+ {getLocaleName(localeItem)}
914
+ </span>
915
+ <span dir="ltr" lang={Locales.ENGLISH}>
916
+ {/* İngilizce'de dil - örn. French */}
917
+ {getLocaleName(localeItem, Locales.ENGLISH)}
918
+ </span>
919
+ </a>
920
+ ))}
921
+ </div>
922
+ </div>
923
+ );
924
+ };
925
+ ```
926
+
927
+ ```jsx fileName="src/components/LocaleSwitcher.csx" codeFormat="commonjs"
928
+ const { useLocation, useNavigate } = require("react-router-dom");
929
+ const {
930
+ Locales,
931
+ getHTMLTextDir,
932
+ getLocaleName,
933
+ getLocalizedUrl,
934
+ } = require("intlayer");
935
+ const { useLocale } = require("react-intlayer");
936
+
937
+ const LocaleSwitcher = () => {
938
+ const { pathname, search } = useLocation(); // Geçerli URL yolunu al. Örnek: /fr/about?foo=bar
939
+ const navigate = useNavigate();
940
+
941
+ const { locale, availableLocales, setLocale } = useLocale({
942
+ onLocaleChange: (locale) => {
943
+ // Güncellenmiş yerel ayar ile URL'yi oluştur
944
+ // Örnek: /es/about?foo=bar
945
+ const pathWithLocale = getLocalizedUrl(`${pathname}${search}`, locale);
946
+
947
+ // URL yolunu güncelle
948
+ navigate(pathWithLocale);
949
+ },
950
+ });
951
+
952
+ return (
953
+ <div>
954
+ <button popoverTarget="localePopover">{getLocaleName(locale)}</button>
955
+ <div id="localePopover" popover="auto">
956
+ {availableLocales.map((localeItem) => (
957
+ <a
958
+ href={getLocalizedUrl(location.pathname, localeItem)}
959
+ hrefLang={localeItem}
960
+ aria-current={locale === localeItem ? "page" : undefined}
961
+ onClick={(e) => {
962
+ e.preventDefault();
963
+ setLocale(localeItem);
964
+ }}
965
+ key={localeItem}
966
+ >
967
+ <span>
968
+ {/* Yerel ayar - örn. FR */}
969
+ {localeItem}
970
+ </span>
971
+ <span>
972
+ {/* Kendi yerel ayarındaki dil - örn. Français */}
973
+ {getLocaleName(localeItem, locale)}
974
+ </span>
975
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
976
+ {/* Geçerli yerel ayar set edildiğinde İspanyolca'da Francés - örn. */}
977
+ {getLocaleName(localeItem)}
978
+ </span>
979
+ <span dir="ltr" lang={Locales.ENGLISH}>
980
+ {/* İngilizce'de dil - örn. French */}
981
+ {getLocaleName(localeItem, Locales.ENGLISH)}
982
+ </span>
983
+ </a>
984
+ ))}
985
+ </div>
986
+ </div>
987
+ );
988
+ };
989
+ ```
990
+
991
+ > Dokümantasyon referansları:
992
+ >
993
+ > - [`useLocale` hook'u](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useLocale.md)
994
+ > - [`getLocaleName` hook'u](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/intlayer/getLocaleName.md)
995
+ > - [`getLocalizedUrl` hook'u](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/intlayer/getLocalizedUrl.md)
996
+ > - [`getHTMLTextDir` hook'u](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/intlayer/getHTMLTextDir.md)
997
+ > - [`hrefLang` özniteliği](https://developers.google.com/search/docs/specialty/international/localized-versions?hl=fr)
998
+ > - [`lang` özniteliği](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)
999
+ > - [`dir` özniteliği](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)
1000
+ > - [`aria-current` özniteliği](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)
1001
+
1002
+ ### (İsteğe Bağlı) Adım 9: HTML Dil ve Yön Özniteliklerini Değiştirin
1003
+
1004
+ Uygulamanız birden fazla dili desteklediğinde, `<html>` etiketinin `lang` ve `dir` özniteliklerini geçerli yerel ayarla eşleşecek şekilde güncellemek çok önemlidir.
1005
+
1006
+ Bunu otomatik olarak işlemek için bir hook oluşturabilirsiniz.
1007
+
1008
+ #### Hook'u Uygulama
1009
+
1010
+ HTML özniteliklerini yönetmek için özel bir hook oluşturun. Hook, yerel ayar değişikliklerini dinler ve öznitelikleri buna göre günceller:
1011
+
1012
+ ```tsx fileName="src/hooks/useI18nHTMLAttributes.tsx" codeFormat="typescript"
1013
+ import { useEffect } from "react";
1014
+ import { useLocale } from "react-intlayer";
1015
+ import { getHTMLTextDir } from "intlayer";
1016
+
1017
+ /**
1018
+ * Geçerli yerel ayara göre HTML <html> etiketinin `lang` ve `dir` özniteliklerini günceller.
1019
+ * - `lang`: Tarayıcılara ve arama motorlarına sayfanın dilini bildirir.
1020
+ * - `dir`: Arapça veya İbranice gibi diller için 'rtl' gibi doğru okuma sırasını sağlar.
1021
+ *
1022
+ * Bu dinamik güncelleme, uygun metin işleme, erişilebilirlik ve SEO için gereklidir.
1023
+ */
1024
+ export const useI18nHTMLAttributes = () => {
1025
+ const { locale } = useLocale();
1026
+
1027
+ useEffect(() => {
1028
+ // Dil özniteliğini geçerli yerel ayara güncelle
1029
+ document.documentElement.lang = locale;
1030
+
1031
+ // Geçerli yerel ayara göre metin yönünü ayarla
1032
+ document.documentElement.dir = getHTMLTextDir(locale);
1033
+ }, [locale]);
1034
+ };
1035
+ ```
1036
+
1037
+ ```jsx fileName="src/hooks/useI18nHTMLAttributes.msx" codeFormat="esm"
1038
+ import { useEffect } from "react";
1039
+ import { useLocale } from "react-intlayer";
1040
+ import { getHTMLTextDir } from "intlayer";
1041
+
1042
+ /**
1043
+ * Geçerli yerel ayara göre HTML <html> etiketinin `lang` ve `dir` özniteliklerini günceller.
1044
+ * - `lang`: Tarayıcılara ve arama motorlarına sayfanın dilini bildirir.
1045
+ * - `dir`: Arapça veya İbranice gibi diller için 'rtl' gibi doğru okuma sırasını sağlar.
1046
+ *
1047
+ * Bu dinamik güncelleme, uygun metin işleme, erişilebilirlik ve SEO için gereklidir.
1048
+ */
1049
+ export const useI18nHTMLAttributes = () => {
1050
+ const { locale } = useLocale();
1051
+
1052
+ useEffect(() => {
1053
+ // Dil özniteliğini geçerli yerel ayara güncelle
1054
+ document.documentElement.lang = locale;
1055
+
1056
+ // Geçerli yerel ayara göre metin yönünü ayarla
1057
+ document.documentElement.dir = getHTMLTextDir(locale);
1058
+ }, [locale]);
1059
+ };
1060
+ ```
1061
+
1062
+ ```jsx fileName="src/hooks/useI18nHTMLAttributes.csx" codeFormat="commonjs"
1063
+ const { useEffect } = require("react");
1064
+ const { useLocale } = require("react-intlayer");
1065
+ const { getHTMLTextDir } = require("intlayer");
1066
+
1067
+ /**
1068
+ * Geçerli yerel ayara göre HTML <html> etiketinin `lang` ve `dir` özniteliklerini günceller.
1069
+ * - `lang`: Tarayıcılara ve arama motorlarına sayfanın dilini bildirir.
1070
+ * - `dir`: Arapça veya İbranice gibi diller için 'rtl' gibi doğru okuma sırasını sağlar.
1071
+ *
1072
+ * Bu dinamik güncelleme, uygun metin işleme, erişilebilirlik ve SEO için gereklidir.
1073
+ */
1074
+ const useI18nHTMLAttributes = () => {
1075
+ const { locale } = useLocale();
1076
+
1077
+ useEffect(() => {
1078
+ // Dil özniteliğini geçerli yerel ayara güncelle
1079
+ document.documentElement.lang = locale;
1080
+
1081
+ // Geçerli yerel ayara göre metin yönünü ayarla
1082
+ document.documentElement.dir = getHTMLTextDir(locale);
1083
+ }, [locale]);
1084
+ };
1085
+
1086
+ module.exports = { useI18nHTMLAttributes };
1087
+ ```
1088
+
1089
+ #### Hook'u Uygulamanızda Kullanma
1090
+
1091
+ HTML özniteliklerinin yerel ayar her değiştiğinde güncellenmesi için hook'u ana bileşeninizde entegre edin:
1092
+
1093
+ ```tsx fileName="src/App.tsx" codeFormat="typescript"
1094
+ import type { FC } from "react";
1095
+ import { IntlayerProvider, useIntlayer } from "react-intlayer";
1096
+ import { useI18nHTMLAttributes } from "./hooks/useI18nHTMLAttributes";
1097
+ import "./App.css";
1098
+
1099
+ const AppContent: FC = () => {
1100
+ // Hook'u kullanarak yerel ayara göre <html> etiketinin lang ve dir özniteliklerini güncelleyin.
1101
+ useI18nHTMLAttributes();
1102
+
1103
+ // ... Bileşeninizin geri kalanı
1104
+ };
1105
+
1106
+ const App: FC = () => (
1107
+ <IntlayerProvider>
1108
+ <AppContent />
1109
+ </IntlayerProvider>
1110
+ );
1111
+
1112
+ export default App;
1113
+ ```
1114
+
1115
+ ```jsx fileName="src/App.msx" codeFormat="esm"
1116
+ import { IntlayerProvider, useIntlayer } from "react-intlayer";
1117
+ import { useI18nHTMLAttributes } from "./hooks/useI18nHTMLAttributes";
1118
+ import "./App.css";
1119
+
1120
+ const AppContent = () => {
1121
+ // Hook'u kullanarak yerel ayara göre <html> etiketinin lang ve dir özniteliklerini güncelleyin.
1122
+ useI18nHTMLAttributes();
1123
+
1124
+ // ... Bileşeninizin geri kalanı
1125
+ };
1126
+
1127
+ const App = () => (
1128
+ <IntlayerProvider>
1129
+ <AppContent />
1130
+ </IntlayerProvider>
1131
+ );
1132
+
1133
+ export default App;
1134
+ ```
1135
+
1136
+ ```jsx fileName="src/App.csx" codeFormat="commonjs"
1137
+ const { FC } = require("react");
1138
+ const { IntlayerProvider, useIntlayer } = require("react-intlayer");
1139
+ const { useI18nHTMLAttributes } = require("./hooks/useI18nHTMLAttributes");
1140
+ require("./App.css");
1141
+
1142
+ const AppContent = () => {
1143
+ // Hook'u kullanarak yerel ayara göre <html> etiketinin lang ve dir özniteliklerini güncelleyin.
1144
+ useI18nHTMLAttributes();
1145
+
1146
+ // ... Bileşeninizin geri kalanı
1147
+ };
1148
+
1149
+ const App = () => (
1150
+ <IntlayerProvider>
1151
+ <AppContent />
1152
+ </IntlayerProvider>
1153
+ );
1154
+
1155
+ module.exports = App;
1156
+ ```
1157
+
1158
+ Bu değişiklikleri uygulayarak, uygulamanız:
1159
+
1160
+ - **Dil** (`lang`) özniteliğinin SEO ve tarayıcı davranışı için doğru geçerli yerel ayarı yansıtmasını sağlar.
1161
+ - **Metin yönü** (`dir`) özniteliğini yerel ayara göre ayarlar, Arapça veya İbranice gibi farklı okuma sırasına sahip diller için okunabilirliği geliştirir.
1162
+ - Daha **erişilebilir** bir deneyim sağlar, çünkü yardımcı teknolojiler bu özniteliklere optimum şekilde çalışmak için güvenir.
1163
+
1164
+ ### TypeScript'i Yapılandırın
1165
+
1166
+ Intlayer, kod tabanınızı daha güçlü hale getirmek için modül genişletmesi kullanır ve TypeScript avantajlarından yararlanır.
1167
+
1168
+ ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1169
+
1170
+ ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1171
+
1172
+ TypeScript yapılandırmanızın otomatik oluşturulan türleri içerdiğinden emin olun.
1173
+
1174
+ ```json5 fileName="tsconfig.json"
1175
+ {
1176
+ // ... Mevcut TypeScript yapılandırmalarınız
1177
+ "include": [
1178
+ // ... Mevcut TypeScript yapılandırmalarınız
1179
+ ".intlayer/**/*.ts", // Otomatik oluşturulan türleri dahil edin
1180
+ ],
1181
+ }
1182
+ ```
1183
+
1184
+ ### Git Yapılandırması
1185
+
1186
+ Intlayer tarafından oluşturulan dosyaları yok saymanız önerilir. Bu, onları Git deponuza commit etmenizi önler.
1187
+
1188
+ Bunu yapmak için `.gitignore` dosyanıza aşağıdaki talimatları ekleyebilirsiniz:
1189
+
1190
+ ```plaintext fileName=".gitignore"
1191
+ # Intlayer tarafından oluşturulan dosyaları yok say
1192
+ .intlayer
1193
+ ```
1194
+
1195
+ ### VS Code Uzantısı
1196
+
1197
+ Intlayer ile geliştirme deneyiminizi iyileştirmek için resmi **Intlayer VS Code Uzantısı**'nı yükleyebilirsiniz.
1198
+
1199
+ [VS Code Marketplace'ten Yükleyin](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
1200
+
1201
+ Bu uzantı şunları sağlar:
1202
+
1203
+ - **Çeviri anahtarları için otomatik tamamlama**.
1204
+ - **Eksik çeviriler için gerçek zamanlı hata algılama**.
1205
+ - **Çevrilmiş içeriğin satır içi önizlemeleri**.
1206
+ - **Çevirileri kolayca oluşturmak ve güncellemek için hızlı eylemler**.
1207
+
1208
+ Uzantının nasıl kullanılacağı hakkında daha fazla detay için [Intlayer VS Code Uzantısı dokümantasyonuna](https://intlayer.org/doc/vs-code-extension) bakın.
1209
+
1210
+ ### Daha Fazla Gidin
1211
+
1212
+ Daha fazla gitmek için [görsel düzenleyiciyi](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md) uygulayabilir veya içeriğinizi [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md) kullanarak harici hale getirebilirsiniz.
1213
+
1214
+ ## Doküman Geçmişi
1215
+
1216
+ | Sürüm | Tarih | Değişiklikler |
1217
+ | ------ | ---------- | ----------------- |
1218
+ | 5.5.10 | 2025-06-29 | Geçmiş başlatıldı |