@intlayer/docs 5.8.1 → 6.0.0-canary.1

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 +12 -12
  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,1673 @@
1
+ ---
2
+ createdAt: 2025-09-07
3
+ updatedAt: 2025-09-07
4
+ title: Vite ve Preact web sitenizi çevirin (i18n)
5
+ description: Vite ve Preact web sitenizi çok dilli hale getirmeyi öğrenin. 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
+ - Vite
11
+ - Preact
12
+ - JavaScript
13
+ slugs:
14
+ - doc
15
+ - environment
16
+ - vite-and-preact
17
+ applicationTemplate: https://github.com/aymericzip/intlayer-vite-preact-template
18
+ ---
19
+
20
+ # Intlayer ve Vite ve Preact ile uluslararasılaştırma (i18n) başlangıç kılavuzu
21
+
22
+ > Bu paket geliştirme aşamasındadır. Daha fazla bilgi için [sorunu](https://github.com/aymericzip/intlayer/issues/118) inceleyin. Preact için Intlayer'a ilgi göstermek için sorunu beğenin
23
+
24
+ GitHub'da [Uygulama Şablonu](https://github.com/aymericzip/intlayer-vite-preact-template)'na bakın.
25
+
26
+ ## Intlayer Nedir?
27
+
28
+ **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.
29
+
30
+ Intlayer ile şunları yapabilirsiniz:
31
+
32
+ - **Bileşen düzeyinde açıklayıcı sözlükler kullanarak çevirileri kolayca yönetin**.
33
+ - **Meta verileri, rotaları ve içeriği dinamik olarak yerelleştirin**.
34
+ - **Otomatik oluşturulan türlerle TypeScript desteği sağlayın**, böylece otomatik tamamlama ve hata algılama iyileşir.
35
+ - **Dinamik yerel ayar algılama ve anahtarlama gibi gelişmiş özelliklerden yararlanın**.
36
+
37
+ ---
38
+
39
+ ## Vite ve Preact Uygulamasında Intlayer Kurulumu İçin Adım Adım Kılavuz
40
+
41
+ ### Adım 1: Bağımlılıkları Kurma
42
+
43
+ Gerekli paketleri npm kullanarak kurun:
44
+
45
+ ```bash packageManager="npm"
46
+ npm install intlayer preact-intlayer
47
+ npm install vite-intlayer --save-dev
48
+ ```
49
+
50
+ ```bash packageManager="pnpm"
51
+ pnpm add intlayer preact-intlayer
52
+ pnpm add vite-intlayer --save-dev
53
+ ```
54
+
55
+ ```bash packageManager="yarn"
56
+ yarn add intlayer preact-intlayer
57
+ yarn add vite-intlayer --save-dev
58
+ ```
59
+
60
+ - **intlayer**
61
+
62
+ 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.
63
+
64
+ - **preact-intlayer**
65
+ Preact uygulamasıyla Intlayer'ı entegre eden paket. Preact uluslararasılaştırması için bağlam sağlayıcıları ve kancalar sağlar.
66
+
67
+ - **vite-intlayer**
68
+ [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.
69
+
70
+ ### Adım 2: Projenizi Yapılandırma
71
+
72
+ Uygulamanızın dillerini yapılandırmak için bir yapılandırma dosyası oluşturun:
73
+
74
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
75
+ import { Locales, type IntlayerConfig } from "intlayer";
76
+
77
+ const config: IntlayerConfig = {
78
+ internationalization: {
79
+ locales: [
80
+ Locales.ENGLISH,
81
+ Locales.FRENCH,
82
+ Locales.SPANISH,
83
+ // Diğer yerel ayarlarınız
84
+ ],
85
+ defaultLocale: Locales.ENGLISH,
86
+ },
87
+ };
88
+
89
+ export default config;
90
+ ```
91
+
92
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
93
+ import { Locales } from "intlayer";
94
+
95
+ /** @type {import('intlayer').IntlayerConfig} */
96
+ const config = {
97
+ internationalization: {
98
+ locales: [
99
+ Locales.ENGLISH,
100
+ Locales.FRENCH,
101
+ Locales.SPANISH,
102
+ // Diğer yerel ayarlarınız
103
+ ],
104
+ defaultLocale: Locales.ENGLISH,
105
+ },
106
+ };
107
+
108
+ export default config;
109
+ ```
110
+
111
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
112
+ const { Locales } = require("intlayer");
113
+
114
+ /** @type {import('intlayer').IntlayerConfig} */
115
+ const config = {
116
+ internationalization: {
117
+ locales: [
118
+ Locales.ENGLISH,
119
+ Locales.FRENCH,
120
+ Locales.SPANISH,
121
+ // Diğer yerel ayarlarınız
122
+ ],
123
+ defaultLocale: Locales.ENGLISH,
124
+ },
125
+ };
126
+
127
+ module.exports = config;
128
+ ```
129
+
130
+ > 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.
131
+
132
+ ### Adım 3: Intlayer'ı Vite Yapılandırmanıza Entegre Etme
133
+
134
+ Vite yapılandırmanıza intlayer eklentisini ekleyin.
135
+
136
+ ```typescript fileName="vite.config.ts" codeFormat="typescript"
137
+ import { defineConfig } from "vite";
138
+ import preact from "@preact/preset-vite";
139
+ import { intlayerPlugin } from "vite-intlayer";
140
+
141
+ // https://vitejs.dev/config/
142
+ export default defineConfig({
143
+ plugins: [preact(), intlayerPlugin()],
144
+ });
145
+ ```
146
+
147
+ ```javascript fileName="vite.config.mjs" codeFormat="esm"
148
+ import { defineConfig } from "vite";
149
+ import preact from "@preact/preset-vite";
150
+ import { intlayerPlugin } from "vite-intlayer";
151
+
152
+ // https://vitejs.dev/config/
153
+ export default defineConfig({
154
+ plugins: [preact(), intlayerPlugin()],
155
+ });
156
+ ```
157
+
158
+ ```javascript fileName="vite.config.cjs" codeFormat="commonjs"
159
+ const { defineConfig } = require("vite");
160
+ const preact = require("@preact/preset-vite");
161
+ const { intlayerPlugin } = require("vite-intlayer");
162
+
163
+ // https://vitejs.dev/config/
164
+ module.exports = defineConfig({
165
+ plugins: [preact(), intlayerPlugin()],
166
+ });
167
+ ```
168
+
169
+ > `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.
170
+
171
+ ### Adım 4: İçeriğinizi Bildirin
172
+
173
+ Çevirileri depolamak için içerik bildiriminizi oluşturun ve yönetin:
174
+
175
+ ```tsx fileName="src/app.content.tsx" contentDeclarationFormat="typescript"
176
+ import { t, type Dictionary } from "intlayer";
177
+ import type { ComponentChildren } from "preact";
178
+
179
+ const appContent = {
180
+ key: "app",
181
+ content: {
182
+ viteLogo: t({
183
+ en: "Vite logo",
184
+ fr: "Logo Vite",
185
+ es: "Logo Vite",
186
+ }),
187
+ preactLogo: t({
188
+ en: "Preact logo",
189
+ fr: "Logo Preact",
190
+ es: "Logo Preact",
191
+ }),
192
+
193
+ title: "Vite + Preact",
194
+
195
+ count: t({
196
+ en: "count is ",
197
+ fr: "le compte est ",
198
+ es: "el recuento es ",
199
+ }),
200
+
201
+ edit: t<ComponentChildren>({
202
+ en: (
203
+ <>
204
+ Edit <code>src/app.tsx</code> and save to test HMR
205
+ </>
206
+ ),
207
+ fr: (
208
+ <>
209
+ Éditez <code>src/app.tsx</code> et enregistrez pour tester HMR
210
+ </>
211
+ ),
212
+ es: (
213
+ <>
214
+ Edita <code>src/app.tsx</code> y guarda para probar HMR
215
+ </>
216
+ ),
217
+ }),
218
+
219
+ readTheDocs: t({
220
+ en: "Click on the Vite and Preact logos to learn more",
221
+ fr: "Cliquez sur les logos Vite et Preact pour en savoir plus",
222
+ es: "Haga clic en los logotipos de Vite y Preact para obtener más información",
223
+ }),
224
+ },
225
+ } satisfies Dictionary;
226
+
227
+ export default appContent;
228
+ ```
229
+
230
+ ```javascript fileName="src/app.content.mjs" contentDeclarationFormat="esm"
231
+ import { t } from "intlayer";
232
+ // import { h } from 'preact'; // JSX'i doğrudan .mjs'de kullanıyorsanız gerekli
233
+
234
+ /** @type {import('intlayer').Dictionary} */
235
+ const appContent = {
236
+ key: "app",
237
+ content: {
238
+ viteLogo: t({
239
+ en: "Vite logo",
240
+ fr: "Logo Vite",
241
+ es: "Logo Vite",
242
+ }),
243
+ preactLogo: t({
244
+ en: "Preact logo",
245
+ fr: "Logo Preact",
246
+ es: "Logo Preact",
247
+ }),
248
+
249
+ title: "Vite + Preact",
250
+
251
+ count: t({
252
+ en: "count is ",
253
+ fr: "le compte est ",
254
+ es: "el recuento es ",
255
+ }),
256
+
257
+ edit: t({
258
+ en: "Edit src/app.jsx and save to test HMR",
259
+ fr: "Éditez src/app.jsx et enregistrez pour tester HMR",
260
+ es: "Edita src/app.jsx y guarda para probar HMR",
261
+ }),
262
+
263
+ readTheDocs: t({
264
+ en: "Click on the Vite and Preact logos to learn more",
265
+ fr: "Cliquez sur les logos Vite et Preact pour en savoir plus",
266
+ es: "Haga clic en los logotipos de Vite y Preact para obtener más información",
267
+ }),
268
+ },
269
+ };
270
+
271
+ export default appContent;
272
+ ```
273
+
274
+ ```javascript fileName="src/app.content.cjs" contentDeclarationFormat="commonjs"
275
+ const { t } = require("intlayer");
276
+ // const { h } = require('preact'); // JSX'i doğrudan .cjs'de kullanıyorsanız gerekli
277
+
278
+ /** @type {import('intlayer').Dictionary} */
279
+ const appContent = {
280
+ key: "app",
281
+ content: {
282
+ viteLogo: t({
283
+ en: "Vite logo",
284
+ fr: "Logo Vite",
285
+ es: "Logo Vite",
286
+ }),
287
+ preactLogo: t({
288
+ en: "Preact logo",
289
+ fr: "Logo Preact",
290
+ es: "Logo Preact",
291
+ }),
292
+
293
+ title: "Vite + Preact",
294
+
295
+ count: t({
296
+ en: "count is ",
297
+ fr: "le compte est ",
298
+ es: "el recuento es ",
299
+ }),
300
+
301
+ edit: t({
302
+ en: "Edit src/app.tsx and save to test HMR",
303
+ fr: "Éditez src/app.tsx et enregistrez pour tester HMR",
304
+ es: "Edita src/app.tsx y guarda para probar HMR",
305
+ }),
306
+
307
+ readTheDocs: t({
308
+ en: "Click on the Vite and Preact logos to learn more",
309
+ fr: "Cliquez sur les logos Vite et Preact pour en savoir plus",
310
+ es: "Haga clic en los logotipos de Vite y Preact para obtener más información",
311
+ }),
312
+ },
313
+ };
314
+
315
+ module.exports = appContent;
316
+ ```
317
+
318
+ ```json fileName="src/app.content.json" contentDeclarationFormat="json"
319
+ {
320
+ "$schema": "https://intlayer.org/schema.json",
321
+ "key": "app",
322
+ "content": {
323
+ "viteLogo": {
324
+ "nodeType": "translation",
325
+ "translation": {
326
+ "en": "Vite logo",
327
+ "fr": "Logo Vite",
328
+ "es": "Logo Vite"
329
+ }
330
+ },
331
+ "preactLogo": {
332
+ "nodeType": "translation",
333
+ "translation": {
334
+ "en": "Preact logo",
335
+ "fr": "Logo Preact",
336
+ "es": "Logo Preact"
337
+ }
338
+ },
339
+ "title": {
340
+ "nodeType": "translation",
341
+ "translation": {
342
+ "en": "Vite + Preact",
343
+ "fr": "Vite + Preact",
344
+ "es": "Vite + Preact"
345
+ }
346
+ },
347
+ "count": {
348
+ "nodeType": "translation",
349
+ "translation": {
350
+ "en": "count is ",
351
+ "fr": "le compte est ",
352
+ "es": "el recuento es "
353
+ }
354
+ },
355
+ "edit": {
356
+ "nodeType": "translation",
357
+ "translation": {
358
+ "en": "Edit src/app.tsx and save to test HMR",
359
+ "fr": "Éditez src/app.tsx et enregistrez pour tester HMR",
360
+ "es": "Edita src/app.tsx y guarda para probar HMR"
361
+ }
362
+ },
363
+ "readTheDocs": {
364
+ "nodeType": "translation",
365
+ "translation": {
366
+ "en": "Click on the Vite and Preact logos to learn more",
367
+ "fr": "Cliquez sur les logos Vite et Preact pour en savoir plus",
368
+ "es": "Haga clic en los logotipos de Vite ve Preact para obtener más información"
369
+ }
370
+ }
371
+ }
372
+ }
373
+ ```
374
+
375
+ > İç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}`).
376
+
377
+ > 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.
378
+
379
+ > İçerik dosyanız TSX kodu içeriyorsa, `import { h } from "preact";`'ı içe aktarmanız gerekebilir veya JSX pragma'nızın Preact için doğru şekilde ayarlandığından emin olun.
380
+
381
+ ### Adım 5: Kodunuzda Intlayer'ı Kullanın
382
+
383
+ Uygulamanız boyunca içerik sözlüklerinize erişin:
384
+
385
+ ```tsx {6,10} fileName="src/app.tsx" codeFormat="typescript"
386
+ import { useState } from "preact/hooks";
387
+ import type { FunctionalComponent } from "preact";
388
+ import preactLogo from "./assets/preact.svg"; // preact.svg'niz olduğunu varsayalım
389
+ import viteLogo from "/vite.svg";
390
+ import "./app.css"; // CSS dosyanızın app.css olarak adlandırıldığını varsayalım
391
+ import { IntlayerProvider, useIntlayer } from "preact-intlayer";
392
+
393
+ const AppContent: FunctionalComponent = () => {
394
+ const [count, setCount] = useState(0);
395
+ const content = useIntlayer("app");
396
+
397
+ return (
398
+ <>
399
+ <div>
400
+ <a href="https://vitejs.dev" target="_blank">
401
+ <img src={viteLogo} class="logo" alt={content.viteLogo.value} />
402
+ </a>
403
+ <a href="https://preactjs.com" target="_blank">
404
+ <img
405
+ src={preactLogo}
406
+ class="logo preact"
407
+ alt={content.preactLogo.value}
408
+ />
409
+ </a>
410
+ </div>
411
+ <h1>{content.title}</h1>
412
+ <div class="card">
413
+ <button onClick={() => setCount((count) => count + 1)}>
414
+ {content.count}
415
+ {count}
416
+ </button>
417
+ <p>{content.edit}</p>
418
+ </div>
419
+ <p class="read-the-docs">{content.readTheDocs}</p>
420
+ </>
421
+ );
422
+ };
423
+
424
+ const App: FunctionalComponent = () => (
425
+ <IntlayerProvider>
426
+ <AppContent />
427
+ </IntlayerProvider>
428
+ );
429
+
430
+ export default App;
431
+ ```
432
+
433
+ ```jsx {5,9} fileName="src/app.jsx" codeFormat="esm"
434
+ import { useState } from "preact/hooks";
435
+ import preactLogo from "./assets/preact.svg";
436
+ import viteLogo from "/vite.svg";
437
+ import "./app.css";
438
+ import { IntlayerProvider, useIntlayer } from "preact-intlayer";
439
+
440
+ const AppContent = () => {
441
+ const [count, setCount] = useState(0);
442
+ const content = useIntlayer("app");
443
+
444
+ return (
445
+ <>
446
+ <div>
447
+ <a href="https://vitejs.dev" target="_blank">
448
+ <img src={viteLogo} class="logo" alt={content.viteLogo.value} />
449
+ </a>
450
+ <a href="https://preactjs.com" target="_blank">
451
+ <img
452
+ src={preactLogo}
453
+ class="logo preact"
454
+ alt={content.preactLogo.value}
455
+ />
456
+ </a>
457
+ </div>
458
+ <h1>{content.title}</h1>
459
+ <div class="card">
460
+ <button onClick={() => setCount((count) => count + 1)}>
461
+ {content.count}
462
+ {count}
463
+ </button>
464
+ <p>{content.edit}</p>
465
+ </div>
466
+ <p class="read-the-docs">{content.readTheDocs}</p>
467
+ </>
468
+ );
469
+ };
470
+
471
+ const App = () => (
472
+ <IntlayerProvider>
473
+ <AppContent />
474
+ </IntlayerProvider>
475
+ );
476
+
477
+ export default App;
478
+ ```
479
+
480
+ ```jsx {5,9} fileName="src/app.cjsx" codeFormat="commonjs"
481
+ const { useState } = require("preact/hooks");
482
+ const preactLogo = require("./assets/preact.svg");
483
+ const viteLogo = require("/vite.svg");
484
+ require("./app.css");
485
+ const { IntlayerProvider, useIntlayer } = require("preact-intlayer");
486
+
487
+ const AppContent = () => {
488
+ const [count, setCount] = useState(0);
489
+ const content = useIntlayer("app");
490
+
491
+ return (
492
+ <>
493
+ <div>
494
+ <a href="https://vitejs.dev" target="_blank">
495
+ <img src={viteLogo} class="logo" alt={content.viteLogo.value} />
496
+ </a>
497
+ <a href="https://preactjs.com" target="_blank">
498
+ <img
499
+ src={preactLogo}
500
+ class="logo preact"
501
+ alt={content.preactLogo.value}
502
+ />
503
+ </a>
504
+ </div>
505
+ <h1>{content.title}</h1>
506
+ <div class="card">
507
+ <button onClick={() => setCount((count) => count + 1)}>
508
+ {content.count}
509
+ {count}
510
+ </button>
511
+ <p>{content.edit}</p>
512
+ </div>
513
+ <p class="read-the-docs">{content.readTheDocs}</p>
514
+ </>
515
+ );
516
+ };
517
+
518
+ const App = () => (
519
+ <IntlayerProvider>
520
+ <AppContent />
521
+ </IntlayerProvider>
522
+ );
523
+
524
+ module.exports = App;
525
+ ```
526
+
527
+ > İçeriğinizi bir `string` niteliğinde kullanmak istediğinizde, `alt`, `title`, `href`, `aria-label` vb. gibi, işlevin değerini çağırmanız gerekir:
528
+
529
+ > ```jsx
530
+ > <img src={content.image.src.value} alt={content.image.value} />
531
+ > ```
532
+
533
+ > Not: Preact'te `className` genellikle `class` olarak yazılır.
534
+
535
+ > `useIntlayer` kancası hakkında daha fazla bilgi edinmek için [dokümantasyona](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useIntlayer.md) bakın (API `preact-intlayer` için benzer).
536
+
537
+ ### (İsteğe Bağlı) Adım 6: İçeriğinizin Dilini Değiştirin
538
+
539
+ İçeriğinizin dilini değiştirmek için `useLocale` kancası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.
540
+
541
+ ```tsx fileName="src/components/LocaleSwitcher.tsx" codeFormat="typescript"
542
+ import type { FunctionalComponent } from "preact";
543
+ import { Locales } from "intlayer";
544
+ import { useLocale } from "preact-intlayer";
545
+
546
+ const LocaleSwitcher: FunctionalComponent = () => {
547
+ const { setLocale } = useLocale();
548
+
549
+ return (
550
+ <button onClick={() => setLocale(Locales.ENGLISH)}>
551
+ Dili İngilizce'ye Değiştir
552
+ </button>
553
+ );
554
+ };
555
+
556
+ export default LocaleSwitcher;
557
+ ```
558
+
559
+ ```jsx fileName="src/components/LocaleSwitcher.jsx" codeFormat="esm"
560
+ import { Locales } from "intlayer";
561
+ import { useLocale } from "preact-intlayer";
562
+
563
+ const LocaleSwitcher = () => {
564
+ const { setLocale } = useLocale();
565
+
566
+ return (
567
+ <button onClick={() => setLocale(Locales.ENGLISH)}>
568
+ Dili İngilizce'ye Değiştir
569
+ </button>
570
+ );
571
+ };
572
+
573
+ export default LocaleSwitcher;
574
+ ```
575
+
576
+ ```jsx fileName="src/components/LocaleSwitcher.cjsx" codeFormat="commonjs"
577
+ const { Locales } = require("intlayer");
578
+ const { useLocale } = require("preact-intlayer");
579
+
580
+ const LocaleSwitcher = () => {
581
+ const { setLocale } = useLocale();
582
+
583
+ return (
584
+ <button onClick={() => setLocale(Locales.ENGLISH)}>
585
+ Dili İngilizce'ye Değiştir
586
+ </button>
587
+ );
588
+ };
589
+
590
+ module.exports = LocaleSwitcher;
591
+ ```
592
+
593
+ > `useLocale` kancası hakkında daha fazla bilgi edinmek için [dokümantasyona](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useLocale.md) bakın (API `preact-intlayer` için benzer).
594
+
595
+ ### (İsteğe Bağlı) Adım 7: Uygulamanıza Yerelleştirilmiş Yönlendirme Ekleyin
596
+
597
+ Bu adımın amacı, her dil için benzersiz rotalar oluşturmaktır. Bu, SEO ve SEO dostu URL'ler için kullanışlıdır.
598
+ Örnek:
599
+
600
+ ```plaintext
601
+ - https://example.com/about
602
+ - https://example.com/es/about
603
+ - https://example.com/fr/about
604
+ ```
605
+
606
+ > 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.
607
+
608
+ Uygulamanıza yerelleştirilmiş yönlendirme eklemek için, uygulamanızın rotalarını saran ve yerel ayar tabanlı yönlendirmeyi yöneten bir `LocaleRouter` bileşeni oluşturabilirsiniz. [preact-iso](https://github.com/preactjs/preact-iso) kullanarak bir örnek aşağıda verilmiştir:
609
+
610
+ Öncelikle `preact-iso`'yu kurun:
611
+
612
+ ```bash packageManager="npm"
613
+ npm install preact-iso
614
+ ```
615
+
616
+ ```bash packageManager="pnpm"
617
+ pnpm add preact-iso
618
+ ```
619
+
620
+ ```bash packageManager="yarn"
621
+ yarn add preact-iso
622
+ ```
623
+
624
+ ```tsx fileName="src/components/LocaleRouter.tsx" codeFormat="typescript"
625
+ import { type Locales, configuration, getPathWithoutLocale } from "intlayer";
626
+ import { ComponentChildren, FunctionalComponent } from "preact";
627
+ import { IntlayerProvider } from "preact-intlayer";
628
+ import { LocationProvider, useLocation } from "preact-iso";
629
+ import { useEffect } from "preact/hooks";
630
+
631
+ const { internationalization, middleware } = configuration;
632
+ const { locales, defaultLocale } = internationalization;
633
+
634
+ const Navigate: FunctionalComponent<{ to: string; replace?: boolean }> = ({
635
+ to,
636
+ replace,
637
+ }) => {
638
+ const { route } = useLocation();
639
+ useEffect(() => {
640
+ route(to, replace);
641
+ }, [to, replace, route]);
642
+ return null;
643
+ };
644
+
645
+ /**
646
+ * Yerelleştirme ve uygun yerel ayar bağlamıyla çocukları saran bir bileşen.
647
+ * URL tabanlı yerel ayar algılama ve doğrulama yönetir.
648
+ */
649
+ const AppLocalized: FunctionalComponent<{
650
+ children: ComponentChildren;
651
+ locale?: Locales;
652
+ }> = ({ children, locale }) => {
653
+ const { path: pathname, url } = useLocation();
654
+
655
+ if (!url) {
656
+ return null;
657
+ }
658
+
659
+ const search = url.substring(pathname.length);
660
+
661
+ // Sağlanmadıysa varsayılan yerel ayara geri dön
662
+ const currentLocale = locale ?? defaultLocale;
663
+
664
+ // Temel bir yol oluşturmak için yoldan yerel ayar önekini kaldır
665
+ const pathWithoutLocale = getPathWithoutLocale(
666
+ pathname // Geçerli URL yolu
667
+ );
668
+
669
+ /**
670
+ * middleware.prefixDefault true ise, varsayılan yerel ayar her zaman öneklenmelidir.
671
+ */
672
+ if (middleware.prefixDefault) {
673
+ // Yerel ayarı doğrula
674
+ if (!locale || !locales.includes(locale)) {
675
+ // Güncellenmiş yol ile varsayılan yerel ayara yönlendir
676
+ return (
677
+ <Navigate
678
+ to={`/${defaultLocale}/${pathWithoutLocale}${search}`}
679
+ replace // Geçerli geçmiş girişini yenisiyle değiştir
680
+ />
681
+ );
682
+ }
683
+
684
+ // Geçerli yerel ayarı ayarlayarak çocukları IntlayerProvider ile sar
685
+ return (
686
+ <IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
687
+ );
688
+ } else {
689
+ /**
690
+ * middleware.prefixDefault false olduğunda, varsayılan yerel ayar öneklenmez.
691
+ * Geçerli yerel ayar geçerli olduğundan ve varsayılan yerel ayar olmadığından emin ol.
692
+ */
693
+ if (
694
+ currentLocale.toString() !== defaultLocale.toString() &&
695
+ !locales
696
+ .filter(
697
+ (loc) => loc.toString() !== defaultLocale.toString() // Varsayılan yerel ayarı hariç tut
698
+ )
699
+ .includes(currentLocale) // Geçerli yerel ayar geçerli yerel ayarlar listesinde mi kontrol et
700
+ ) {
701
+ // Yerel ayar öneki olmadan yola yönlendir
702
+ return <Navigate to={`${pathWithoutLocale}${search}`} replace />;
703
+ }
704
+
705
+ // Geçerli yerel ayarı ayarlayarak çocukları IntlayerProvider ile sar
706
+ return (
707
+ <IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
708
+ );
709
+ }
710
+ };
711
+
712
+ const RouterContent: FunctionalComponent<{
713
+ children: ComponentChildren;
714
+ }> = ({ children }) => {
715
+ const { path } = useLocation();
716
+
717
+ if (!path) {
718
+ return null;
719
+ }
720
+
721
+ const pathLocale = path.split("/")[1] as Locales;
722
+
723
+ const isLocaleRoute = locales
724
+ .filter((locale) => middleware.prefixDefault || locale !== defaultLocale)
725
+ .some((locale) => locale.toString() === pathLocale);
726
+
727
+ if (isLocaleRoute) {
728
+ return <AppLocalized locale={pathLocale}>{children}</AppLocalized>;
729
+ }
730
+
731
+ return (
732
+ <AppLocalized
733
+ locale={!middleware.prefixDefault ? defaultLocale : undefined}
734
+ >
735
+ {children}
736
+ </AppLocalized>
737
+ );
738
+ };
739
+
740
+ /**
741
+ * Yerel ayar özel rotaları ayarlayan bir yönlendirici bileşen.
742
+ * preact-iso'yu kullanarak gezinmeyi yönetir ve yerelleştirilmiş bileşenleri işler.
743
+ */
744
+ export const LocaleRouter: FunctionalComponent<{
745
+ children: ComponentChildren;
746
+ }> = ({ children }) => (
747
+ <LocationProvider>
748
+ <RouterContent>{children}</RouterContent>
749
+ </LocationProvider>
750
+ );
751
+ ```
752
+
753
+ ```jsx fileName="src/components/LocaleRouter.jsx" codeFormat="esm"
754
+ // Gerekli bağımlılıkları ve işlevleri içe aktar
755
+ import { configuration, getPathWithoutLocale } from "intlayer";
756
+ import { IntlayerProvider } from "preact-intlayer";
757
+ import { LocationProvider, useLocation } from "preact-iso";
758
+ import { useEffect } from "preact/hooks";
759
+ import { h } from "preact"; // JSX için gerekli
760
+
761
+ // Intlayer'dan yapılandırmayı çıkar
762
+ const { internationalization, middleware } = configuration;
763
+ const { locales, defaultLocale } = internationalization;
764
+
765
+ const Navigate = ({ to, replace }) => {
766
+ const { route } = useLocation();
767
+ useEffect(() => {
768
+ route(to, replace);
769
+ }, [to, replace, route]);
770
+ return null;
771
+ };
772
+
773
+ /**
774
+ * Yerelleştirme ve uygun yerel ayar bağlamıyla çocukları saran bir bileşen.
775
+ * URL tabanlı yerel ayar algılama ve doğrulama yönetir.
776
+ */
777
+ const AppLocalized = ({ children, locale }) => {
778
+ const { path: pathname, url } = useLocation();
779
+
780
+ if (!url) {
781
+ return null;
782
+ }
783
+
784
+ const search = url.substring(pathname.length);
785
+
786
+ // Sağlanmadıysa varsayılan yerel ayara geri dön
787
+ const currentLocale = locale ?? defaultLocale;
788
+
789
+ // Temel bir yol oluşturmak için yoldan yerel ayar önekini kaldır
790
+ const pathWithoutLocale = getPathWithoutLocale(
791
+ pathname // Geçerli URL yolu
792
+ );
793
+
794
+ /**
795
+ * middleware.prefixDefault true ise, varsayılan yerel ayar her zaman öneklenmelidir.
796
+ */
797
+ if (middleware.prefixDefault) {
798
+ // Yerel ayarı doğrula
799
+ if (!locale || !locales.includes(locale)) {
800
+ // Güncellenmiş yol ile varsayılan yerel ayara yönlendir
801
+ return (
802
+ <Navigate
803
+ to={`/${defaultLocale}/${pathWithoutLocale}${search}`}
804
+ replace // Geçerli geçmiş girişini yenisiyle değiştir
805
+ />
806
+ );
807
+ }
808
+
809
+ // Geçerli yerel ayarı ayarlayarak çocukları IntlayerProvider ile sar
810
+ return (
811
+ <IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
812
+ );
813
+ } else {
814
+ /**
815
+ * middleware.prefixDefault false olduğunda, varsayılan yerel ayar öneklenmez.
816
+ * Geçerli yerel ayar geçerli olduğundan ve varsayılan yerel ayar olmadığından emin ol.
817
+ */
818
+ if (
819
+ currentLocale.toString() !== defaultLocale.toString() &&
820
+ !locales
821
+ .filter(
822
+ (loc) => loc.toString() !== defaultLocale.toString() // Varsayılan yerel ayarı hariç tut
823
+ )
824
+ .includes(currentLocale) // Geçerli yerel ayar geçerli yerel ayarlar listesinde mi kontrol et
825
+ ) {
826
+ // Yerel ayar öneki olmadan yola yönlendir
827
+ return <Navigate to={`${pathWithoutLocale}${search}`} replace />;
828
+ }
829
+
830
+ // Geçerli yerel ayarı ayarlayarak çocukları IntlayerProvider ile sar
831
+ return (
832
+ <IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
833
+ );
834
+ }
835
+ };
836
+
837
+ const RouterContent = ({ children }) => {
838
+ const { path } = useLocation();
839
+
840
+ if (!path) {
841
+ return null;
842
+ }
843
+
844
+ const pathLocale = path.split("/")[1];
845
+
846
+ const isLocaleRoute = locales
847
+ .filter((locale) => middleware.prefixDefault || locale !== defaultLocale)
848
+ .some((locale) => locale.toString() === pathLocale);
849
+
850
+ if (isLocaleRoute) {
851
+ return <AppLocalized locale={pathLocale}>{children}</AppLocalized>;
852
+ }
853
+
854
+ return (
855
+ <AppLocalized
856
+ locale={!middleware.prefixDefault ? defaultLocale : undefined}
857
+ >
858
+ {children}
859
+ </AppLocalized>
860
+ );
861
+ };
862
+
863
+ /**
864
+ * Yerel ayar özel rotaları ayarlayan bir yönlendirici bileşen.
865
+ * preact-iso'yu kullanarak gezinmeyi yönetir ve yerelleştirilmiş bileşenleri işler.
866
+ */
867
+ export const LocaleRouter = ({ children }) => (
868
+ <LocationProvider>
869
+ <RouterContent>{children}</RouterContent>
870
+ </LocationProvider>
871
+ );
872
+ ```
873
+
874
+ ```jsx fileName="src/components/LocaleRouter.cjsx" codeFormat="commonjs"
875
+ // Gerekli bağımlılıkları ve işlevleri içe aktar
876
+ const { configuration, getPathWithoutLocale } = require("intlayer");
877
+ const { IntlayerProvider } = require("preact-intlayer");
878
+ const { LocationProvider, useLocation } = require("preact-iso");
879
+ const { useEffect } = require("preact/hooks");
880
+ const { h } = require("preact"); // JSX için gerekli
881
+
882
+ // Intlayer'dan yapılandırmayı çıkar
883
+ const { internationalization, middleware } = configuration;
884
+ const { locales, defaultLocale } = internationalization;
885
+
886
+ const Navigate = ({ to, replace }) => {
887
+ const { route } = useLocation();
888
+ useEffect(() => {
889
+ route(to, replace);
890
+ }, [to, replace, route]);
891
+ return null;
892
+ };
893
+
894
+ /**
895
+ * Yerelleştirme ve uygun yerel ayar bağlamıyla çocukları saran bir bileşen.
896
+ * URL tabanlı yerel ayar algılama ve doğrulama yönetir.
897
+ */
898
+ const AppLocalized = ({ children, locale }) => {
899
+ const { path: pathname, url } = useLocation();
900
+
901
+ if (!url) {
902
+ return null;
903
+ }
904
+
905
+ const search = url.substring(pathname.length);
906
+
907
+ // Sağlanmadıysa varsayılan yerel ayara geri dön
908
+ const currentLocale = locale ?? defaultLocale;
909
+
910
+ // Temel bir yol oluşturmak için yoldan yerel ayar önekini kaldır
911
+ const pathWithoutLocale = getPathWithoutLocale(
912
+ pathname // Geçerli URL yolu
913
+ );
914
+
915
+ /**
916
+ * middleware.prefixDefault true ise, varsayılan yerel ayar her zaman öneklenmelidir.
917
+ */
918
+ if (middleware.prefixDefault) {
919
+ // Yerel ayarı doğrula
920
+ if (!locale || !locales.includes(locale)) {
921
+ // Güncellenmiş yol ile varsayılan yerel ayara yönlendir
922
+ return (
923
+ <Navigate
924
+ to={`/${defaultLocale}/${pathWithoutLocale}${search}`}
925
+ replace // Geçerli geçmiş girişini yenisiyle değiştir
926
+ />
927
+ );
928
+ }
929
+
930
+ // Geçerli yerel ayarı ayarlayarak çocukları IntlayerProvider ile sar
931
+ return (
932
+ <IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
933
+ );
934
+ } else {
935
+ /**
936
+ * middleware.prefixDefault false olduğunda, varsayılan yerel ayar öneklenmez.
937
+ * Geçerli yerel ayar geçerli olduğundan ve varsayılan yerel ayar olmadığından emin ol.
938
+ */
939
+ if (
940
+ currentLocale.toString() !== defaultLocale.toString() &&
941
+ !locales
942
+ .filter(
943
+ (loc) => loc.toString() !== defaultLocale.toString() // Varsayılan yerel ayarı hariç tut
944
+ )
945
+ .includes(currentLocale) // Geçerli yerel ayar geçerli yerel ayarlar listesinde mi kontrol et
946
+ ) {
947
+ // Yerel ayar öneki olmadan yola yönlendir
948
+ return <Navigate to={`${pathWithoutLocale}${search}`} replace />;
949
+ }
950
+
951
+ // Geçerli yerel ayarı ayarlayarak çocukları IntlayerProvider ile sar
952
+ return (
953
+ <IntlayerProvider locale={currentLocale}>{children}</IntlayerProvider>
954
+ );
955
+ }
956
+ };
957
+
958
+ const RouterContent = ({ children }) => {
959
+ const { path } = useLocation();
960
+
961
+ if (!path) {
962
+ return null;
963
+ }
964
+
965
+ const pathLocale = path.split("/")[1];
966
+
967
+ const isLocaleRoute = locales
968
+ .filter((locale) => middleware.prefixDefault || locale !== defaultLocale)
969
+ .some((locale) => locale.toString() === pathLocale);
970
+
971
+ if (isLocaleRoute) {
972
+ return <AppLocalized locale={pathLocale}>{children}</AppLocalized>;
973
+ }
974
+
975
+ return (
976
+ <AppLocalized
977
+ locale={!middleware.prefixDefault ? defaultLocale : undefined}
978
+ >
979
+ {children}
980
+ </AppLocalized>
981
+ );
982
+ };
983
+
984
+ /**
985
+ * Yerel ayar özel rotaları ayarlayan bir yönlendirici bileşen.
986
+ * preact-iso'yu kullanarak gezinmeyi yönetir ve yerelleştirilmiş bileşenleri işler.
987
+ */
988
+ const LocaleRouter = ({ children }) => (
989
+ <LocationProvider>
990
+ <RouterContent>{children}</RouterContent>
991
+ </LocationProvider>
992
+ );
993
+
994
+ module.exports = { LocaleRouter };
995
+ ```
996
+
997
+ Ardından, `LocaleRouter` bileşenini uygulamanızda kullanabilirsiniz:
998
+
999
+ ```tsx fileName="src/app.tsx" codeFormat="typescript"
1000
+ import { LocaleRouter } from "./components/LocaleRouter";
1001
+ import type { FunctionalComponent } from "preact";
1002
+ // ... AppContent bileşeniniz (5. Adımda tanımlandı)
1003
+
1004
+ const App: FunctionalComponent = () => (
1005
+ <LocaleRouter>
1006
+ <AppContent />
1007
+ </LocaleRouter>
1008
+ );
1009
+
1010
+ export default App;
1011
+ ```
1012
+
1013
+ ```jsx fileName="src/app.jsx" codeFormat="esm"
1014
+ import { LocaleRouter } from "./components/LocaleRouter";
1015
+ // ... AppContent bileşeniniz (5. Adımda tanımlandı)
1016
+
1017
+ const App = () => (
1018
+ <LocaleRouter>
1019
+ <AppContent />
1020
+ </AppContent>
1021
+ );
1022
+
1023
+ export default App;
1024
+ ```
1025
+
1026
+ ```jsx fileName="src/app.cjsx" codeFormat="commonjs"
1027
+ const { LocaleRouter } = require("./components/LocaleRouter");
1028
+ // ... AppContent bileşeniniz (5. Adımda tanımlandı)
1029
+
1030
+ const App = () => (
1031
+ <LocaleRouter>
1032
+ <AppContent />
1033
+ </LocaleRouter>
1034
+ );
1035
+
1036
+ module.exports = App;
1037
+ ```
1038
+
1039
+ 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.
1040
+
1041
+ > Not: Üretimde `intlayerMiddlewarePlugin`'i kullanmak için `vite-intlayer` paketini `devDependencies`'den `dependencies`'e taşımalısınız.
1042
+
1043
+ ```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
1044
+ import { defineConfig } from "vite";
1045
+ import preact from "@preact/preset-vite";
1046
+ import { intlayerPlugin, intlayerMiddlewarePlugin } from "vite-intlayer";
1047
+
1048
+ // https://vitejs.dev/config/
1049
+ export default defineConfig({
1050
+ plugins: [preact(), intlayerPlugin(), intlayerMiddlewarePlugin()],
1051
+ });
1052
+ ```
1053
+
1054
+ ```javascript {3,7} fileName="vite.config.mjs" codeFormat="esm"
1055
+ import { defineConfig } from "vite";
1056
+ import preact from "@preact/preset-vite";
1057
+ import { intlayerPlugin, intlayerMiddlewarePlugin } from "vite-intlayer";
1058
+
1059
+ // https://vitejs.dev/config/
1060
+ export default defineConfig({
1061
+ plugins: [preact(), intlayerPlugin(), intlayerMiddlewarePlugin()],
1062
+ });
1063
+ ```
1064
+
1065
+ ```javascript {3,7} fileName="vite.config.cjs" codeFormat="commonjs"
1066
+ const { defineConfig } = require("vite");
1067
+ const preact = require("@preact/preset-vite");
1068
+ const { intlayerPlugin, intlayerMiddlewarePlugin } = require("vite-intlayer");
1069
+
1070
+ // https://vitejs.dev/config/
1071
+ module.exports = defineConfig({
1072
+ plugins: [preact(), intlayerPlugin(), intlayerMiddlewarePlugin()],
1073
+ });
1074
+ ```
1075
+
1076
+ ### (İsteğe Bağlı) Adım 8: Yerel ayar değiştiğinde URL'yi değiştirin
1077
+
1078
+ Yerel ayar değiştiğinde URL'yi değiştirmek için `useLocale` kancasından sağlanan `onLocaleChange` prop'unu kullanabilirsiniz. Paralel olarak, URL yolunu güncellemek için `useLocation` ve `route`'u `preact-iso`'dan kullanabilirsiniz.
1079
+
1080
+ ```tsx fileName="src/components/LocaleSwitcher.tsx" codeFormat="typescript"
1081
+ import { useLocation, route } from "preact-iso";
1082
+ import {
1083
+ Locales,
1084
+ getHTMLTextDir,
1085
+ getLocaleName,
1086
+ getLocalizedUrl,
1087
+ } from "intlayer";
1088
+ import { useLocale } from "preact-intlayer";
1089
+ import type { FunctionalComponent } from "preact";
1090
+
1091
+ const LocaleSwitcher: FunctionalComponent = () => {
1092
+ const location = useLocation();
1093
+ const { locale, availableLocales, setLocale } = useLocale({
1094
+ onLocaleChange: (newLocale) => {
1095
+ const currentFullPath = location.url; // preact-iso tam url sağlar
1096
+ // Güncellenmiş yerel ayar ile URL'yi oluştur
1097
+ // Örnek: /es/about?foo=bar
1098
+ const pathWithLocale = getLocalizedUrl(currentFullPath, newLocale);
1099
+
1100
+ // URL yolunu güncelle
1101
+ route(pathWithLocale, true); // true için değiştir
1102
+ },
1103
+ });
1104
+
1105
+ return (
1106
+ <div>
1107
+ <button popovertarget="localePopover">{getLocaleName(locale)}</button>
1108
+ <div id="localePopover" popover="auto">
1109
+ {availableLocales.map((localeItem) => (
1110
+ <a
1111
+ href={getLocalizedUrl(location.url, localeItem)}
1112
+ hreflang={localeItem}
1113
+ aria-current={locale === localeItem ? "page" : undefined}
1114
+ onClick={(e) => {
1115
+ e.preventDefault();
1116
+ setLocale(localeItem);
1117
+ // Yerel ayar ayarlandıktan sonra programatik navigasyon onLocaleChange tarafından işlenecek
1118
+ }}
1119
+ key={localeItem}
1120
+ >
1121
+ <span>
1122
+ {/* Yerel ayar - örn. FR */}
1123
+ {localeItem}
1124
+ </span>
1125
+ <span>
1126
+ {/* Kendi yerel ayarındaki dil - örn. Français */}
1127
+ {getLocaleName(localeItem, localeItem)}
1128
+ </span>
1129
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
1130
+ {/* Geçerli yerel ayar set edildiğinde İspanyolca olarak Fransızca - örn. Francés */}
1131
+ {getLocaleName(localeItem, locale)}
1132
+ </span>
1133
+ <span dir="ltr" lang={Locales.ENGLISH}>
1134
+ {/* İngilizce olarak dil - örn. French */}
1135
+ {getLocaleName(localeItem, Locales.ENGLISH)}
1136
+ </span>
1137
+ </a>
1138
+ ))}
1139
+ </div>
1140
+ </div>
1141
+ );
1142
+ };
1143
+
1144
+ export default LocaleSwitcher;
1145
+ ```
1146
+
1147
+ ```jsx fileName="src/components/LocaleSwitcher.jsx" codeFormat="esm"
1148
+ import { useLocation, route } from "preact-iso";
1149
+ import {
1150
+ Locales,
1151
+ getHTMLTextDir,
1152
+ getLocaleName,
1153
+ getLocalizedUrl,
1154
+ } from "intlayer";
1155
+ import { useLocale } from "preact-intlayer";
1156
+ import { h } from "preact"; // JSX için
1157
+
1158
+ const LocaleSwitcher = () => {
1159
+ const location = useLocation();
1160
+ const { locale, availableLocales, setLocale } = useLocale({
1161
+ onLocaleChange: (newLocale) => {
1162
+ const currentFullPath = location.url;
1163
+ const pathWithLocale = getLocalizedUrl(currentFullPath, newLocale);
1164
+ route(pathWithLocale, true);
1165
+ },
1166
+ });
1167
+
1168
+ return (
1169
+ <div>
1170
+ <button popovertarget="localePopover">{getLocaleName(locale)}</button>
1171
+ <div id="localePopover" popover="auto">
1172
+ {availableLocales.map((localeItem) => (
1173
+ <a
1174
+ href={getLocalizedUrl(location.url, localeItem)}
1175
+ hreflang={localeItem}
1176
+ aria-current={locale === localeItem ? "page" : undefined}
1177
+ onClick={(e) => {
1178
+ e.preventDefault();
1179
+ setLocale(localeItem);
1180
+ }}
1181
+ key={localeItem}
1182
+ >
1183
+ <span>{localeItem}</span>
1184
+ <span>{getLocaleName(localeItem, localeItem)}</span>
1185
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
1186
+ {getLocaleName(localeItem, locale)}
1187
+ </span>
1188
+ <span dir="ltr" lang={Locales.ENGLISH}>
1189
+ {getLocaleName(localeItem, Locales.ENGLISH)}
1190
+ </span>
1191
+ </a>
1192
+ ))}
1193
+ </div>
1194
+ </div>
1195
+ );
1196
+ };
1197
+
1198
+ export default LocaleSwitcher;
1199
+ ```
1200
+
1201
+ ```jsx fileName="src/components/LocaleSwitcher.cjsx" codeFormat="commonjs"
1202
+ const { useLocation, route } = require("preact-iso");
1203
+ const {
1204
+ Locales,
1205
+ getHTMLTextDir,
1206
+ getLocaleName,
1207
+ getLocalizedUrl,
1208
+ } = require("intlayer");
1209
+ const { useLocale } = require("preact-intlayer");
1210
+ const { h } = require("preact"); // JSX için
1211
+
1212
+ const LocaleSwitcher = () => {
1213
+ const location = useLocation();
1214
+ const { locale, availableLocales, setLocale } = useLocale({
1215
+ onLocaleChange: (newLocale) => {
1216
+ const currentFullPath = location.url;
1217
+ const pathWithLocale = getLocalizedUrl(currentFullPath, newLocale);
1218
+ route(pathWithLocale, true);
1219
+ },
1220
+ });
1221
+
1222
+ return (
1223
+ <div>
1224
+ <button popovertarget="localePopover">{getLocaleName(locale)}</button>
1225
+ <div id="localePopover" popover="auto">
1226
+ {availableLocales.map((localeItem) => (
1227
+ <a
1228
+ href={getLocalizedUrl(location.url, localeItem)}
1229
+ hreflang={localeItem}
1230
+ aria-current={locale === localeItem ? "page" : undefined}
1231
+ onClick={(e) => {
1232
+ e.preventDefault();
1233
+ setLocale(localeItem);
1234
+ }}
1235
+ key={localeItem}
1236
+ >
1237
+ <span>{localeItem}</span>
1238
+ <span>{getLocaleName(localeItem, localeItem)}</span>
1239
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
1240
+ {getLocaleName(localeItem, locale)}
1241
+ </span>
1242
+ <span dir="ltr" lang={Locales.ENGLISH}>
1243
+ {getLocaleName(localeItem, Locales.ENGLISH)}
1244
+ </span>
1245
+ </a>
1246
+ ))}
1247
+ </div>
1248
+ </div>
1249
+ );
1250
+ };
1251
+
1252
+ module.exports = LocaleSwitcher;
1253
+ ```
1254
+
1255
+ > Dokümantasyon referansları:
1256
+ >
1257
+ > > - [`useLocale` kancası](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useLocale.md) (API `preact-intlayer` için benzer)> - [`getLocaleName` kancası](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/intlayer/getLocaleName.md)> - [`getLocalizedUrl` kancası](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/intlayer/getLocalizedUrl.md)> - [`getHTMLTextDir` kancası](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/intlayer/getHTMLTextDir.md)> - [`hreflang` niteliği](https://developers.google.com/search/docs/specialty/international/localized-versions?hl=fr)> - [`lang` niteliği](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)> - [`dir` niteliği](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)> - [`aria-current` niteliği](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)> - [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
1258
+
1259
+ Aşağıda **güncellenmiş Adım 9** açıklamalar ve iyileştirilmiş kod örnekleriyle eklenmiştir:
1260
+
1261
+ ---
1262
+
1263
+ ### (İsteğe Bağlı) Adım 9: HTML Dil ve Yön Niteliklerini Değiştirin
1264
+
1265
+ Uygulamanız birden fazla dili desteklediğinde, geçerli yerel ayar ile eşleşmesi için `<html>` etiketinin `lang` ve `dir` niteliklerini güncellemek önemlidir. Bunu yapmak şunları sağlar:
1266
+
1267
+ - **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.
1268
+ - **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.
1269
+ - **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.
1270
+
1271
+ 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.
1272
+
1273
+ #### Kancayı Uygulama
1274
+
1275
+ Geçerli yerel ayara göre HTML niteliklerini yöneten özel bir kanca oluşturun. Kanca yerel ayar değişikliklerini dinler ve nitelikleri buna göre günceller:
1276
+
1277
+ ```tsx fileName="src/hooks/useI18nHTMLAttributes.tsx" codeFormat="typescript"
1278
+ import { useEffect } from "preact/hooks";
1279
+ import { useLocale } from "preact-intlayer";
1280
+ import { getHTMLTextDir } from "intlayer";
1281
+
1282
+ /**
1283
+ * Geçerli yerel ayara göre HTML <html> etiketinin `lang` ve `dir` niteliklerini günceller.
1284
+ * - `lang`: Tarayıcılara ve arama motorlarına sayfanın dilini bildirir.
1285
+ * - `dir`: Geçerli yerel ayara göre doğru okuma sırasını (örneğin, İngilizce için 'ltr', Arapça için 'rtl') sağlar.
1286
+ *
1287
+ * Bu dinamik güncelleme, uygun metin işleme, erişilebilirlik ve SEO için gereklidir.
1288
+ */
1289
+ export const useI18nHTMLAttributes = () => {
1290
+ const { locale } = useLocale();
1291
+
1292
+ useEffect(() => {
1293
+ // Geçerli yerel ayara dil niteliğini ayarla
1294
+ document.documentElement.lang = locale;
1295
+
1296
+ // Geçerli yerel ayara göre metin yönünü ayarla
1297
+ document.documentElement.dir = getHTMLTextDir(locale);
1298
+ }, [locale]);
1299
+ };
1300
+ ```
1301
+
1302
+ ```jsx fileName="src/hooks/useI18nHTMLAttributes.jsx" codeFormat="esm"
1303
+ import { useEffect } from "preact/hooks";
1304
+ import { useLocale } from "preact-intlayer";
1305
+ import { getHTMLTextDir } from "intlayer";
1306
+
1307
+ /**
1308
+ * Geçerli yerel ayara göre HTML <html> etiketinin `lang` ve `dir` niteliklerini günceller.
1309
+ */
1310
+ export const useI18nHTMLAttributes = () => {
1311
+ const { locale } = useLocale();
1312
+
1313
+ useEffect(() => {
1314
+ document.documentElement.lang = locale;
1315
+ document.documentElement.dir = getHTMLTextDir(locale);
1316
+ }, [locale]);
1317
+ };
1318
+ ```
1319
+
1320
+ ```jsx fileName="src/hooks/useI18nHTMLAttributes.cjsx" codeFormat="commonjs"
1321
+ const { useEffect } = require("preact/hooks");
1322
+ const { useLocale } = require("preact-intlayer";
1323
+ const { getHTMLTextDir } = require("intlayer");
1324
+
1325
+ /**
1326
+ * Geçerli yerel ayara göre HTML <html> etiketinin `lang` ve `dir` niteliklerini günceller.
1327
+ */
1328
+ const useI18nHTMLAttributes = () => {
1329
+ const { locale } = useLocale();
1330
+
1331
+ useEffect(() => {
1332
+ document.documentElement.lang = locale;
1333
+ document.documentElement.dir = getHTMLTextDir(locale);
1334
+ }, [locale]);
1335
+ };
1336
+
1337
+ module.exports = { useI18nHTMLAttributes };
1338
+ ```
1339
+
1340
+ #### Uygulamanızda Kancayı Kullanma
1341
+
1342
+ Yerel ayar değiştiğinde HTML niteliklerinin güncellenmesi için kancayı ana bileşeninizde entegre edin:
1343
+
1344
+ ```tsx fileName="src/app.tsx" codeFormat="typescript"
1345
+ import type { FunctionalComponent } from "preact";
1346
+ import { IntlayerProvider } from "preact-intlayer"; // AppContent için useIntlayer zaten içe aktarılmışsa
1347
+ import { useI18nHTMLAttributes } from "./hooks/useI18nHTMLAttributes";
1348
+ import "./app.css";
1349
+ // AppContent tanımı 5. Adımdan
1350
+
1351
+ const AppWithHooks: FunctionalComponent = () => {
1352
+ // Kancayı kullanarak yerel ayara göre <html> etiketinin lang ve dir niteliklerini güncelle
1353
+ useI18nHTMLAttributes();
1354
+
1355
+ // AppContent, 5. Adımdan ana içerik görüntüleme bileşeniniz olduğunu varsayalım
1356
+ return <AppContent />;
1357
+ };
1358
+
1359
+ const App: FunctionalComponent = () => (
1360
+ <IntlayerProvider>
1361
+ <AppWithHooks />
1362
+ </IntlayerProvider>
1363
+ );
1364
+
1365
+ export default App;
1366
+ ```
1367
+
1368
+ ```jsx fileName="src/app.jsx" codeFormat="esm"
1369
+ import { IntlayerProvider } from "preact-intlayer";
1370
+ import { useI18nHTMLAttributes } from "./hooks/useI18nHTMLAttributes";
1371
+ import "./app.css";
1372
+ // AppContent tanımı 5. Adımdan
1373
+
1374
+ const AppWithHooks = () => {
1375
+ useI18nHTMLAttributes();
1376
+ return <AppContent />;
1377
+ };
1378
+
1379
+ const App = () => (
1380
+ <IntlayerProvider>
1381
+ <AppWithHooks />
1382
+ </IntlayerProvider>
1383
+ );
1384
+
1385
+ export default App;
1386
+ ```
1387
+
1388
+ ```jsx fileName="src/app.cjsx" codeFormat="commonjs"
1389
+ const { IntlayerProvider } = require("preact-intlayer");
1390
+ const { useI18nHTMLAttributes } = require("./hooks/useI18nHTMLAttributes");
1391
+ require("./app.css");
1392
+ // AppContent tanımı 5. Adımdan
1393
+
1394
+ const AppWithHooks = () => {
1395
+ useI18nHTMLAttributes();
1396
+ return <AppContent />;
1397
+ };
1398
+
1399
+ const App = () => (
1400
+ <IntlayerProvider>
1401
+ <AppWithHooks />
1402
+ </IntlayerProvider>
1403
+ );
1404
+
1405
+ module.exports = App;
1406
+ ```
1407
+
1408
+ Bu değişiklikleri uygulayarak uygulamanız şunları sağlayacak:
1409
+
1410
+ - **Dil** (`lang`) niteliği, SEO ve tarayıcı davranışı için geçerli yerel ayarı doğru şekilde yansıtacak.
1411
+ - **Metin yönü** (`dir`) niteliği, farklı okuma sıralarına sahip diller için okunabilirliği ve kullanılabilirliği geliştirecek.
1412
+ - Daha **erişilebilir** bir deneyim sağlayacak, çünkü yardımcı teknolojiler bu niteliklere optimum şekilde çalışmak için güvenir.
1413
+
1414
+ ### (İsteğe Bağlı) Adım 10: Yerelleştirilmiş Bağlantı Bileşeni Oluşturun
1415
+
1416
+ Uygulamanızın navigasyonu 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.
1417
+
1418
+ Bu davranış çeşitli nedenlerle kullanışlıdır:
1419
+
1420
+ - **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.
1421
+ - **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.
1422
+ - **Bakım Kolaylığı**: URL mantığını tek bir bileşende merkezileştirmek, yönetimini basitleştirir.
1423
+
1424
+ Preact ile `preact-iso` için, navigasyon için genellikle standart `<a>` etiketleri kullanılır ve `preact-iso` yönlendirmeyi yönetir. Tıklama üzerine programatik navigasyon yapmak istiyorsanız (örneğin, gezinmeden önce eylemler gerçekleştirmek için), `useLocation`'dan `route` işlevini kullanabilirsiniz. İşte `preact-iso`'nun `route` işlevini kullanarak (doğrudan içe aktararak veya `useLocation` aracılığıyla) URL'leri yerelleştiren özel bir anchor bileşeni:
1425
+
1426
+ ```tsx fileName="src/components/LocalizedLink.tsx" codeFormat="typescript"
1427
+ import { getLocalizedUrl } from "intlayer";
1428
+ import { useLocale, useLocation, route } from "preact-intlayer"; // preact-intlayer'dan re-export edilmişse useLocation ve route; aksi takdirde doğrudan içe aktar
1429
+ // Re-export edilmediyse, doğrudan içe aktar: import { useLocation, route } from "preact-iso";
1430
+ import type { JSX } from "preact"; // HTMLAttributes için
1431
+ import { forwardRef } from "preact/compat"; // Ref'leri iletmek için
1432
+
1433
+ export interface LocalizedLinkProps
1434
+ extends JSX.HTMLAttributes<HTMLAnchorElement> {
1435
+ href: string;
1436
+ replace?: boolean; // İsteğe bağlı: geçmiş durumunu değiştir
1437
+ }
1438
+
1439
+ /**
1440
+ * Verilen URL'nin harici olup olmadığını belirleyen yardımcı işlev.
1441
+ * URL http:// veya https:// ile başlıyorsa harici olarak kabul edilir.
1442
+ */
1443
+ export const checkIsExternalLink = (href?: string): boolean =>
1444
+ /^https?:\/\//.test(href ?? "");
1445
+
1446
+ /**
1447
+ * Geçerli yerel ayara göre href niteliğini uyarlayan özel bir Link bileşeni.
1448
+ * Dahili bağlantılar için `getLocalizedUrl` kullanarak URL'yi yerel ayar ile önekler (örneğin, /fr/about).
1449
+ * Bu, navigasyonun aynı yerel ayar bağlamında kalmasını sağlar.
1450
+ * Standart <a> etiketi kullanır ancak preact-iso'nun `route` ile istemci tarafı navigasyon tetikleyebilir.
1451
+ */
1452
+ export const LocalizedLink = forwardRef<HTMLAnchorElement, LocalizedLinkProps>(
1453
+ ({ href, children, onClick, replace = false, ...props }, ref) => {
1454
+ const { locale } = useLocale();
1455
+ const location = useLocation(); // preact-iso'dan
1456
+ const isExternalLink = checkIsExternalLink(href);
1457
+
1458
+ const hrefI18n =
1459
+ href && !isExternalLink ? getLocalizedUrl(href, locale) : href;
1460
+
1461
+ const handleClick = (event: JSX.TargetedMouseEvent<HTMLAnchorElement>) => {
1462
+ if (onClick) {
1463
+ onClick(event);
1464
+ }
1465
+ if (
1466
+ !isExternalLink &&
1467
+ href && // href'nin tanımlandığından emin ol
1468
+ event.button === 0 && // Sol tıklama
1469
+ !event.metaKey &&
1470
+ !event.ctrlKey &&
1471
+ !event.shiftKey &&
1472
+ !event.altKey && // Standart değiştirici kontrolü
1473
+ !props.target // Yeni sekme/pencere hedeflenmiyor
1474
+ ) {
1475
+ event.preventDefault();
1476
+ if (location.url !== hrefI18n) {
1477
+ // URL farklıysa sadece gezin
1478
+ route(hrefI18n, replace); // preact-iso'nun route'unu kullan
1479
+ }
1480
+ }
1481
+ };
1482
+
1483
+ return (
1484
+ <a href={hrefI18n} ref={ref} onClick={handleClick} {...props}>
1485
+ {children}
1486
+ </a>
1487
+ );
1488
+ }
1489
+ );
1490
+ ```
1491
+
1492
+ ```jsx fileName="src/components/LocalizedLink.jsx" codeFormat="esm"
1493
+ import { getLocalizedUrl } from "intlayer";
1494
+ import { useLocale } from "preact-intlayer";
1495
+ import { useLocation, route } from "preact-iso"; // preact-iso'dan içe aktar
1496
+ import { forwardRef } from "preact/compat";
1497
+ import { h } from "preact"; // JSX için
1498
+
1499
+ export const checkIsExternalLink = (href) => /^https?:\/\//.test(href ?? "");
1500
+
1501
+ export const LocalizedLink = forwardRef(
1502
+ ({ href, children, onClick, replace = false, ...props }, ref) => {
1503
+ const { locale } = useLocale();
1504
+ const location = useLocation();
1505
+ const isExternalLink = checkIsExternalLink(href);
1506
+
1507
+ const hrefI18n =
1508
+ href && !isExternalLink ? getLocalizedUrl(href, locale) : href;
1509
+
1510
+ const handleClick = (event) => {
1511
+ if (onClick) {
1512
+ onClick(event);
1513
+ }
1514
+ if (
1515
+ !isExternalLink &&
1516
+ href &&
1517
+ event.button === 0 &&
1518
+ !event.metaKey &&
1519
+ !event.ctrlKey &&
1520
+ !event.shiftKey &&
1521
+ !event.altKey &&
1522
+ !props.target
1523
+ ) {
1524
+ event.preventDefault();
1525
+ if (location.url !== hrefI18n) {
1526
+ route(hrefI18n, replace);
1527
+ }
1528
+ }
1529
+ };
1530
+
1531
+ return (
1532
+ <a href={hrefI18n} ref={ref} onClick={handleClick} {...props}>
1533
+ {children}
1534
+ </a>
1535
+ );
1536
+ }
1537
+ );
1538
+ ```
1539
+
1540
+ ```jsx fileName="src/components/LocalizedLink.cjsx" codeFormat="commonjs"
1541
+ const { getLocalizedUrl } = require("intlayer");
1542
+ const { useLocale } = require("preact-intlayer");
1543
+ const { useLocation, route } = require("preact-iso"); // preact-iso'dan içe aktar
1544
+ const { forwardRef } = require("preact/compat");
1545
+ const { h } = require("preact"); // JSX için
1546
+
1547
+ const checkIsExternalLink = (href) => /^https?:\/\//.test(href ?? "");
1548
+
1549
+ const LocalizedLink = forwardRef(
1550
+ ({ href, children, onClick, replace = false, ...props }, ref) => {
1551
+ const { locale } = useLocale();
1552
+ const location = useLocation();
1553
+ const isExternalLink = checkIsExternalLink(href);
1554
+
1555
+ const hrefI18n =
1556
+ href && !isExternalLink ? getLocalizedUrl(href, locale) : href;
1557
+
1558
+ const handleClick = (event) => {
1559
+ if (onClick) {
1560
+ onClick(event);
1561
+ }
1562
+ if (
1563
+ !isExternalLink &&
1564
+ href &&
1565
+ event.button === 0 &&
1566
+ !event.metaKey &&
1567
+ !event.ctrlKey &&
1568
+ !event.shiftKey &&
1569
+ !event.altKey &&
1570
+ !props.target
1571
+ ) {
1572
+ event.preventDefault();
1573
+ if (location.url !== hrefI18n) {
1574
+ route(hrefI18n, replace);
1575
+ }
1576
+ }
1577
+ };
1578
+
1579
+ return (
1580
+ <a href={hrefI18n} ref={ref} onClick={handleClick} {...props}>
1581
+ {children}
1582
+ </a>
1583
+ );
1584
+ }
1585
+ );
1586
+
1587
+ module.exports = { LocalizedLink, checkIsExternalLink };
1588
+ ```
1589
+
1590
+ #### Nasıl Çalışır
1591
+
1592
+ - **Harici Bağlantıları Algılama**:
1593
+ Yardımcı işlev `checkIsExternalLink`, bir URL'nin harici olup olmadığını belirler. Harici bağlantılar değişmeden bırakılır.
1594
+ - **Geçerli Yerel Ayarı Alma**:
1595
+ `useLocale` kancası geçerli yerel ayarı sağlar.
1596
+ - **URL'yi Yerelleştirme**:
1597
+ Dahili bağlantılar için `getLocalizedUrl`, URL'yi geçerli yerel ayar ile önekler.
1598
+ - **İstemci Tarafı Navigasyon**:
1599
+ `handleClick` işlevi, standart navigasyonun engellenip engellenmeyeceğini kontrol eder. Öyleyse, `useLocation` aracılığıyla veya doğrudan içe aktarılarak elde edilen preact-iso'nun `route` işlevini kullanarak istemci tarafı navigasyon gerçekleştirir. Bu, tam sayfa yeniden yüklemesi olmadan SPA benzeri davranış sağlar.
1600
+ - **Bağlantıyı Döndürme**:
1601
+ Bileşen, yerelleştirilmiş URL ve özel tıklama işleyicisi ile bir `<a>` etiketi döndürür.
1602
+
1603
+ ### TypeScript Yapılandırın
1604
+
1605
+ Intlayer, modül genişletmesi kullanarak TypeScript avantajlarından yararlanır.
1606
+
1607
+ ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1608
+
1609
+ ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1610
+
1611
+ Otomatik oluşturulan türleri TypeScript yapılandırmanıza dahil edin.
1612
+
1613
+ ```json5 fileName="tsconfig.json"
1614
+ {
1615
+ // ... Mevcut TypeScript yapılandırmalarınız
1616
+ "compilerOptions": {
1617
+ // ...
1618
+ "jsx": "react-jsx",
1619
+ "jsxImportSource": "preact", // Preact 10+ için önerilir
1620
+ // ...
1621
+ },
1622
+ "include": [
1623
+ // ... Mevcut TypeScript yapılandırmalarınız
1624
+ ".intlayer/**/*.ts", // Otomatik oluşturulan türleri dahil et
1625
+ ],
1626
+ }
1627
+ ```
1628
+
1629
+ > Preact için `tsconfig.json`'unuzu ayarladığınızdan emin olun, özellikle `jsx` ve `jsxImportSource` veya eski Preact sürümleri için `jsxFactory`/`jsxFragmentFactory` yoksa `preset-vite`'nin varsayılanlarını kullanın.
1630
+
1631
+ ### Git Yapılandırması
1632
+
1633
+ 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.
1634
+
1635
+ Bunu yapmak için `.gitignore` dosyanıza aşağıdaki talimatları ekleyin:
1636
+
1637
+ ```plaintext
1638
+ # Intlayer tarafından oluşturulan dosyaları yok say
1639
+ .intlayer
1640
+ ```
1641
+
1642
+ ### VS Code Uzantısı
1643
+
1644
+ Intlayer ile geliştirme deneyiminizi iyileştirmek için resmi **Intlayer VS Code Uzantısı**'nı kurun.
1645
+
1646
+ [VS Code Marketplace'ten yükleyin](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
1647
+
1648
+ Bu uzantı şunları sağlar:
1649
+
1650
+ - **Çeviri anahtarları için otomatik tamamlama**.
1651
+ - **Eksik çeviriler için gerçek zamanlı hata algılama**.
1652
+ - **Çevrilmiş içeriğin satır içi önizlemeleri**.
1653
+ - **Çevirileri kolayca oluşturmak ve güncellemek için hızlı eylemler**.
1654
+
1655
+ 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.
1656
+
1657
+ ---
1658
+
1659
+ ### Daha Fazla İlerle
1660
+
1661
+ 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.
1662
+
1663
+ ---
1664
+
1665
+ ## Dokümantasyon Geçmişi
1666
+
1667
+ | Sürüm | Tarih | Değişiklikler |
1668
+ | ------ | ---------- | ----------------- |
1669
+ | 5.5.10 | 2025-06-29 | Geçmiş başlatıldı |
1670
+
1671
+ ```
1672
+
1673
+ ```