@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,1506 @@
1
+ ---
2
+ createdAt: 2025-09-07
3
+ updatedAt: 2025-09-07
4
+ title: Next.js 15 web sitenizi çevirin (i18n)
5
+ description: Next.js 15 web sitenizi çok dilli hale getirmeyi öğrenin. Next.js 15 uygulamanızda uluslararasılaştırma (i18n) ve çeviri yapmak için dokümantasyonu takip edin.
6
+ keywords:
7
+ - Uluslararasılaştırma
8
+ - Dokümantasyon
9
+ - Intlayer
10
+ - Next.js 15
11
+ - JavaScript
12
+ - React
13
+ slugs:
14
+ - doc
15
+ - environment
16
+ - nextjs
17
+ applicationTemplate: https://github.com/aymericzip/intlayer-next-15-template
18
+ youtubeVideo: https://www.youtube.com/watch?v=e_PPG7PTqGU
19
+ ---
20
+
21
+ # Intlayer ve Next.js 15 App Router ile uluslararasılaştırma (i18n) başlangıç kılavuzu
22
+
23
+ <iframe title="Next.js için en iyi i18n çözümü mü? Intlayer'ı keşfedin" class="m-auto aspect-[16/9] w-full overflow-hidden rounded-lg border-0" allow="autoplay; gyroscope;" loading="lazy" width="1080" height="auto" src="https://www.youtube.com/embed/e_PPG7PTqGU?autoplay=0&amp;origin=http://intlayer.org&amp;controls=0&amp;rel=1"/>
24
+
25
+ GitHub'da [Uygulama Şablonu](https://github.com/aymericzip/intlayer-next-15-template)na bakın.
26
+
27
+ ## Intlayer Nedir?
28
+
29
+ **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. **Next.js 15** framework'ü ile sorunsuz bir şekilde entegre olur ve güçlü **App Router**'ını içerir. **Sunucu Bileşenleri** ile verimli rendering için optimize edilmiştir ve [**Turbopack**](https://nextjs.org/docs/architecture/turbopack) ile tamamen uyumludur.
30
+
31
+ Intlayer ile şunları yapabilirsiniz:
32
+
33
+ - **Çevirileri bildirimsel sözlükler kullanarak kolayca yönetin** bileşen düzeyinde.
34
+ - **Meta verileri, rotaları ve içeriği dinamik olarak yerelleştirin**.
35
+ - **İstemci tarafı ve sunucu tarafı bileşenlerinde çevirilere erişin**.
36
+ - **Otomatik oluşturulan türlerle TypeScript desteği sağlayın**, böylece otomatik tamamlama ve hata algılama iyileştirilir.
37
+ - **Gelişmiş özelliklerden yararlanın**, dinamik yerel algılama ve anahtarlama gibi.
38
+
39
+ > Intlayer, Next.js 12, 13, 14 ve 15 ile uyumludur. Next.js Sayfa Yönlendirici kullanıyorsanız, bu [kılavuza](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_nextjs_page_router.md) bakın. Next.js 12, 13, 14 App Router için bu [kılavuza](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_nextjs_14.md) bakın.
40
+
41
+ ---
42
+
43
+ ## Next.js Uygulamasında Intlayer Kurulumu Adım Adım Kılavuzu
44
+
45
+ ### Adım 1: Bağımlılıkları Kurma
46
+
47
+ Gerekli paketleri npm kullanarak kurun:
48
+
49
+ ```bash packageManager="npm"
50
+ npm install intlayer next-intlayer
51
+ ```
52
+
53
+ ```bash packageManager="pnpm"
54
+ pnpm add intlayer next-intlayer
55
+ ```
56
+
57
+ ```bash packageManager="yarn"
58
+ yarn add intlayer next-intlayer
59
+ ```
60
+
61
+ - **intlayer**
62
+
63
+ Yapılandırma yönetimi, çeviri, [içerik bildirimi](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md), derleme 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.
64
+
65
+ - **next-intlayer**
66
+
67
+ Intlayer'ı Next.js ile entegre eden paket. Next.js için bağlam sağlayıcıları ve kancalar sağlar. Ayrıca, Intlayer'ı [Webpack](https://webpack.js.org/) veya [Turbopack](https://nextjs.org/docs/app/api-reference/turbopack) ile entegre etmek için Next.js eklentisini içerir, ayrıca kullanıcının tercih ettiği yerel ayarı algılamak, çerezleri yönetmek ve URL yönlendirmesini işlemek için middleware içerir.
68
+
69
+ ### Adım 2: Projenizi Yapılandırma
70
+
71
+ Uygulamanızın dillerini yapılandırmak için bir yapılandırma dosyası oluşturun:
72
+
73
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
74
+ import { Locales, type IntlayerConfig } from "intlayer";
75
+
76
+ const config: IntlayerConfig = {
77
+ internationalization: {
78
+ locales: [
79
+ Locales.ENGLISH,
80
+ Locales.FRENCH,
81
+ Locales.SPANISH,
82
+ // Diğer yerel ayarlarınız
83
+ ],
84
+ defaultLocale: Locales.ENGLISH,
85
+ },
86
+ };
87
+
88
+ export default config;
89
+ ```
90
+
91
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
92
+ import { Locales } from "intlayer";
93
+
94
+ /** @type {import('intlayer').IntlayerConfig} */
95
+ const config = {
96
+ internationalization: {
97
+ locales: [
98
+ Locales.ENGLISH,
99
+ Locales.FRENCH,
100
+ Locales.SPANISH,
101
+ // Diğer yerel ayarlarınız
102
+ ],
103
+ defaultLocale: Locales.ENGLISH,
104
+ },
105
+ };
106
+
107
+ export default config;
108
+ ```
109
+
110
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
111
+ const { Locales } = require("intlayer");
112
+
113
+ /** @type {import('intlayer').IntlayerConfig} */
114
+ const config = {
115
+ internationalization: {
116
+ locales: [
117
+ Locales.ENGLISH,
118
+ Locales.FRENCH,
119
+ Locales.SPANISH,
120
+ // Diğer yerel ayarlarınız
121
+ ],
122
+ defaultLocale: Locales.ENGLISH,
123
+ },
124
+ };
125
+
126
+ module.exports = config;
127
+ ```
128
+
129
+ > Bu yapılandırma dosyası aracılığıyla, yerelleştirilmiş URL'ler, middleware yönlendirmesi, çerez adları, içerik bildirimlerinizin konumu ve uzantısı, Intlayer günlüklerinin konsolda devre dışı bırakılması 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.
130
+
131
+ ### Adım 3: Next.js Yapılandırmanızda Intlayer'ı Entegre Etme
132
+
133
+ Next.js kurulumunuzu Intlayer ile uyumlu hale getirin:
134
+
135
+ ```typescript fileName="next.config.ts" codeFormat="typescript"
136
+ import type { NextConfig } from "next";
137
+ import { withIntlayer } from "next-intlayer/server";
138
+
139
+ const nextConfig: NextConfig = {
140
+ /* yapılandırma seçenekleri burada */
141
+ };
142
+
143
+ export default withIntlayer(nextConfig);
144
+ ```
145
+
146
+ ```typescript fileName="next.config.mjs" codeFormat="esm"
147
+ import { withIntlayer } from "next-intlayer/server";
148
+
149
+ /** @type {import('next').NextConfig} */
150
+ const nextConfig = {
151
+ /* yapılandırma seçenekleri burada */
152
+ };
153
+
154
+ export default withIntlayer(nextConfig);
155
+ ```
156
+
157
+ ```typescript fileName="next.config.cjs" codeFormat="commonjs"
158
+ const { withIntlayer } = require("next-intlayer/server");
159
+
160
+ /** @type {import('next').NextConfig} */
161
+ const nextConfig = {
162
+ /* yapılandırma seçenekleri burada */
163
+ };
164
+
165
+ module.exports = withIntlayer(nextConfig);
166
+ ```
167
+
168
+ > `withIntlayer()` Next.js eklentisi, Intlayer'ı Next.js ile entegre etmek için kullanılır. İçerik bildirim dosyalarının oluşturulmasını sağlar ve bunları geliştirme modunda izler. Intlayer ortam değişkenlerini [Webpack](https://webpack.js.org/) veya [Turbopack](https://nextjs.org/docs/app/api-reference/turbopack) ortamlarında tanımlar. Ayrıca, performansı optimize etmek ve sunucu bileşenleriyle uyumluluğu sağlamak için takma adlar sağlar.
169
+ > `withIntlayer()` fonksiyonu promise tabanlı bir fonksiyondur.
170
+
171
+ ### Adım 4: Dinamik Yerel Rotalar Tanımlama
172
+
173
+ `RootLayout`'dan her şeyi kaldırın ve aşağıdaki kodla değiştirin:
174
+
175
+ ```tsx {3} fileName="src/app/layout.tsx" codeFormat="typescript"
176
+ import type { PropsWithChildren, FC } from "react";
177
+ import "./globals.css";
178
+
179
+ const RootLayout: FC<PropsWithChildren> = ({ children }) => children;
180
+
181
+ export default RootLayout;
182
+ ```
183
+
184
+ ```jsx {3} fileName="src/app/layout.mjx" codeFormat="esm"
185
+ import "./globals.css";
186
+
187
+ const RootLayout = ({ children }) => children;
188
+
189
+ export default RootLayout;
190
+ ```
191
+
192
+ ```jsx {1,8} fileName="src/app/layout.csx" codeFormat="commonjs"
193
+ require("./globals.css");
194
+
195
+ const RootLayout = ({ children }) => children;
196
+
197
+ module.exports = {
198
+ default: RootLayout,
199
+ generateStaticParams,
200
+ };
201
+ ```
202
+
203
+ > `RootLayout` bileşenini boş tutmak, [`lang`](https://developer.mozilla.org/fr/docs/Web/HTML/Global_attributes/lang) ve [`dir`](https://developer.mozilla.org/fr/docs/Web/HTML/Global_attributes/dir) niteliklerini `<html>` etiketine ayarlamanıza izin verir.
204
+
205
+ Dinamik yönlendirmeyi uygulamak için, `[locale]` dizininizde yeni bir düzen sağlayarak yerel ayar için yolu ekleyin:
206
+
207
+ ```tsx fileName="src/app/[locale]/layout.tsx" codeFormat="typescript"
208
+ import type { NextLayoutIntlayer } from "next-intlayer";
209
+ import { Inter } from "next/font/google";
210
+ import { getHTMLTextDir } from "intlayer";
211
+
212
+ const inter = Inter({ subsets: ["latin"] });
213
+
214
+ const LocaleLayout: NextLayoutIntlayer = async ({ children, params }) => {
215
+ const { locale } = await params;
216
+ return (
217
+ <html lang={locale} dir={getHTMLTextDir(locale)}>
218
+ <body className={inter.className}>{children}</body>
219
+ </html>
220
+ );
221
+ };
222
+
223
+ export default LocaleLayout;
224
+ ```
225
+
226
+ ```jsx fileName="src/app/[locale]/layout.mjx" codeFormat="esm"
227
+ import { getHTMLTextDir } from "intlayer";
228
+
229
+ const inter = Inter({ subsets: ["latin"] });
230
+
231
+ const LocaleLayout = async ({ children, params: { locale } }) => {
232
+ const { locale } = await params;
233
+ return (
234
+ <html lang={locale} dir={getHTMLTextDir(locale)}>
235
+ <body className={inter.className}>{children}</body>
236
+ </html>
237
+ );
238
+ };
239
+
240
+ export default LocaleLayout;
241
+ ```
242
+
243
+ ```jsx fileName="src/app/[locale]/layout.csx" codeFormat="commonjs"
244
+ const { Inter } = require("next/font/google");
245
+ const { getHTMLTextDir } = require("intlayer");
246
+
247
+ const inter = Inter({ subsets: ["latin"] });
248
+
249
+ const LocaleLayout = async ({ children, params: { locale } }) => {
250
+ const { locale } = await params;
251
+ return (
252
+ <html lang={locale} dir={getHTMLTextDir(locale)}>
253
+ <body className={inter.className}>{children}</body>
254
+ </html>
255
+ );
256
+ };
257
+
258
+ module.exports = LocaleLayout;
259
+ ```
260
+
261
+ > `[locale]` yol segmenti, yerel ayarı tanımlamak için kullanılır. Örnek: `/en-US/about` `en-US`'ye, `/fr/about` ise `fr`'ye referans verir.
262
+
263
+ > Bu aşamada, "Kök düzeninde `<html>` ve `<body>` etiketleri eksik" hatasıyla karşılaşacaksınız. Bu beklenir çünkü `/app/page.tsx` dosyası artık kullanımda değildir ve kaldırılabilir. Bunun yerine, `[locale]` yol segmenti `/app/[locale]/page.tsx` sayfasını etkinleştirir. Sonuç olarak, sayfalar tarayıcınızda `/en`, `/fr`, `/es` gibi yollarla erişilebilir olacaktır. Varsayılan yerel ayarı kök sayfa olarak ayarlamak için adım 7'deki `middleware` kurulumuna bakın.
264
+
265
+ Ardından, uygulama düzeninizde `generateStaticParams` fonksiyonunu uygulayın.
266
+
267
+ ```tsx {1} fileName="src/app/[locale]/layout.tsx" codeFormat="typescript"
268
+ export { generateStaticParams } from "next-intlayer"; // Eklenecek satır
269
+
270
+ const LocaleLayout: NextLayoutIntlayer = async ({ children, params }) => {
271
+ /*... Geri kalan kod*/
272
+ };
273
+
274
+ export default LocaleLayout;
275
+ ```
276
+
277
+ ```jsx {1} fileName="src/app/[locale]/layout.mjx" codeFormat="esm"
278
+ export { generateStaticParams } from "next-intlayer"; // Eklenecek satır
279
+
280
+ const LocaleLayout = async ({ children, params: { locale } }) => {
281
+ /*... Geri kalan kod*/
282
+ };
283
+
284
+ // ... Geri kalan kod
285
+ ```
286
+
287
+ ```jsx {1,7} fileName="src/app/[locale]/layout.csx" codeFormat="commonjs"
288
+ const { generateStaticParams } = require("next-intlayer"); // Eklenecek satır
289
+
290
+ const LocaleLayout = async ({ children, params: { locale } }) => {
291
+ /*... Geri kalan kod*/
292
+ };
293
+
294
+ module.exports = { default: LocaleLayout, generateStaticParams };
295
+ ```
296
+
297
+ > `generateStaticParams`, uygulamanızın tüm yerel ayarlar için gerekli sayfaları önceden oluşturmasını sağlar, böylece çalışma zamanı hesaplamasını azaltır ve kullanıcı deneyimini iyileştirir. Daha fazla detay için [Next.js'in generateStaticParams dokümantasyonuna](https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic-rendering#generate-static-params) bakın.
298
+
299
+ ### Adım 5: İçeriğinizi Bildirin
300
+
301
+ Çevirileri depolamak için içerik bildirimlerinizi oluşturun ve yönetin:
302
+
303
+ ```tsx fileName="src/app/[locale]/page.content.ts" contentDeclarationFormat="typescript"
304
+ import { t, type Dictionary } from "intlayer";
305
+
306
+ const pageContent = {
307
+ key: "page",
308
+ content: {
309
+ getStarted: {
310
+ main: t({
311
+ en: "Get started by editing",
312
+ fr: "Commencez par éditer",
313
+ es: "Comience por editar",
314
+ }),
315
+ pageLink: "src/app/page.tsx",
316
+ },
317
+ },
318
+ } satisfies Dictionary;
319
+
320
+ export default pageContent;
321
+ ```
322
+
323
+ ```javascript fileName="src/app/[locale]/page.content.mjs" contentDeclarationFormat="esm"
324
+ import { t } from "intlayer";
325
+
326
+ const pageContent = {
327
+ key: "page",
328
+ content: {
329
+ getStarted: {
330
+ main: t({
331
+ en: "Get started by editing",
332
+ fr: "Commencez par éditer",
333
+ es: "Comience por editar",
334
+ }),
335
+ pageLink: "src/app/page.tsx",
336
+ },
337
+ },
338
+ };
339
+
340
+ export default pageContent;
341
+ ```
342
+
343
+ ```javascript fileName="src/app/[locale]/page.content.cjs" contentDeclarationFormat="commonjs"
344
+ const { t } = require("intlayer");
345
+
346
+ const pageContent = {
347
+ key: "page",
348
+ content: {
349
+ getStarted: {
350
+ main: t({
351
+ en: "Get started by editing",
352
+ fr: "Commencez par éditer",
353
+ es: "Comience por editar",
354
+ }),
355
+ pageLink: "src/app/page.tsx",
356
+ },
357
+ },
358
+ };
359
+
360
+ module.exports = pageContent;
361
+ ```
362
+
363
+ ```json fileName="src/app/[locale]/page.content.json" contentDeclarationFormat="json"
364
+ {
365
+ "$schema": "https://intlayer.org/schema.json",
366
+ "key": "page",
367
+ "content": {
368
+ "getStarted": {
369
+ "nodeType": "translation",
370
+ "translation": {
371
+ "en": "Get started by editing",
372
+ "fr": "Commencez par éditer",
373
+ "es": "Comience por editar"
374
+ }
375
+ },
376
+ "pageLink": "src/app/page.tsx"
377
+ }
378
+ }
379
+ ```
380
+
381
+ > İçerik bildirimleriniz, varsayılan olarak `./src` olan `contentDir` dizinine dahil olduğu sürece uygulamanızın herhangi bir yerinde tanımlanabilir. Ve içerik bildirim dosyası uzantısı (varsayılan olarak `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`) ile eşleşmelidir.
382
+
383
+ > Daha fazla detay için [içerik bildirim dokümantasyonuna](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/get_started.md) bakın.
384
+
385
+ ### Adım 6: Kodunuzda İçeriği Kullanın
386
+
387
+ İçerik sözlüklerinize uygulamanız boyunca erişin:
388
+
389
+ ```tsx fileName="src/app/[locale]/page.tsx" codeFormat="typescript"
390
+ import type { FC } from "react";
391
+ import { ClientComponentExample } from "@components/ClientComponentExample";
392
+ import { ServerComponentExample } from "@components/ServerComponentExample";
393
+ import { type NextPageIntlayer, IntlayerClientProvider } from "next-intlayer";
394
+ import { IntlayerServerProvider, useIntlayer } from "next-intlayer/server";
395
+
396
+ const PageContent: FC = () => {
397
+ const content = useIntlayer("page");
398
+
399
+ return (
400
+ <>
401
+ <p>{content.getStarted.main}</p>
402
+ <code>{content.getStarted.pageLink}</code>
403
+ </>
404
+ );
405
+ };
406
+
407
+ const Page: NextPageIntlayer = async ({ params }) => {
408
+ const { locale } = await params;
409
+
410
+ return (
411
+ <IntlayerServerProvider locale={locale}>
412
+ <PageContent />
413
+ <ServerComponentExample />
414
+
415
+ <IntlayerClientProvider locale={locale}>
416
+ <ClientComponentExample />
417
+ </IntlayerClientProvider>
418
+ </IntlayerServerProvider>
419
+ );
420
+ };
421
+
422
+ export default Page;
423
+ ```
424
+
425
+ ```jsx fileName="src/app/[locale]/page.mjx" codeFormat="esm"
426
+ import { ClientComponentExample } from "@components/ClientComponentExample";
427
+ import { ServerComponentExample } from "@components/ServerComponentExample";
428
+ import { IntlayerClientProvider } from "next-intlayer";
429
+ import { IntlayerServerProvider, useIntlayer } from "next-intlayer/server";
430
+
431
+ const PageContent = () => {
432
+ const content = useIntlayer("page");
433
+
434
+ return (
435
+ <>
436
+ <p>{content.getStarted.main}</p>
437
+ <code>{content.getStarted.pageLink}</code>
438
+ </>
439
+ );
440
+ };
441
+
442
+ const Page = async ({ params }) => {
443
+ const { locale } = await params;
444
+
445
+ return (
446
+ <IntlayerServerProvider locale={locale}>
447
+ <PageContent />
448
+ <ServerComponentExample />
449
+
450
+ <IntlayerClientProvider locale={locale}>
451
+ <ClientComponentExample />
452
+ </IntlayerClientProvider>
453
+ </IntlayerServerProvider>
454
+ );
455
+ };
456
+
457
+ export default Page;
458
+ ```
459
+
460
+ ```jsx fileName="src/app/[locale]/page.csx" codeFormat="commonjs"
461
+ import { ClientComponentExample } from "@components/ClientComponentExample";
462
+ import { ServerComponentExample } from "@components/ServerComponentExample";
463
+ import { IntlayerClientProvider } from "next-intlayer";
464
+ import { IntlayerServerProvider, useIntlayer } from "next-intlayer/server";
465
+
466
+ const PageContent = () => {
467
+ const content = useIntlayer("page");
468
+
469
+ return (
470
+ <>
471
+ <p>{content.getStarted.main}</p>
472
+ <code>{content.getStarted.pageLink}</code>
473
+ </>
474
+ );
475
+ };
476
+
477
+ const Page = async ({ params }) => {
478
+ const { locale } = await params;
479
+
480
+ return (
481
+ <IntlayerServerProvider locale={locale}>
482
+ <PageContent />
483
+ <ServerComponentExample />
484
+
485
+ <IntlayerClientProvider locale={locale}>
486
+ <ClientComponentExample />
487
+ </IntlayerClientProvider>
488
+ </IntlayerServerProvider>
489
+ );
490
+ };
491
+ ```
492
+
493
+ - **`IntlayerClientProvider`** istemci tarafı bileşenleri için yerel ayarı sağlamak için kullanılır. Düzen dahil olmak üzere herhangi bir üst bileşende yerleştirilebilir. Ancak, düzenlerde yerleştirmek önerilir çünkü Next.js düzen kodunu sayfalar arasında paylaşır, böylece yeniden başlatmadan kaçınılır ve performans iyileştirilir. Düzenlerde `IntlayerClientProvider` kullanmak, uygulamanız genelinde tutarlı bir yerelleştirme bağlamı sağlar.
494
+ - **`IntlayerServerProvider`** sunucu alt öğeleri için yerel ayarı sağlamak için kullanılır. Düzenlerde ayarlanamaz.
495
+
496
+ > Düzen ve sayfa, sunucu bağlam sistemi [React'in cache](https://react.dev/reference/react/cache) mekanizması aracılığıyla istek başına veri deposuna dayandığı için ortak bir sunucu bağlamını paylaşamaz. Sağlayıcıyı paylaşılan bir düzende yerleştirmek, sunucu bileşenlerinize sunucu bağlam değerlerinin doğru şekilde yayılmasını engelleyen bu izolasyonu bozar.
497
+
498
+ ```tsx {4,7} fileName="src/components/ClientComponentExample.tsx" codeFormat="typescript"
499
+ "use client";
500
+
501
+ import type { FC } from "react";
502
+ import { useIntlayer } from "next-intlayer";
503
+
504
+ export const ClientComponentExample: FC = () => {
505
+ const content = useIntlayer("client-component-example"); // İlgili içerik bildirimi oluşturun
506
+
507
+ return (
508
+ <div>
509
+ <h2>{content.title}</h2>
510
+ <p>{content.content}</p>
511
+ </div>
512
+ );
513
+ };
514
+ ```
515
+
516
+ ```jsx {3,6} fileName="src/components/ClientComponentExample.mjx" codeFormat="esm"
517
+ "use client";
518
+
519
+ import { useIntlayer } from "next-intlayer";
520
+
521
+ const ClientComponentExample = () => {
522
+ const content = useIntlayer("client-component-example"); // İlgili içerik bildirimi oluşturun
523
+
524
+ return (
525
+ <div>
526
+ <h2>{content.title}</h2>
527
+ <p>{content.content}</p>
528
+ </div>
529
+ );
530
+ };
531
+ ```
532
+
533
+ ```jsx {3,6} fileName="src/components/ClientComponentExample.csx" codeFormat="commonjs"
534
+ "use client";
535
+
536
+ const { useIntlayer } = require("next-intlayer");
537
+
538
+ const ClientComponentExample = () => {
539
+ const content = useIntlayer("client-component-example"); // İlgili içerik bildirimi oluşturun
540
+
541
+ return (
542
+ <div>
543
+ <h2>{content.title}</h2>
544
+ <p>{content.content}</p>
545
+ </div>
546
+ );
547
+ };
548
+ ```
549
+
550
+ ```tsx {2} fileName="src/components/ServerComponentExample.tsx" codeFormat="typescript"
551
+ import type { FC } from "react";
552
+ import { useIntlayer } from "next-intlayer/server";
553
+
554
+ export const ServerComponentExample: FC = () => {
555
+ const content = useIntlayer("server-component-example"); // İlgili içerik bildirimi oluşturun
556
+
557
+ return (
558
+ <div>
559
+ <h2>{content.title}</h2>
560
+ <p>{content.content}</p>
561
+ </div>
562
+ );
563
+ };
564
+ ```
565
+
566
+ ```jsx {1} fileName="src/components/ServerComponentExample.mjx" codeFormat="esm"
567
+ import { useIntlayer } from "next-intlayer/server";
568
+
569
+ const ServerComponentExample = () => {
570
+ const content = useIntlayer("server-component-example"); // İlgili içerik bildirimi oluşturun
571
+
572
+ return (
573
+ <div>
574
+ <h2>{content.title}</h2>
575
+ <p>{content.content}</p>
576
+ </div>
577
+ );
578
+ };
579
+ ```
580
+
581
+ ```jsx {1} fileName="src/components/ServerComponentExample.csx" codeFormat="commonjs"
582
+ const { useIntlayer } = require("next-intlayer/server");
583
+
584
+ const ServerComponentExample = () => {
585
+ const content = useIntlayer("server-component-example"); // İlgili içerik bildirimi oluşturun
586
+
587
+ return (
588
+ <div>
589
+ <h2>{content.title}</h2>
590
+ <p>{content.content}</p>
591
+ </div>
592
+ );
593
+ };
594
+ ```
595
+
596
+ > İçeriğinizi bir `string` niteliğinde kullanmak istiyorsanız, `alt`, `title`, `href`, `aria-label` vb. gibi, fonksiyonun değerini çağırmanız gerekir:
597
+
598
+ > ```jsx
599
+ > <img src={content.image.src.value} alt={content.image.value} />
600
+ > ```
601
+
602
+ > `useIntlayer` kancası hakkında daha fazla bilgi edinmek için [dokümantasyona](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/next-intlayer/useIntlayer.md) bakın.
603
+
604
+ ### (İsteğe Bağlı) Adım 7: Yerel Algılama için Middleware Kurulumu
605
+
606
+ Kullanıcının tercih ettiği yerel ayarı algılamak için middleware kurun:
607
+
608
+ ```typescript fileName="src/middleware.ts" codeFormat="typescript"
609
+ export { intlayerMiddleware as middleware } from "next-intlayer/middleware";
610
+
611
+ export const config = {
612
+ matcher:
613
+ "/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
614
+ };
615
+ ```
616
+
617
+ ```javascript fileName="src/middleware.mjs" codeFormat="esm"
618
+ export { intlayerMiddleware as middleware } from "next-intlayer/middleware";
619
+
620
+ export const config = {
621
+ matcher:
622
+ "/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
623
+ };
624
+ ```
625
+
626
+ ```javascript fileName="src/middleware.cjs" codeFormat="commonjs"
627
+ const { intlayerMiddleware } = require("next-intlayer/middleware");
628
+
629
+ const config = {
630
+ matcher:
631
+ "/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
632
+ };
633
+
634
+ module.exports = { middleware: intlayerMiddleware, config };
635
+ ```
636
+
637
+ > `intlayerMiddleware`, kullanıcının tercih ettiği yerel ayarı algılar ve onları [yapılandırmada](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md) belirtildiği gibi uygun URL'ye yönlendirir. Ayrıca, kullanıcının tercih ettiği yerel ayarı bir çerezde kaydetmeyi etkinleştirir.
638
+
639
+ ### (İsteğe Bağlı) Adım 8: Meta verilerinizin uluslararasılaştırılması
640
+
641
+ Meta verilerinizi uluslararasılaştırmak istiyorsanız, sayfanızın başlığını çevirmek gibi, Next.js tarafından sağlanan `generateMetadata` fonksiyonunu kullanabilirsiniz. İçinde, `getIntlayer` fonksiyonundan içeriği alarak meta verilerinizi çevirebilirsiniz.
642
+
643
+ ```typescript fileName="src/app/[locale]/metadata.content.ts" contentDeclarationFormat="typescript"
644
+ import { type Dictionary, t } from "intlayer";
645
+ import { Metadata } from "next";
646
+
647
+ const metadataContent = {
648
+ key: "page-metadata",
649
+ content: {
650
+ title: t({
651
+ en: "Create Next App",
652
+ fr: "Créer une application Next.js",
653
+ es: "Crear una aplicación Next.js",
654
+ }),
655
+ description: t({
656
+ en: "Generated by create next app",
657
+ fr: "Généré par create next app",
658
+ es: "Generado por create next app",
659
+ }),
660
+ },
661
+ } satisfies Dictionary<Metadata>;
662
+
663
+ export default metadataContent;
664
+ ```
665
+
666
+ ```javascript fileName="src/app/[locale]/metadata.content.mjs" contentDeclarationFormat="esm"
667
+ import { t } from "intlayer";
668
+
669
+ /** @type {import('intlayer').Dictionary<import('next').Metadata>} */
670
+ const metadataContent = {
671
+ key: "page-metadata",
672
+ content: {
673
+ title: t({
674
+ en: "Create Next App",
675
+ fr: "Créer une application Next.js",
676
+ es: "Crear una aplicación Next.js",
677
+ }),
678
+ description: t({
679
+ en: "Generated by create next app",
680
+ fr: "Généré par create next app",
681
+ es: "Generado por create next app",
682
+ }),
683
+ },
684
+ };
685
+
686
+ export default metadataContent;
687
+ ```
688
+
689
+ ```javascript fileName="src/app/[locale]/metadata.content.cjs" contentDeclarationFormat="commonjs"
690
+ const { t } = require("intlayer");
691
+
692
+ /** @type {import('intlayer').Dictionary<import('next').Metadata>} */
693
+ const metadataContent = {
694
+ key: "page-metadata",
695
+ content: {
696
+ title: t({
697
+ en: "Create Next App",
698
+ fr: "Créer une application Next.js",
699
+ es: "Crear una aplicación Next.js",
700
+ }),
701
+ description: t({
702
+ en: "Generated by create next app",
703
+ fr: "Généré par create next app",
704
+ es: "Generado por create next app",
705
+ }),
706
+ },
707
+ };
708
+
709
+ module.exports = metadataContent;
710
+ ```
711
+
712
+ ```json fileName="src/app/[locale]/metadata.content.json" contentDeclarationFormat="json"
713
+ {
714
+ "key": "page-metadata",
715
+ "content": {
716
+ "title": {
717
+ "nodeType": "translation",
718
+ "translation": {
719
+ "en": "Preact logo",
720
+ "fr": "Logo Preact",
721
+ "es": "Logo Preact",
722
+ },
723
+ },
724
+ "description": {
725
+ "nodeType": "translation",
726
+ "translation": {
727
+ "en": "Generated by create next app",
728
+ "fr": "Généré par create next app",
729
+ "es": "Generado por create next app",
730
+ },
731
+ },
732
+ },
733
+ };
734
+ ```
735
+
736
+ ````typescript fileName="src/app/[locale]/layout.tsx or src/app/[locale]/page.tsx" codeFormat="typescript"
737
+ import { getIntlayer, getMultilingualUrls } from "intlayer";
738
+ import type { Metadata } from "next";
739
+ import type { LocalPromiseParams } from "next-intlayer";
740
+
741
+ export const generateMetadata = async ({
742
+ params,
743
+ }: LocalPromiseParams): Promise<Metadata> => {
744
+ const { locale } = await params;
745
+
746
+ const metadata = getIntlayer("page-metadata", locale);
747
+
748
+ /**
749
+ * Her yerel ayar için tüm URL'leri içeren bir nesne oluşturur.
750
+ *
751
+ * Örnek:
752
+ * ```ts
753
+ * getMultilingualUrls('/about');
754
+ *
755
+ * // Döndürür
756
+ * // {
757
+ * // en: '/about',
758
+ * // fr: '/fr/about',
759
+ * // es: '/es/about',
760
+ * // }
761
+ * ```
762
+ */
763
+ const multilingualUrls = getMultilingualUrls("/");
764
+
765
+ return {
766
+ ...metadata,
767
+ alternates: {
768
+ canonical: multilingualUrls[locale as keyof typeof multilingualUrls],
769
+ languages: { ...multilingualUrls, "x-default": "/" },
770
+ },
771
+ openGraph: {
772
+ url: multilingualUrls[locale],
773
+ },
774
+ };
775
+ };
776
+
777
+ // ... Geri kalan kod
778
+ ````
779
+
780
+ ````javascript fileName="src/app/[locale]/layout.mjs or src/app/[locale]/page.mjs" codeFormat="esm"
781
+ import { getIntlayer, getMultilingualUrls } from "intlayer";
782
+
783
+ export const generateMetadata = async ({ params }) => {
784
+ const { locale } = await params;
785
+
786
+ const metadata = getIntlayer("page-metadata", locale);
787
+
788
+ /**
789
+ * Her yerel ayar için tüm URL'leri içeren bir nesne oluşturur.
790
+ *
791
+ * Örnek:
792
+ * ```ts
793
+ * getMultilingualUrls('/about');
794
+ *
795
+ * // Döndürür
796
+ * // {
797
+ * // en: '/about',
798
+ * // fr: '/fr/about',
799
+ * // es: '/es/about'
800
+ * // }
801
+ * ```
802
+ */
803
+ const multilingualUrls = getMultilingualUrls("/");
804
+
805
+ return {
806
+ ...metadata,
807
+ alternates: {
808
+ canonical: multilingualUrls[locale],
809
+ languages: { ...multilingualUrls, "x-default": "/" },
810
+ },
811
+ openGraph: {
812
+ url: multilingualUrls[locale],
813
+ },
814
+ };
815
+ };
816
+
817
+ // ... Geri kalan kod
818
+ ````
819
+
820
+ ````javascript fileName="src/app/[locale]/layout.cjs or src/app/[locale]/page.cjs" codeFormat="commonjs"
821
+ const { getIntlayer, getMultilingualUrls } = require("intlayer");
822
+
823
+ const generateMetadata = async ({ params }) => {
824
+ const { locale } = await params;
825
+
826
+ const metadata = getIntlayer("page-metadata", locale);
827
+
828
+ /**
829
+ * Her yerel ayar için tüm URL'leri içeren bir nesne oluşturur.
830
+ *
831
+ * Örnek:
832
+ * ```ts
833
+ * getMultilingualUrls('/about');
834
+ *
835
+ * // Döndürür
836
+ * // {
837
+ * // en: '/about',
838
+ * // fr: '/fr/about',
839
+ * // es: '/es/about'
840
+ * // }
841
+ * ```
842
+ */
843
+ const multilingualUrls = getMultilingualUrls("/");
844
+
845
+ return {
846
+ ...metadata,
847
+ alternates: {
848
+ canonical: multilingualUrls[locale],
849
+ languages: { ...multilingualUrls, "x-default": "/" },
850
+ },
851
+ openGraph: {
852
+ url: multilingualUrls[locale],
853
+ },
854
+ };
855
+ };
856
+
857
+ module.exports = { generateMetadata };
858
+
859
+ // ... Geri kalan kod
860
+ ````
861
+
862
+ > Not: `next-intlayer`'dan içe aktarılan `getIntlayer` fonksiyonu, içeriğinizi görsel düzenleyici ile entegrasyon için `IntlayerNode`'a sarılmış olarak döndürür. Aksine, `intlayer`'dan içe aktarılan `getIntlayer` fonksiyonu içeriğinizi doğrudan ek özellikler olmadan döndürür.
863
+
864
+ Alternatif olarak, meta verilerinizi bildirmek için `getTranslation` fonksiyonunu kullanabilirsiniz. Ancak, içerik bildirim dosyalarını kullanmak, meta verilerinizin çevirisini otomatikleştirmek ve içeriği bir noktada harici hale getirmek için önerilir.
865
+
866
+ ```typescript fileName="src/app/[locale]/layout.tsx or src/app/[locale]/page.tsx" codeFormat="typescript"
867
+ import {
868
+ type IConfigLocales,
869
+ getTranslation,
870
+ getMultilingualUrls,
871
+ } from "intlayer";
872
+ import type { Metadata } from "next";
873
+ import type { LocalPromiseParams } from "next-intlayer";
874
+
875
+ export const generateMetadata = async ({
876
+ params,
877
+ }: LocalPromiseParams): Promise<Metadata> => {
878
+ const { locale } = await params;
879
+ const t = <T>(content: IConfigLocales<T>) => getTranslation(content, locale);
880
+
881
+ return {
882
+ title: t<string>({
883
+ en: "My title",
884
+ fr: "Mon titre",
885
+ es: "Mi título",
886
+ }),
887
+ description: t({
888
+ en: "My description",
889
+ fr: "Ma description",
890
+ es: "Mi descripción",
891
+ }),
892
+ };
893
+ };
894
+
895
+ // ... Geri kalan kod
896
+ ```
897
+
898
+ ```javascript fileName="src/app/[locale]/layout.mjs or src/app/[locale]/page.mjs" codeFormat="esm"
899
+ import { getTranslation, getMultilingualUrls } from "intlayer";
900
+
901
+ export const generateMetadata = async ({ params }) => {
902
+ const { locale } = await params;
903
+ const t = (content) => getTranslation(content, locale);
904
+
905
+ return {
906
+ title: t({
907
+ en: "My title",
908
+ fr: "Mon titre",
909
+ es: "Mi título",
910
+ }),
911
+ description: t({
912
+ en: "My description",
913
+ fr: "Ma description",
914
+ es: "Mi descripción",
915
+ }),
916
+ };
917
+ };
918
+
919
+ // ... Geri kalan kod
920
+ ```
921
+
922
+ ```javascript fileName="src/app/[locale]/layout.cjs or src/app/[locale]/page.cjs" codeFormat="commonjs"
923
+ const { getTranslation, getMultilingualUrls } = require("intlayer");
924
+
925
+ const generateMetadata = async ({ params }) => {
926
+ const { locale } = await params;
927
+
928
+ const t = (content) => getTranslation(content, locale);
929
+
930
+ return {
931
+ title: t({
932
+ en: "My title",
933
+ fr: "Mon titre",
934
+ es: "Mi título",
935
+ }),
936
+ description: t({
937
+ en: "My description",
938
+ fr: "Ma description",
939
+ es: "Mi descripción",
940
+ }),
941
+ };
942
+ };
943
+
944
+ module.exports = { generateMetadata };
945
+
946
+ // ... Geri kalan kod
947
+ ```
948
+
949
+ > Meta veri optimizasyonu hakkında daha fazla bilgi edinmek için resmi [Next.js dokümantasyonuna](https://nextjs.org/docs/app/building-your-application/optimizing/metadata) bakın.
950
+
951
+ ### (İsteğe Bağlı) Adım 9: Sitemap.xml ve robots.txt'nizin uluslararasılaştırılması
952
+
953
+ `sitemap.xml` ve `robots.txt`'nizi uluslararasılaştırmak için, Intlayer tarafından sağlanan `getMultilingualUrls` fonksiyonunu kullanabilirsiniz. Bu fonksiyon, sitemap'iniz için çok dilli URL'ler oluşturmanıza izin verir.
954
+
955
+ ```tsx fileName="src/app/sitemap.ts" codeFormat="typescript"
956
+ import { getMultilingualUrls } from "intlayer";
957
+ import type { MetadataRoute } from "next";
958
+
959
+ const sitemap = (): MetadataRoute.Sitemap => [
960
+ {
961
+ url: "https://example.com",
962
+ alternates: {
963
+ languages: { ...getMultilingualUrls("https://example.com") },
964
+ },
965
+ },
966
+ {
967
+ url: "https://example.com/login",
968
+ alternates: {
969
+ languages: { ...getMultilingualUrls("https://example.com/login") },
970
+ },
971
+ },
972
+ {
973
+ url: "https://example.com/register",
974
+ alternates: {
975
+ languages: { ...getMultilingualUrls("https://example.com/register") },
976
+ },
977
+ },
978
+ ];
979
+
980
+ export default sitemap;
981
+ ```
982
+
983
+ ```jsx fileName="src/app/sitemap.mjx" codeFormat="esm"
984
+ import { getMultilingualUrls } from "intlayer";
985
+
986
+ const sitemap = () => [
987
+ {
988
+ url: "https://example.com",
989
+ alternates: {
990
+ languages: { ...getMultilingualUrls("https://example.com") },
991
+ },
992
+ },
993
+ {
994
+ url: "https://example.com/login",
995
+ alternates: {
996
+ languages: { ...getMultilingualUrls("https://example.com/login") },
997
+ },
998
+ },
999
+ {
1000
+ url: "https://example.com/register",
1001
+ alternates: {
1002
+ languages: { ...getMultilingualUrls("https://example.com/register") },
1003
+ },
1004
+ },
1005
+ ];
1006
+
1007
+ export default sitemap;
1008
+ ```
1009
+
1010
+ ```jsx fileName="src/app/sitemap.csx" codeFormat="commonjs"
1011
+ const { getMultilingualUrls } = require("intlayer");
1012
+
1013
+ const sitemap = () => [
1014
+ {
1015
+ url: "https://example.com",
1016
+ alternates: {
1017
+ languages: { ...getMultilingualUrls("https://example.com") },
1018
+ },
1019
+ },
1020
+ {
1021
+ url: "https://example.com/login",
1022
+ alternates: {
1023
+ languages: { ...getMultilingualUrls("https://example.com/login") },
1024
+ },
1025
+ },
1026
+ {
1027
+ url: "https://example.com/register",
1028
+ alternates: {
1029
+ languages: { ...getMultilingualUrls("https://example.com/register") },
1030
+ },
1031
+ },
1032
+ ];
1033
+
1034
+ module.exports = sitemap;
1035
+ ```
1036
+
1037
+ ```tsx fileName="src/app/robots.ts" codeFormat="typescript"
1038
+ import type { MetadataRoute } from "next";
1039
+ import { getMultilingualUrls } from "intlayer";
1040
+
1041
+ const getAllMultilingualUrls = (urls: string[]) =>
1042
+ urls.flatMap((url) => Object.values(getMultilingualUrls(url)) as string[]);
1043
+
1044
+ const robots = (): MetadataRoute.Robots => ({
1045
+ rules: {
1046
+ userAgent: "*",
1047
+ allow: ["/"],
1048
+ disallow: getAllMultilingualUrls(["/login", "/register"]),
1049
+ },
1050
+ host: "https://example.com",
1051
+ sitemap: `https://example.com/sitemap.xml`,
1052
+ });
1053
+
1054
+ export default robots;
1055
+ ```
1056
+
1057
+ ```jsx fileName="src/app/robots.mjx" codeFormat="esm"
1058
+ import { getMultilingualUrls } from "intlayer";
1059
+
1060
+ const getAllMultilingualUrls = (urls) =>
1061
+ urls.flatMap((url) => Object.values(getMultilingualUrls(url)));
1062
+
1063
+ const robots = () => ({
1064
+ rules: {
1065
+ userAgent: "*",
1066
+ allow: ["/"],
1067
+ disallow: getAllMultilingualUrls(["/login", "/register"]),
1068
+ },
1069
+ host: "https://example.com",
1070
+ sitemap: `https://example.com/sitemap.xml`,
1071
+ });
1072
+
1073
+ export default robots;
1074
+ ```
1075
+
1076
+ ```jsx fileName="src/app/robots.csx" codeFormat="commonjs"
1077
+ const { getMultilingualUrls } = require("intlayer");
1078
+
1079
+ const getAllMultilingualUrls = (urls) =>
1080
+ urls.flatMap((url) => Object.values(getMultilingualUrls(url)));
1081
+
1082
+ const robots = () => ({
1083
+ rules: {
1084
+ userAgent: "*",
1085
+ allow: ["/"],
1086
+ disallow: getAllMultilingualUrls(["/login", "/register"]),
1087
+ },
1088
+ host: "https://example.com",
1089
+ sitemap: `https://example.com/sitemap.xml`,
1090
+ });
1091
+
1092
+ export default robots;
1093
+ ```
1094
+
1095
+ > Sitemap optimizasyonu hakkında daha fazla bilgi edinmek için resmi [Next.js dokümantasyonuna](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap). Robots.txt optimizasyonu hakkında daha fazla bilgi edinmek için resmi [Next.js dokümantasyonuna](https://nextjs.org/docs/app/api-reference/file-conventions/metadata/robots) bakın.
1096
+
1097
+ ### (İsteğe Bağlı) Adım 10: İçeriğinizin dilini değiştirme
1098
+
1099
+ Next.js'te içeriğinizin dilini değiştirmek için, kullanıcıları uygun yerelleştirilmiş sayfaya yönlendirmek için `Link` bileşenini kullanmak önerilen yoldur. `Link` bileşeni, sayfa ön yüklemesini etkinleştirir, bu da tam sayfa yeniden yüklemeden kaçınmaya yardımcı olur.
1100
+
1101
+ ```tsx fileName="src/components/LocaleSwitcher.tsx" codeFormat="typescript"
1102
+ "use client";
1103
+
1104
+ import type { FC } from "react";
1105
+ import {
1106
+ Locales,
1107
+ getHTMLTextDir,
1108
+ getLocaleName,
1109
+ getLocalizedUrl,
1110
+ } from "intlayer";
1111
+ import { useLocale } from "next-intlayer";
1112
+ import Link from "next/link";
1113
+
1114
+ export const LocaleSwitcher: FC = () => {
1115
+ const { locale, pathWithoutLocale, availableLocales } = useLocale();
1116
+ const { setLocaleCookie } = useLocaleCookie();
1117
+
1118
+ return (
1119
+ <div>
1120
+ <button popoverTarget="localePopover">{getLocaleName(locale)}</button>
1121
+ <div id="localePopover" popover="auto">
1122
+ {availableLocales.map((localeItem) => (
1123
+ <Link
1124
+ href={getLocalizedUrl(pathWithoutLocale, localeItem)}
1125
+ hrefLang={localeItem}
1126
+ key={localeItem}
1127
+ aria-current={locale === localeItem ? "page" : undefined}
1128
+ onClick={() => setLocaleCookie(localeItem)}
1129
+ >
1130
+ <span>
1131
+ {/* Yerel ayar - örn. FR */}
1132
+ {localeItem}
1133
+ </span>
1134
+ <span>
1135
+ {/* Kendi yerel ayarındaki dil - örn. Français */}
1136
+ {getLocaleName(localeItem, locale)}
1137
+ </span>
1138
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
1139
+ {/* Geçerli yerel ayar set edildiğinde dil - örn. Locales.SPANISH set edildiğinde Francés */}
1140
+ {getLocaleName(localeItem)}
1141
+ </span>
1142
+ <span dir="ltr" lang={Locales.ENGLISH}>
1143
+ {/* İngilizce'deki dil - örn. French */}
1144
+ {getLocaleName(localeItem, Locales.ENGLISH)}
1145
+ </span>
1146
+ </Link>
1147
+ ))}
1148
+ </div>
1149
+ </div>
1150
+ );
1151
+ };
1152
+ ```
1153
+
1154
+ ```jsx fileName="src/components/LocaleSwitcher.msx" codeFormat="esm"
1155
+ "use client";
1156
+
1157
+ import {
1158
+ Locales,
1159
+ getHTMLTextDir,
1160
+ getLocaleName,
1161
+ getLocalizedUrl,
1162
+ } from "intlayer";
1163
+ import { useLocale } from "next-intlayer";
1164
+ import Link from "next/link";
1165
+
1166
+ export const LocaleSwitcher = () => {
1167
+ const { locale, pathWithoutLocale, availableLocales } = useLocale();
1168
+ const { setLocaleCookie } = useLocaleCookie();
1169
+
1170
+ return (
1171
+ <div>
1172
+ <button popoverTarget="localePopover">{getLocaleName(locale)}</button>
1173
+ <div id="localePopover" popover="auto">
1174
+ {availableLocales.map((localeItem) => (
1175
+ <Link
1176
+ href={getLocalizedUrl(pathWithoutLocale, localeItem)}
1177
+ hrefLang={localeItem}
1178
+ key={localeItem}
1179
+ aria-current={locale === localeItem ? "page" : undefined}
1180
+ onClick={() => setLocaleCookie(localeItem)}
1181
+ >
1182
+ <span>
1183
+ {/* Yerel ayar - örn. FR */}
1184
+ {localeItem}
1185
+ </span>
1186
+ <span>
1187
+ {/* Kendi yerel ayarındaki dil - örn. Français */}
1188
+ {getLocaleName(localeItem, locale)}
1189
+ </span>
1190
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
1191
+ {/* Geçerli yerel ayar set edildiğinde dil - örn. Locales.SPANISH set edildiğinde Francés */}
1192
+ {getLocaleName(localeItem)}
1193
+ </span>
1194
+ <span dir="ltr" lang={Locales.ENGLISH}>
1195
+ {/* İngilizce'deki dil - örn. French */}
1196
+ {getLocaleName(localeItem, Locales.ENGLISH)}
1197
+ </span>
1198
+ </Link>
1199
+ ))}
1200
+ </div>
1201
+ </div>
1202
+ );
1203
+ };
1204
+ ```
1205
+
1206
+ ```jsx fileName="src/components/LocaleSwitcher.csx" codeFormat="commonjs"
1207
+ "use client";
1208
+
1209
+ const {
1210
+ Locales,
1211
+ getHTMLTextDir,
1212
+ getLocaleName,
1213
+ getLocalizedUrl,
1214
+ } = require("intlayer");
1215
+ const { useLocale } = require("next-intlayer");
1216
+ const Link = require("next/link");
1217
+
1218
+ export const LocaleSwitcher = () => {
1219
+ const { locale, pathWithoutLocale, availableLocales } = useLocale();
1220
+
1221
+ return (
1222
+ <div>
1223
+ <button popoverTarget="localePopover">{getLocaleName(locale)}</button>
1224
+ <div id="localePopover" popover="auto">
1225
+ {availableLocales.map((localeItem) => (
1226
+ <Link
1227
+ href={getLocalizedUrl(pathWithoutLocale, localeItem)}
1228
+ hrefLang={localeItem}
1229
+ key={localeItem}
1230
+ aria-current={locale === localeItem ? "page" : undefined}
1231
+ onClick={() => setLocaleCookie(localeItem)}
1232
+ >
1233
+ <span>
1234
+ {/* Yerel ayar - örn. FR */}
1235
+ {localeItem}
1236
+ </span>
1237
+ <span>
1238
+ {/* Kendi yerel ayarındaki dil - örn. Français */}
1239
+ {getLocaleName(localeItem, locale)}
1240
+ </span>
1241
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
1242
+ {/* Geçerli yerel ayar set edildiğinde dil - örn. Locales.SPANISH set edildiğinde Francés */}
1243
+ {getLocaleName(localeItem)}
1244
+ </span>
1245
+ <span dir="ltr" lang={Locales.ENGLISH}>
1246
+ {/* İngilizce'deki dil - örn. French */}
1247
+ {getLocaleName(localeItem, Locales.ENGLISH)}
1248
+ </span>
1249
+ </Link>
1250
+ ))}
1251
+ </div>
1252
+ </div>
1253
+ );
1254
+ };
1255
+ ```
1256
+
1257
+ > Alternatif bir yol, `useLocale` kancası tarafından sağlanan `setLocale` fonksiyonunu kullanmaktır. Bu fonksiyon, sayfa ön yüklemesine izin vermez ve sayfayı yeniden yükler.
1258
+
1259
+ > Bu durumda, `router.push` kullanarak yönlendirme olmadan, sadece sunucu tarafı kodunuz içeriğin yerel ayarını değiştirecektir.
1260
+
1261
+ ```tsx fileName="src/components/LocaleSwitcher.tsx" codeFormat="typescript"
1262
+ "use client";
1263
+
1264
+ import { useRouter } from "next/navigation";
1265
+ import { useLocale } from "next-intlayer";
1266
+ import { getLocalizedUrl } from "intlayer";
1267
+
1268
+ // ... Geri kalan kod
1269
+
1270
+ const router = useRouter();
1271
+ const { setLocale } = useLocale({
1272
+ onLocaleChange: (locale) => {
1273
+ router.push(getLocalizedUrl(pathWithoutLocale, locale));
1274
+ },
1275
+ });
1276
+
1277
+ return (
1278
+ <button onClick={() => setLocale(Locales.FRENCH)}>Fransızca'ya Geç</button>
1279
+ );
1280
+ ```
1281
+
1282
+ > Dokümantasyon referansları:
1283
+ >
1284
+ > - [`useLocale` kancası](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/next-intlayer/useLocale.md)
1285
+ > - [`getLocaleName` kancası](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/intlayer/getLocaleName.md)
1286
+ > - [`getLocalizedUrl` kancası](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/intlayer/getLocalizedUrl.md)
1287
+ > - [`getHTMLTextDir` kancası](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/intlayer/getHTMLTextDir.md)
1288
+ > - [`hrefLang` özelliği](https://developers.google.com/search/docs/specialty/international/localized-versions?hl=fr)
1289
+ > - [`lang` özelliği](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)
1290
+ > - [`dir` özelliği](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)
1291
+ > - [`aria-current` özelliği](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)
1292
+
1293
+ ### (İsteğe Bağlı) Adım 11: Yerelleştirilmiş Bağlantı Bileşeni Oluşturma
1294
+
1295
+ Uygulamanızın navigasyonunun mevcut yerel ayarı saygı göstermesini sağlamak için, özel bir `Link` bileşeni oluşturabilirsiniz. Bu bileşen, dahili URL'leri otomatik olarak mevcut dille önekler, böylece örneğin Fransızca konuşan bir kullanıcı "Hakkında" sayfasına bir bağlantıya tıkladığında, `/fr/hakkinda` yerine `/hakkinda`ya yönlendirilir.
1296
+
1297
+ Bu davranış birkaç nedenden dolayı kullanışlıdır:
1298
+
1299
+ - **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 sağlar.
1300
+ - **Tutarlılık**: Uygulamanız boyunca yerelleştirilmiş bir bağlantı kullanarak, navigasyonun mevcut yerel ayar içinde kalmasını garanti edersiniz, beklenmedik dil anahtarlarını önlersiniz.
1301
+ - **Bakım Kolaylığı**: URL yönetim mantığını tek bir bileşende merkezileştirmek, kod tabanınızı yönetmeyi ve uygulamanız büyüdükçe genişletmeyi basitleştirir.
1302
+
1303
+ Aşağıda, TypeScript'te yerelleştirilmiş bir `Link` bileşeninin uygulanması bulunmaktadır:
1304
+
1305
+ ```tsx fileName="src/components/Link.tsx" codeFormat="typescript"
1306
+ "use client";
1307
+
1308
+ import { getLocalizedUrl } from "intlayer";
1309
+ import NextLink, { type LinkProps as NextLinkProps } from "next/link";
1310
+ import { useLocale } from "next-intlayer";
1311
+ import type { PropsWithChildren, FC } from "react";
1312
+
1313
+ /**
1314
+ * Verilen bir URL'nin harici olup olmadığını kontrol eden yardımcı fonksiyon.
1315
+ * URL http:// veya https:// ile başlıyorsa, harici olarak kabul edilir.
1316
+ */
1317
+ export const checkIsExternalLink = (href?: string): boolean =>
1318
+ /^https?:\/\//.test(href ?? "");
1319
+
1320
+ /**
1321
+ * Href özelliğini mevcut yerel ayar temelinde uyarlayan özel bir Link bileşeni.
1322
+ * Dahili bağlantılar için, `getLocalizedUrl` kullanarak URL'yi yerel ayar ile önekler (örneğin, /fr/hakkinda).
1323
+ * Bu, navigasyonun aynı yerel ayar bağlamında kalmasını sağlar.
1324
+ */
1325
+ export const Link: FC<PropsWithChildren<NextLinkProps>> = ({
1326
+ href,
1327
+ children,
1328
+ ...props
1329
+ }) => {
1330
+ const { locale } = useLocale();
1331
+ const isExternalLink = checkIsExternalLink(href.toString());
1332
+
1333
+ // Bağlantı dahili ise ve geçerli bir href sağlanmışsa, yerelleştirilmiş URL'yi alın.
1334
+ const hrefI18n: NextLinkProps["href"] =
1335
+ href && !isExternalLink ? getLocalizedUrl(href.toString(), locale) : href;
1336
+
1337
+ return (
1338
+ <NextLink href={hrefI18n} {...props}>
1339
+ {children}
1340
+ </NextLink>
1341
+ );
1342
+ };
1343
+ ```
1344
+
1345
+ ```jsx fileName="src/components/Link.mjx" codeFormat="esm"
1346
+ "use client";
1347
+
1348
+ import { getLocalizedUrl } from "intlayer";
1349
+ import NextLink from "next/link";
1350
+ import { useLocale } from "next-intlayer";
1351
+
1352
+ /**
1353
+ * Verilen bir URL'nin harici olup olmadığını kontrol eden yardımcı fonksiyon.
1354
+ * URL http:// veya https:// ile başlıyorsa, harici olarak kabul edilir.
1355
+ */
1356
+ export const checkIsExternalLink = (href) => /^https?:\/\//.test(href ?? "");
1357
+
1358
+ /**
1359
+ * Href özelliğini mevcut yerel ayar temelinde uyarlayan özel bir Link bileşeni.
1360
+ * Dahili bağlantılar için, `getLocalizedUrl` kullanarak URL'yi yerel ayar ile önekler (örneğin, /fr/hakkinda).
1361
+ * Bu, navigasyonun aynı yerel ayar bağlamında kalmasını sağlar.
1362
+ */
1363
+ export const Link = ({ href, children, ...props }) => {
1364
+ const { locale } = useLocale();
1365
+ const isExternalLink = checkIsExternalLink(href.toString());
1366
+
1367
+ // Bağlantı dahili ise ve geçerli bir href sağlanmışsa, yerelleştirilmiş URL'yi alın.
1368
+ const hrefI18n =
1369
+ href && !isExternalLink ? getLocalizedUrl(href.toString(), locale) : href;
1370
+
1371
+ return (
1372
+ <NextLink href={hrefI18n} {...props}>
1373
+ {children}
1374
+ </NextLink>
1375
+ );
1376
+ };
1377
+ ```
1378
+
1379
+ ```jsx fileName="src/components/Link.csx" codeFormat="commonjs"
1380
+ "use client";
1381
+
1382
+ const { getLocalizedUrl } = require("intlayer");
1383
+ const NextLink = require("next/link");
1384
+ const { useLocale } = require("next-intlayer");
1385
+
1386
+ /**
1387
+ * Verilen bir URL'nin harici olup olmadığını kontrol eden yardımcı fonksiyon.
1388
+ * URL http:// veya https:// ile başlıyorsa, harici olarak kabul edilir.
1389
+ */
1390
+ const checkIsExternalLink = (href) => /^https?:\/\//.test(href ?? "");
1391
+
1392
+ /**
1393
+ * Href özelliğini mevcut yerel ayar temelinde uyarlayan özel bir Link bileşeni.
1394
+ * Dahili bağlantılar için, `getLocalizedUrl` kullanarak URL'yi yerel ayar ile önekler (örneğin, /fr/hakkinda).
1395
+ * Bu, navigasyonun aynı yerel ayar bağlamında kalmasını sağlar.
1396
+ */
1397
+ const Link = ({ href, children, ...props }) => {
1398
+ const { locale } = useLocale();
1399
+ const isExternalLink = checkIsExternalLink(href.toString());
1400
+
1401
+ // Bağlantı dahili ise ve geçerli bir href sağlanmışsa, yerelleştirilmiş URL'yi alın.
1402
+ const hrefI18n =
1403
+ href && !isExternalLink ? getLocalizedUrl(href.toString(), locale) : href;
1404
+
1405
+ return (
1406
+ <NextLink href={hrefI18n} {...props}>
1407
+ {children}
1408
+ </NextLink>
1409
+ );
1410
+ };
1411
+ ```
1412
+
1413
+ #### Nasıl Çalışır
1414
+
1415
+ - **Harici Bağlantıları Algılama**:
1416
+ Yardımcı fonksiyon `checkIsExternalLink`, bir URL'nin harici olup olmadığını belirler. Harici bağlantılar değişmeden bırakılır çünkü yerelleştirmeye ihtiyaçları yoktur.
1417
+
1418
+ - **Mevcut Yerel Ayarı Alma**:
1419
+ `useLocale` kancası mevcut yerel ayarı sağlar (örneğin, Fransızca için `fr`).
1420
+
1421
+ - **URL'yi Yerelleştirme**:
1422
+ Dahili bağlantılar (yani harici olmayan) için, `getLocalizedUrl` kullanarak URL'yi otomatik olarak mevcut yerel ayar ile önekler. Bu, kullanıcınız Fransızca ise, `/hakkinda` href'ini geçmek onu `/fr/hakkinda`ya dönüştürür.
1423
+
1424
+ - **Bağlantıyı Döndürme**:
1425
+ Bileşen, yerelleştirilmiş URL ile bir `<a>` elementi döndürür, böylece navigasyon yerel ayar ile tutarlı olur.
1426
+
1427
+ Bu `Link` bileşenini uygulamanız boyunca entegre ederek, tutarlı ve dil bilincine sahip bir kullanıcı deneyimi sürdürürsünüzken aynı zamanda gelişmiş SEO ve kullanılabilirlikten de yararlanırsınız.
1428
+
1429
+ ### (İsteğe Bağlı) Adım 12: Paket Boyutunuzu Optimize Edin
1430
+
1431
+ `next-intlayer` kullanırken, sözlükler varsayılan olarak her sayfa için pakete dahil edilir. Paket boyutunu optimize etmek için, Intlayer isteğe bağlı bir SWC eklentisi sağlar ki bu, `useIntlayer` çağrılarını akıllıca makrolar kullanarak değiştirir. Bu, sözlüklerin sadece onları gerçekten kullanan sayfalar için paketlere dahil edilmesini sağlar.
1432
+
1433
+ Bu optimizasyonu etkinleştirmek için, `@intlayer/swc` paketini kurun. Kurulduktan sonra, `next-intlayer` eklentiyi otomatik olarak algılayacak ve kullanacaktır:
1434
+
1435
+ ```bash packageManager="npm"
1436
+ npm install @intlayer/swc --save-dev
1437
+ ```
1438
+
1439
+ ```bash packageManager="pnpm"
1440
+ pnpm add @intlayer/swc --save-dev
1441
+ ```
1442
+
1443
+ ```bash packageManager="yarn"
1444
+ yarn add @intlayer/swc --save-dev
1445
+ ```
1446
+
1447
+ > Not: Bu optimizasyon sadece Next.js 13 ve üzeri için kullanılabilir.
1448
+
1449
+ > Not: Bu paket varsayılan olarak kurulmaz çünkü SWC eklentileri Next.js'te hala deneyseldir. Gelecekte değişebilir.
1450
+
1451
+ ### TypeScript Yapılandırma
1452
+
1453
+ Intlayer, TypeScript'ten faydalanmak ve kod tabanınızı daha güçlü hale getirmek için modül genişletmesi kullanır.
1454
+
1455
+ ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1456
+
1457
+ ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1458
+
1459
+ TypeScript yapılandırmanızın otomatik olarak oluşturulan türleri içerdiğinden emin olun.
1460
+
1461
+ ```json5 fileName="tsconfig.json"
1462
+ {
1463
+ // ... Mevcut TypeScript yapılandırmalarınız
1464
+ "include": [
1465
+ // ... Mevcut TypeScript yapılandırmalarınız
1466
+ ".intlayer/**/*.ts", // Otomatik olarak oluşturulan türleri dahil edin
1467
+ ],
1468
+ }
1469
+ ```
1470
+
1471
+ ### Git Yapılandırma
1472
+
1473
+ Intlayer tarafından oluşturulan dosyaları yok saymanız önerilir. Bu, onları Git deposuna göndermemenizi sağlar.
1474
+
1475
+ Bunu yapmak için, `.gitignore` dosyanıza aşağıdaki talimatları ekleyebilirsiniz:
1476
+
1477
+ ```plaintext fileName=".gitignore"
1478
+ # Intlayer tarafından oluşturulan dosyaları yok say
1479
+ .intlayer
1480
+ ```
1481
+
1482
+ ### VS Code Uzantısı
1483
+
1484
+ Intlayer ile geliştirme deneyiminizi geliştirmek için, resmi **Intlayer VS Code Uzantısı**'nı kurabilirsiniz.
1485
+
1486
+ [VS Code Marketplace'ten Kurun](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
1487
+
1488
+ Bu uzantı şunları sağlar:
1489
+
1490
+ - **Çeviri anahtarları için otomatik tamamlama**.
1491
+ - **Eksik çeviriler için gerçek zamanlı hata algılama**.
1492
+ - **Çevrilmiş içeriğin satır içi önizlemeleri**.
1493
+ - **Çevirileri kolayca oluşturmak ve güncellemek için hızlı eylemler**.
1494
+
1495
+ Uzantının nasıl kullanılacağı hakkında daha fazla detay için, [Intlayer VS Code Uzantısı dokümantasyonu](https://intlayer.org/doc/vs-code-extension)na bakın.
1496
+
1497
+ ### Daha Fazla Bilgi Edinin
1498
+
1499
+ Daha fazla ilerlemek için, [görsel düzenleyici](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md)yi uygulayabilir veya içeriğinizi [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md) kullanarak harici hale getirebilirsiniz.
1500
+
1501
+ ## Dokümantasyon Geçmişi
1502
+
1503
+ | Sürüm | Tarih | Değişiklikler |
1504
+ | ------ | ---------- | ----------------------------------------------------------------- |
1505
+ | 5.6.0 | 2025-07-06 | `withIntlayer()` fonksiyonunu promise tabanlı fonksiyona dönüştür |
1506
+ | 5.5.10 | 2025-06-29 | Geçmişi başlat |