@intlayer/docs 7.5.10 → 7.5.12

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 (313) hide show
  1. package/blog/ar/intlayer_with_i18next.md +0 -2
  2. package/blog/ar/intlayer_with_next-i18next.md +0 -2
  3. package/blog/ar/intlayer_with_react-i18next.md +0 -2
  4. package/blog/de/intlayer_with_i18next.md +0 -45
  5. package/blog/de/intlayer_with_next-i18next.md +0 -46
  6. package/blog/de/intlayer_with_react-i18next.md +0 -2
  7. package/blog/en/intlayer_with_i18next.md +0 -46
  8. package/blog/en/intlayer_with_next-i18next.md +0 -48
  9. package/blog/en/intlayer_with_next-intl.md +0 -44
  10. package/blog/en/intlayer_with_react-i18next.md +0 -44
  11. package/blog/en/intlayer_with_react-intl.md +0 -42
  12. package/blog/en/intlayer_with_vue-i18n.md +0 -44
  13. package/blog/en-GB/intlayer_with_i18next.md +0 -45
  14. package/blog/en-GB/intlayer_with_next-i18next.md +0 -47
  15. package/blog/en-GB/intlayer_with_next-intl.md +0 -42
  16. package/blog/en-GB/intlayer_with_react-i18next.md +0 -43
  17. package/blog/en-GB/intlayer_with_react-intl.md +0 -42
  18. package/blog/en-GB/intlayer_with_vue-i18n.md +0 -46
  19. package/blog/es/intlayer_with_i18next.md +0 -45
  20. package/blog/es/intlayer_with_next-i18next.md +0 -47
  21. package/blog/es/intlayer_with_next-intl.md +0 -42
  22. package/blog/es/intlayer_with_react-i18next.md +0 -43
  23. package/blog/es/intlayer_with_react-intl.md +0 -42
  24. package/blog/es/intlayer_with_vue-i18n.md +0 -46
  25. package/blog/fr/intlayer_with_i18next.md +0 -45
  26. package/blog/fr/intlayer_with_next-i18next.md +0 -47
  27. package/blog/fr/intlayer_with_next-intl.md +0 -42
  28. package/blog/fr/intlayer_with_react-i18next.md +0 -43
  29. package/blog/fr/intlayer_with_react-intl.md +0 -42
  30. package/blog/fr/intlayer_with_vue-i18n.md +0 -46
  31. package/blog/hi/intlayer_with_i18next.md +0 -2
  32. package/blog/hi/intlayer_with_next-i18next.md +0 -2
  33. package/blog/hi/intlayer_with_react-i18next.md +0 -2
  34. package/blog/id/intlayer_with_i18next.md +0 -2
  35. package/blog/id/intlayer_with_next-i18next.md +0 -2
  36. package/blog/id/intlayer_with_react-i18next.md +0 -2
  37. package/blog/it/intlayer_with_i18next.md +0 -2
  38. package/blog/it/intlayer_with_next-i18next.md +0 -2
  39. package/blog/it/intlayer_with_react-i18next.md +0 -2
  40. package/blog/ja/intlayer_with_i18next.md +0 -45
  41. package/blog/ja/intlayer_with_next-i18next.md +0 -46
  42. package/blog/ja/intlayer_with_next-intl.md +0 -42
  43. package/blog/ja/intlayer_with_react-i18next.md +0 -42
  44. package/blog/ja/intlayer_with_react-intl.md +0 -42
  45. package/blog/ja/intlayer_with_vue-i18n.md +0 -46
  46. package/blog/ko/intlayer_with_i18next.md +0 -2
  47. package/blog/ko/intlayer_with_next-i18next.md +0 -2
  48. package/blog/ko/intlayer_with_react-i18next.md +0 -1
  49. package/blog/pl/intlayer_with_i18next.md +0 -45
  50. package/blog/pl/intlayer_with_next-i18next.md +0 -46
  51. package/blog/pl/intlayer_with_next-intl.md +0 -42
  52. package/blog/pl/intlayer_with_react-i18next.md +0 -43
  53. package/blog/pl/intlayer_with_react-intl.md +0 -42
  54. package/blog/pl/intlayer_with_vue-i18n.md +0 -46
  55. package/blog/pt/intlayer_with_i18next.md +0 -2
  56. package/blog/pt/intlayer_with_next-i18next.md +0 -2
  57. package/blog/pt/intlayer_with_react-i18next.md +0 -2
  58. package/blog/ru/intlayer_with_i18next.md +0 -45
  59. package/blog/ru/intlayer_with_next-i18next.md +0 -47
  60. package/blog/ru/intlayer_with_next-intl.md +0 -42
  61. package/blog/ru/intlayer_with_react-i18next.md +0 -43
  62. package/blog/ru/intlayer_with_react-intl.md +0 -42
  63. package/blog/ru/intlayer_with_vue-i18n.md +0 -46
  64. package/blog/tr/intlayer_with_i18next.md +0 -2
  65. package/blog/tr/intlayer_with_next-i18next.md +0 -1
  66. package/blog/tr/intlayer_with_react-i18next.md +0 -2
  67. package/blog/vi/intlayer_with_i18next.md +0 -2
  68. package/blog/vi/intlayer_with_next-i18next.md +0 -2
  69. package/blog/vi/intlayer_with_react-i18next.md +0 -2
  70. package/blog/zh/intlayer_with_i18next.md +0 -2
  71. package/blog/zh/intlayer_with_next-i18next.md +0 -2
  72. package/blog/zh/intlayer_with_react-i18next.md +0 -2
  73. package/blog/zh/intlayer_with_vue-i18n.md +0 -46
  74. package/dist/cjs/generated/blog.entry.cjs +58 -29
  75. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  76. package/dist/cjs/generated/docs.entry.cjs +254 -97
  77. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  78. package/dist/cjs/generated/frequentQuestions.entry.cjs +30 -15
  79. package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
  80. package/dist/cjs/generated/legal.entry.cjs +4 -2
  81. package/dist/cjs/generated/legal.entry.cjs.map +1 -1
  82. package/dist/esm/generated/blog.entry.mjs +58 -29
  83. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  84. package/dist/esm/generated/docs.entry.mjs +254 -97
  85. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  86. package/dist/esm/generated/frequentQuestions.entry.mjs +30 -15
  87. package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
  88. package/dist/esm/generated/legal.entry.mjs +4 -2
  89. package/dist/esm/generated/legal.entry.mjs.map +1 -1
  90. package/dist/types/generated/blog.entry.d.ts.map +1 -1
  91. package/dist/types/generated/docs.entry.d.ts +3 -0
  92. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  93. package/dist/types/generated/frequentQuestions.entry.d.ts.map +1 -1
  94. package/dist/types/generated/legal.entry.d.ts.map +1 -1
  95. package/docs/ar/cli/ci.md +137 -0
  96. package/docs/ar/cli/index.md +7 -1
  97. package/docs/ar/cli/list.md +39 -2
  98. package/docs/ar/cli/list_projects.md +131 -0
  99. package/docs/ar/intlayer_CMS.md +20 -0
  100. package/docs/ar/intlayer_with_next-i18next.md +0 -1
  101. package/docs/ar/intlayer_with_nextjs_14.md +28 -0
  102. package/docs/ar/intlayer_with_nextjs_15.md +28 -0
  103. package/docs/ar/intlayer_with_nextjs_16.md +28 -0
  104. package/docs/ar/intlayer_with_nextjs_no_locale_path.md +1159 -0
  105. package/docs/ar/plugins/sync-json.md +6 -2
  106. package/docs/de/cli/ci.md +137 -0
  107. package/docs/de/cli/index.md +7 -1
  108. package/docs/de/cli/list.md +39 -2
  109. package/docs/de/cli/list_projects.md +130 -0
  110. package/docs/de/intlayer_CMS.md +20 -0
  111. package/docs/de/intlayer_with_next-i18next.md +0 -1
  112. package/docs/de/intlayer_with_nextjs_14.md +28 -0
  113. package/docs/de/intlayer_with_nextjs_15.md +28 -0
  114. package/docs/de/intlayer_with_nextjs_16.md +28 -0
  115. package/docs/de/intlayer_with_nextjs_no_locale_path.md +1152 -0
  116. package/docs/de/plugins/sync-json.md +6 -2
  117. package/docs/en/cli/ci.md +137 -0
  118. package/docs/en/cli/index.md +14 -1
  119. package/docs/en/cli/list.md +39 -2
  120. package/docs/en/cli/list_projects.md +128 -0
  121. package/docs/en/interest_of_intlayer.md +1 -1
  122. package/docs/en/intlayer_CMS.md +20 -0
  123. package/docs/en/intlayer_with_next-i18next.md +0 -1
  124. package/docs/en/intlayer_with_nextjs_14.md +28 -0
  125. package/docs/en/intlayer_with_nextjs_15.md +28 -0
  126. package/docs/en/intlayer_with_nextjs_16.md +31 -1
  127. package/docs/en/intlayer_with_nextjs_no_locale_path.md +1132 -0
  128. package/docs/en/plugins/sync-json.md +6 -2
  129. package/docs/en-GB/cli/ci.md +137 -0
  130. package/docs/en-GB/cli/index.md +7 -1
  131. package/docs/en-GB/cli/list.md +39 -2
  132. package/docs/en-GB/cli/list_projects.md +130 -0
  133. package/docs/en-GB/intlayer_CMS.md +20 -0
  134. package/docs/en-GB/intlayer_with_next-i18next.md +0 -1
  135. package/docs/en-GB/intlayer_with_nextjs_14.md +28 -0
  136. package/docs/en-GB/intlayer_with_nextjs_15.md +28 -0
  137. package/docs/en-GB/intlayer_with_nextjs_16.md +28 -0
  138. package/docs/en-GB/intlayer_with_nextjs_no_locale_path.md +1154 -0
  139. package/docs/en-GB/plugins/sync-json.md +6 -2
  140. package/docs/es/cli/ci.md +137 -0
  141. package/docs/es/cli/index.md +7 -1
  142. package/docs/es/cli/list.md +39 -2
  143. package/docs/es/cli/list_projects.md +130 -0
  144. package/docs/es/intlayer_CMS.md +20 -0
  145. package/docs/es/intlayer_with_next-i18next.md +0 -1
  146. package/docs/es/intlayer_with_nextjs_14.md +28 -0
  147. package/docs/es/intlayer_with_nextjs_15.md +28 -0
  148. package/docs/es/intlayer_with_nextjs_16.md +28 -0
  149. package/docs/es/intlayer_with_nextjs_no_locale_path.md +1143 -0
  150. package/docs/es/plugins/sync-json.md +6 -2
  151. package/docs/fr/cli/ci.md +137 -0
  152. package/docs/fr/cli/index.md +7 -1
  153. package/docs/fr/cli/list.md +39 -2
  154. package/docs/fr/cli/list_projects.md +131 -0
  155. package/docs/fr/intlayer_CMS.md +20 -0
  156. package/docs/fr/intlayer_with_next-i18next.md +0 -1
  157. package/docs/fr/intlayer_with_nextjs_14.md +28 -0
  158. package/docs/fr/intlayer_with_nextjs_15.md +28 -0
  159. package/docs/fr/intlayer_with_nextjs_16.md +28 -0
  160. package/docs/fr/intlayer_with_nextjs_no_locale_path.md +1174 -0
  161. package/docs/fr/plugins/sync-json.md +9 -5
  162. package/docs/hi/cli/ci.md +137 -0
  163. package/docs/hi/cli/index.md +7 -1
  164. package/docs/hi/cli/list.md +38 -1
  165. package/docs/hi/cli/list_projects.md +130 -0
  166. package/docs/hi/intlayer_CMS.md +20 -0
  167. package/docs/hi/intlayer_with_next-i18next.md +0 -1
  168. package/docs/hi/intlayer_with_nextjs_14.md +28 -0
  169. package/docs/hi/intlayer_with_nextjs_15.md +28 -0
  170. package/docs/hi/intlayer_with_nextjs_16.md +28 -0
  171. package/docs/hi/intlayer_with_nextjs_no_locale_path.md +1151 -0
  172. package/docs/hi/plugins/sync-json.md +6 -2
  173. package/docs/id/cli/ci.md +137 -0
  174. package/docs/id/cli/index.md +7 -1
  175. package/docs/id/cli/list.md +38 -1
  176. package/docs/id/cli/list_projects.md +128 -0
  177. package/docs/id/intlayer_CMS.md +20 -0
  178. package/docs/id/intlayer_with_next-i18next.md +0 -1
  179. package/docs/id/intlayer_with_nextjs_14.md +28 -0
  180. package/docs/id/intlayer_with_nextjs_15.md +28 -0
  181. package/docs/id/intlayer_with_nextjs_16.md +28 -0
  182. package/docs/id/intlayer_with_nextjs_no_locale_path.md +1154 -0
  183. package/docs/id/plugins/sync-json.md +6 -2
  184. package/docs/it/cli/ci.md +137 -0
  185. package/docs/it/cli/index.md +7 -1
  186. package/docs/it/cli/list.md +39 -2
  187. package/docs/it/cli/list_projects.md +130 -0
  188. package/docs/it/intlayer_CMS.md +20 -0
  189. package/docs/it/intlayer_with_next-i18next.md +0 -1
  190. package/docs/it/intlayer_with_nextjs_14.md +28 -0
  191. package/docs/it/intlayer_with_nextjs_15.md +28 -0
  192. package/docs/it/intlayer_with_nextjs_16.md +28 -0
  193. package/docs/it/intlayer_with_nextjs_no_locale_path.md +1148 -0
  194. package/docs/it/plugins/sync-json.md +6 -2
  195. package/docs/ja/cli/ci.md +137 -0
  196. package/docs/ja/cli/index.md +7 -1
  197. package/docs/ja/cli/list.md +38 -1
  198. package/docs/ja/cli/list_projects.md +136 -0
  199. package/docs/ja/intlayer_CMS.md +20 -0
  200. package/docs/ja/intlayer_with_next-i18next.md +0 -1
  201. package/docs/ja/intlayer_with_nextjs_14.md +28 -0
  202. package/docs/ja/intlayer_with_nextjs_15.md +28 -0
  203. package/docs/ja/intlayer_with_nextjs_16.md +28 -0
  204. package/docs/ja/intlayer_with_nextjs_no_locale_path.md +1222 -0
  205. package/docs/ja/plugins/sync-json.md +6 -2
  206. package/docs/ko/cli/ci.md +137 -0
  207. package/docs/ko/cli/index.md +7 -1
  208. package/docs/ko/cli/list.md +38 -1
  209. package/docs/ko/cli/list_projects.md +128 -0
  210. package/docs/ko/intlayer_CMS.md +20 -0
  211. package/docs/ko/intlayer_with_next-i18next.md +0 -1
  212. package/docs/ko/intlayer_with_nextjs_14.md +28 -0
  213. package/docs/ko/intlayer_with_nextjs_15.md +28 -0
  214. package/docs/ko/intlayer_with_nextjs_16.md +28 -0
  215. package/docs/ko/intlayer_with_nextjs_no_locale_path.md +1205 -0
  216. package/docs/ko/plugins/sync-json.md +6 -2
  217. package/docs/pl/cli/ci.md +137 -0
  218. package/docs/pl/cli/index.md +7 -1
  219. package/docs/pl/cli/list.md +39 -2
  220. package/docs/pl/cli/list_projects.md +130 -0
  221. package/docs/pl/intlayer_CMS.md +20 -0
  222. package/docs/pl/intlayer_with_next-i18next.md +0 -1
  223. package/docs/pl/intlayer_with_nextjs_14.md +28 -0
  224. package/docs/pl/intlayer_with_nextjs_15.md +28 -0
  225. package/docs/pl/intlayer_with_nextjs_16.md +28 -0
  226. package/docs/pl/intlayer_with_nextjs_no_locale_path.md +1149 -0
  227. package/docs/pl/plugins/sync-json.md +6 -2
  228. package/docs/pt/cli/ci.md +137 -0
  229. package/docs/pt/cli/index.md +7 -1
  230. package/docs/pt/cli/list.md +39 -2
  231. package/docs/pt/cli/list_projects.md +134 -0
  232. package/docs/pt/intlayer_CMS.md +20 -0
  233. package/docs/pt/intlayer_with_next-i18next.md +0 -1
  234. package/docs/pt/intlayer_with_nextjs_14.md +28 -0
  235. package/docs/pt/intlayer_with_nextjs_15.md +28 -0
  236. package/docs/pt/intlayer_with_nextjs_16.md +28 -0
  237. package/docs/pt/intlayer_with_nextjs_no_locale_path.md +1152 -0
  238. package/docs/pt/plugins/sync-json.md +6 -2
  239. package/docs/ru/cli/ci.md +137 -0
  240. package/docs/ru/cli/index.md +7 -1
  241. package/docs/ru/cli/list.md +39 -2
  242. package/docs/ru/cli/list_projects.md +130 -0
  243. package/docs/ru/intlayer_CMS.md +20 -0
  244. package/docs/ru/intlayer_with_next-i18next.md +0 -1
  245. package/docs/ru/intlayer_with_nextjs_14.md +28 -0
  246. package/docs/ru/intlayer_with_nextjs_15.md +28 -0
  247. package/docs/ru/intlayer_with_nextjs_16.md +28 -0
  248. package/docs/ru/intlayer_with_nextjs_no_locale_path.md +1204 -0
  249. package/docs/ru/plugins/sync-json.md +6 -2
  250. package/docs/tr/cli/ci.md +137 -0
  251. package/docs/tr/cli/index.md +7 -1
  252. package/docs/tr/cli/list.md +39 -2
  253. package/docs/tr/cli/list_projects.md +134 -0
  254. package/docs/tr/intlayer_CMS.md +20 -0
  255. package/docs/tr/intlayer_with_next-i18next.md +0 -1
  256. package/docs/tr/intlayer_with_nextjs_14.md +28 -0
  257. package/docs/tr/intlayer_with_nextjs_15.md +28 -0
  258. package/docs/tr/intlayer_with_nextjs_16.md +28 -0
  259. package/docs/tr/intlayer_with_nextjs_no_locale_path.md +1159 -0
  260. package/docs/tr/plugins/sync-json.md +6 -2
  261. package/docs/uk/compiler.md +133 -0
  262. package/docs/uk/component_i18n.md +194 -0
  263. package/docs/uk/intlayer_with_nextjs_14.md +1646 -0
  264. package/docs/uk/intlayer_with_nextjs_15.md +1910 -0
  265. package/docs/uk/intlayer_with_nextjs_16.md +1763 -0
  266. package/docs/uk/intlayer_with_nextjs_no_locale_path.md +1159 -0
  267. package/docs/uk/intlayer_with_react_native+expo.md +715 -0
  268. package/docs/uk/packages/intlayer/getConfiguration.md +145 -0
  269. package/docs/uk/vs_code_extension.md +133 -0
  270. package/docs/vi/cli/ci.md +137 -0
  271. package/docs/vi/cli/index.md +7 -1
  272. package/docs/vi/cli/list.md +38 -1
  273. package/docs/vi/cli/list_projects.md +130 -0
  274. package/docs/vi/intlayer_CMS.md +20 -0
  275. package/docs/vi/intlayer_with_next-i18next.md +0 -1
  276. package/docs/vi/intlayer_with_nextjs_14.md +28 -0
  277. package/docs/vi/intlayer_with_nextjs_15.md +28 -0
  278. package/docs/vi/intlayer_with_nextjs_16.md +28 -0
  279. package/docs/vi/intlayer_with_nextjs_no_locale_path.md +1151 -0
  280. package/docs/vi/plugins/sync-json.md +6 -2
  281. package/docs/zh/cli/ci.md +137 -0
  282. package/docs/zh/cli/index.md +7 -1
  283. package/docs/zh/cli/list.md +38 -1
  284. package/docs/zh/cli/list_projects.md +130 -0
  285. package/docs/zh/intlayer_CMS.md +20 -0
  286. package/docs/zh/intlayer_with_next-i18next.md +0 -1
  287. package/docs/zh/intlayer_with_nextjs_14.md +28 -0
  288. package/docs/zh/intlayer_with_nextjs_15.md +28 -0
  289. package/docs/zh/intlayer_with_nextjs_16.md +28 -0
  290. package/docs/zh/intlayer_with_nextjs_no_locale_path.md +1206 -0
  291. package/docs/zh/plugins/sync-json.md +9 -5
  292. package/frequent_questions/ar/SSR_Next_no_[locale].md +1 -1
  293. package/frequent_questions/de/SSR_Next_no_[locale].md +1 -1
  294. package/frequent_questions/en/SSR_Next_no_[locale].md +1 -1
  295. package/frequent_questions/en-GB/SSR_Next_no_[locale].md +1 -1
  296. package/frequent_questions/es/SSR_Next_no_[locale].md +1 -1
  297. package/frequent_questions/fr/SSR_Next_no_[locale].md +1 -1
  298. package/frequent_questions/hi/SSR_Next_no_[locale].md +1 -1
  299. package/frequent_questions/id/SSR_Next_no_[locale].md +1 -1
  300. package/frequent_questions/it/SSR_Next_no_[locale].md +1 -1
  301. package/frequent_questions/ja/SSR_Next_no_[locale].md +1 -1
  302. package/frequent_questions/ko/SSR_Next_no_[locale].md +1 -1
  303. package/frequent_questions/pl/SSR_Next_no_[locale].md +1 -1
  304. package/frequent_questions/pt/SSR_Next_no_[locale].md +1 -1
  305. package/frequent_questions/ru/SSR_Next_no_[locale].md +1 -1
  306. package/frequent_questions/tr/SSR_Next_no_[locale].md +1 -1
  307. package/frequent_questions/vi/SSR_Next_no_[locale].md +1 -1
  308. package/frequent_questions/zh/SSR_Next_no_[locale].md +1 -1
  309. package/package.json +6 -6
  310. package/src/generated/blog.entry.ts +29 -0
  311. package/src/generated/docs.entry.ts +157 -0
  312. package/src/generated/frequentQuestions.entry.ts +15 -0
  313. package/src/generated/legal.entry.ts +2 -0
@@ -0,0 +1,1204 @@
1
+ ---
2
+ createdAt: 2026-01-10
3
+ updatedAt: 2026-01-10
4
+ title: Как перевести ваше приложение Next.js 16 (без [locale] в пути страницы) — руководство по i18n 2026
5
+ description: Узнайте, как сделать ваш сайт на Next.js 16 многоязычным без [locale] в пути страницы. Следуйте документации, чтобы выполнить интернационализацию (i18n) и перевести его.
6
+ keywords:
7
+ - Интернационализация
8
+ - Документация
9
+ - Intlayer
10
+ - Next.js 16
11
+ - JavaScript
12
+ - React
13
+ slugs:
14
+ - doc
15
+ - environment
16
+ - nextjs
17
+ - no-locale-path
18
+ applicationTemplate: https://github.com/aymericzip/intlayer-next-no-lolale-path-template
19
+ youtubeVideo: https://www.youtube.com/watch?v=e_PPG7PTqGU
20
+ history:
21
+ - version: 1.0.0
22
+ date: 2026-01-10
23
+ changes: Первоначальный релиз
24
+ ---
25
+
26
+ # Переведите ваш сайт Next.js 16 (без [locale] в пути страницы) с помощью Intlayer | Интернационализация (i18n)
27
+
28
+ <Tab defaultTab="video">
29
+ <TabItem label="Видео" value="video">
30
+
31
+ <iframe title="Лучшее i18n-решение для Next.js? Узнайте об Intlayer" class="m-auto aspect-16/9 w-full overflow-hidden rounded-lg border-0" allow="autoplay; gyroscope;" loading="lazy" width="1080" height="auto" src="https://www.youtube.com/embed/e_PPG7PTqGU?autoplay=0&amp;origin=http://intlayer.org&amp;controls=0&amp;rel=1"/>
32
+
33
+ </TabItem>
34
+ <TabItem label="Код" value="code">
35
+
36
+ <iframe
37
+ src="https://stackblitz.com/github/aymericzip/intlayer-next-16-no-locale-path-template?embed=1&ctl=1&file=intlayer.config.ts"
38
+ className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
39
+ title="Демо CodeSandbox - Как интернационализировать ваше приложение с помощью Intlayer"
40
+ sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
41
+ loading="lazy"
42
+ />
43
+
44
+ </TabItem>
45
+ </Tab>
46
+
47
+ Смотрите [шаблон приложения](https://github.com/aymericzip/intlayer-next-no-lolale-path-template) на GitHub.
48
+
49
+ ## Содержание
50
+
51
+ <TOC/>
52
+
53
+ ## Что такое Intlayer?
54
+
55
+ **Intlayer** — это инновационная, открытая библиотека для интернационализации (i18n), созданная для упрощения поддержки нескольких языков в современных веб-приложениях. Intlayer бесшовно интегрируется с последним фреймворком **Next.js 16**, включая его мощный **App Router**. Он оптимизирован для работы с **Server Components** для эффективного рендеринга и полностью совместим с [**Turbopack**](https://nextjs.org/docs/architecture/turbopack).
56
+
57
+ С Intlayer вы можете:
58
+
59
+ - **Легко управлять переводами** с помощью декларативных словарей на уровне компонентов.
60
+ - **Динамически локализовать метаданные**, маршруты и контент.
61
+ - **Получать доступ к переводам как в клиентских, так и в серверных компонентах**.
62
+ - **Обеспечить поддержку TypeScript** с автогенерируемыми типами, улучшающими автодополнение и обнаружение ошибок.
63
+ - **Воспользуйтесь продвинутыми возможностями**, такими как динамическое определение локали и её переключение.
64
+
65
+ > Intlayer совместим с Next.js 12, 13, 14 и 16. Если вы используете Next.js Page Router, вы можете обратиться к этому [руководству](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/intlayer_with_nextjs_page_router.md). Для Next.js 12, 13, 14 с App Router — см. это [руководство](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/intlayer_with_nextjs_14.md).
66
+
67
+ ---
68
+
69
+ ## Пошаговое руководство по настройке Intlayer в приложении Next.js
70
+
71
+ ### Шаг 1: Установка зависимостей
72
+
73
+ Установите необходимые пакеты с помощью npm:
74
+
75
+ ```bash packageManager="npm"
76
+ npm install intlayer next-intlayer
77
+ npx intlayer init
78
+ ```
79
+
80
+ ```bash packageManager="pnpm"
81
+ pnpm add intlayer next-intlayer
82
+ pnpm intlayer init
83
+ ```
84
+
85
+ ```bash packageManager="yarn"
86
+ yarn add intlayer next-intlayer
87
+ yarn intlayer init
88
+ ```
89
+
90
+ ```bash packageManager="bun"
91
+ bun add intlayer next-intlayer
92
+ bunx intlayer init
93
+ ```
94
+
95
+ - **intlayer**
96
+
97
+ Основной пакет, предоставляющий инструменты интернационализации для управления конфигурацией, переводов, [декларации контента](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/dictionary/content_file.md), транспиляции и [команд CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/cli/index.md).
98
+
99
+ - **next-intlayer**
100
+
101
+ Пакет, который интегрирует Intlayer с Next.js. Он предоставляет context providers и хуки для интернационализации в Next.js. Дополнительно он включает плагин Next.js для интеграции Intlayer с [Webpack](https://webpack.js.org/) или [Turbopack](https://nextjs.org/docs/app/api-reference/turbopack), а также прокси для определения предпочтительной локали пользователя, управления cookies и обработки перенаправлений URL.
102
+
103
+ ### Шаг 2: Настройка вашего проекта
104
+
105
+ Ниже приведена итоговая структура, которую мы получим:
106
+
107
+ ```bash
108
+ .
109
+ ├── src
110
+ │ ├── app
111
+ │ │ ├── layout.tsx
112
+ │ │ ├── page.content.ts
113
+ │ │ └── page.tsx
114
+ │ ├── components
115
+ │ │ ├── clientComponentExample
116
+ │ │ │ ├── client-component-example.content.ts
117
+ │ │ │ └── ClientComponentExample.tsx
118
+ │ │ ├── localeSwitcher
119
+ │ │ │ ├── localeSwitcher.content.ts
120
+ │ │ │ └── LocaleSwitcher.tsx
121
+ │ │ └── serverComponentExample
122
+ │ │ ├── server-component-example.content.ts
123
+ │ │ └── ServerComponentExample.tsx
124
+ │ └── proxy.ts
125
+ ├── intlayer.config.ts
126
+ ├── next.config.ts
127
+ ├── package.json
128
+ └── tsconfig.json
129
+ ```
130
+
131
+ > Если вы не хотите маршрутизацию по локалям, intlayer можно использовать как простой provider / hook. См. [это руководство](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/intlayer_with_nextjs_no_locale_path.md) для получения дополнительных сведений.
132
+
133
+ Создайте файл конфигурации для настройки языков вашего приложения:
134
+
135
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
136
+ import { Locales, type IntlayerConfig } from "intlayer";
137
+
138
+ const config: IntlayerConfig = {
139
+ internationalization: {
140
+ locales: [
141
+ Locales.ENGLISH,
142
+ Locales.FRENCH,
143
+ Locales.SPANISH,
144
+ // Ваши другие локали
145
+ ],
146
+ defaultLocale: Locales.ENGLISH,
147
+ },
148
+ routing: {
149
+ mode: "search-params", // или `no-prefix` — полезно для обнаружения в middleware
150
+ },
151
+ };
152
+
153
+ export default config;
154
+ ```
155
+
156
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
157
+ import { Locales } from "intlayer";
158
+
159
+ /** @type {import('intlayer').IntlayerConfig} */
160
+ const config = {
161
+ internationalization: {
162
+ locales: [
163
+ Locales.ENGLISH,
164
+ Locales.FRENCH,
165
+ Locales.SPANISH,
166
+ // Ваши другие локали
167
+ ],
168
+ defaultLocale: Locales.ENGLISH,
169
+ },
170
+ routing: {
171
+ mode: "search-params", // или `no-prefix` — полезно для обнаружения в middleware
172
+ },
173
+ };
174
+
175
+ export default config;
176
+ ```
177
+
178
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
179
+ const { Locales } = require("intlayer");
180
+
181
+ /** @type {import('intlayer').IntlayerConfig} */
182
+ const config = {
183
+ internationalization: {
184
+ locales: [
185
+ Locales.ENGLISH,
186
+ Locales.FRENCH,
187
+ Locales.SPANISH,
188
+ // Ваши другие локали
189
+ ],
190
+ defaultLocale: Locales.ENGLISH,
191
+ },
192
+ routing: {
193
+ mode: "search-params", // или `no-prefix` — полезно для обнаружения в middleware
194
+ },
195
+ };
196
+
197
+ module.exports = config;
198
+ ```
199
+
200
+ > С помощью этого файла конфигурации вы можете настроить локализованные URL, перенаправление через прокси, имена cookie, расположение и расширение ваших деклараций контента, отключить логи Intlayer в консоли и многое другое. Для полного списка доступных параметров см. [документацию по конфигурации](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/configuration.md).
201
+
202
+ ### Шаг 3: Интеграция Intlayer в конфигурацию Next.js
203
+
204
+ Настройте ваш проект Next.js для использования Intlayer:
205
+
206
+ ```typescript fileName="next.config.ts" codeFormat="typescript"
207
+ import type { NextConfig } from "next";
208
+ import { withIntlayer } from "next-intlayer/server";
209
+
210
+ const nextConfig: NextConfig = {
211
+ /* параметры конфигурации здесь */
212
+ };
213
+
214
+ export default withIntlayer(nextConfig);
215
+ ```
216
+
217
+ ```typescript fileName="next.config.mjs" codeFormat="esm"
218
+ import { withIntlayer } from "next-intlayer/server";
219
+
220
+ /** @type {import('next').NextConfig} */
221
+ const nextConfig = {
222
+ /* параметры конфигурации здесь */
223
+ };
224
+
225
+ export default withIntlayer(nextConfig);
226
+ ```
227
+
228
+ ```typescript fileName="next.config.cjs" codeFormat="commonjs"
229
+ const { withIntlayer } = require("next-intlayer/server");
230
+
231
+ /** @type {import('next').NextConfig} */
232
+ const nextConfig = {
233
+ /* параметры конфигурации здесь */
234
+ };
235
+
236
+ module.exports = withIntlayer(nextConfig);
237
+ ```
238
+
239
+ > Плагин Next.js `withIntlayer()` используется для интеграции Intlayer с Next.js. Он обеспечивает генерацию файлов декларации контента и их отслеживание в режиме разработки. Он определяет переменные окружения Intlayer внутри сред [Webpack](https://webpack.js.org/) или [Turbopack](https://nextjs.org/docs/app/api-reference/turbopack). Дополнительно он предоставляет алиасы для оптимизации производительности и обеспечивает совместимость с серверными компонентами.
240
+ >
241
+ > Функция `withIntlayer()` возвращает Promise. Она позволяет подготовить словари intlayer перед началом сборки. Если вы хотите использовать её вместе с другими плагинами, вы можете дождаться её выполнения с помощью await. Пример:
242
+ >
243
+ > ```ts
244
+ > const nextConfig = await withIntlayer(nextConfig);
245
+ > const nextConfigWithOtherPlugins = withOtherPlugins(nextConfig);
246
+ >
247
+ > export default nextConfigWithOtherPlugins;
248
+ > ```
249
+ >
250
+ > Если вы хотите использовать его синхронно, вы можете воспользоваться функцией `withIntlayerSync()`. Пример:
251
+ >
252
+ > ```ts
253
+ > const nextConfig = withIntlayerSync(nextConfig);
254
+ > const nextConfigWithOtherPlugins = withOtherPlugins(nextConfig);
255
+ >
256
+ > export default nextConfigWithOtherPlugins;
257
+ > ```
258
+ >
259
+ > Intlayer автоматически определяет, использует ли ваш проект **webpack** или **Turbopack** на основе флагов командной строки `--webpack`, `--turbo` или `--turbopack`, а также вашей текущей версии **Next.js**.
260
+ >
261
+ > Поскольку `next>=16`, если вы используете **Rspack**, вы должны явно заставить Intlayer использовать конфигурацию webpack, отключив Turbopack:
262
+ >
263
+ > ```ts
264
+ > withRspack(withIntlayer(nextConfig, { enableTurbopack: false }));
265
+ > ```
266
+
267
+ ### Шаг 4: Определение динамических маршрутов локализации
268
+
269
+ Удалите всё из `RootLayout` и замените его следующим кодом:
270
+
271
+ ```tsx {3} fileName="src/app/layout.tsx" codeFormat="typescript"
272
+ import type { Metadata } from "next";
273
+ import type { ReactNode } from "react";
274
+ import "./globals.css";
275
+ import { IntlayerClientProvider, LocalPromiseParams } from "next-intlayer";
276
+ import { getHTMLTextDir, getIntlayer } from "intlayer";
277
+ import { getLocale } from "next-intlayer/server";
278
+ export { generateStaticParams } from "next-intlayer";
279
+
280
+ export const generateMetadata = async ({
281
+ params,
282
+ }: LocalPromiseParams): Promise<Metadata> => {
283
+ const { locale } = await params;
284
+ const { title, description, keywords } = getIntlayer("metadata", locale);
285
+
286
+ return {
287
+ title,
288
+ description,
289
+ keywords,
290
+ };
291
+ };
292
+
293
+ const RootLayout = async ({
294
+ children,
295
+ }: Readonly<{
296
+ children: ReactNode;
297
+ }>) => {
298
+ const locale = await getLocale();
299
+
300
+ return (
301
+ <html lang={locale} dir={getHTMLTextDir(locale)}>
302
+ <IntlayerClientProvider defaultLocale={locale}>
303
+ <body>{children}</body>
304
+ </IntlayerClientProvider>
305
+ </html>
306
+ );
307
+ };
308
+
309
+ export default RootLayout;
310
+ ```
311
+
312
+ ```jsx {3} fileName="src/app/layout.mjx" codeFormat="esm"
313
+ import "./globals.css";
314
+ import { IntlayerClientProvider } from "next-intlayer";
315
+ import { getHTMLTextDir, getIntlayer } from "intlayer";
316
+ import { getLocale } from "next-intlayer/server";
317
+ import { headers, cookies } from "next/headers";
318
+ export { generateStaticParams } from "next-intlayer";
319
+
320
+ export const generateMetadata = async ({ params }) => {
321
+ const { locale } = await params;
322
+ const { title, description, keywords } = getIntlayer("metadata", locale);
323
+
324
+ return {
325
+ title,
326
+ description,
327
+ keywords,
328
+ };
329
+ };
330
+
331
+ const RootLayout = async ({ children }) => {
332
+ // Ожидание headers и cookies в Next.js 15+
333
+ const headerList = await headers();
334
+ const cookieList = await cookies();
335
+
336
+ const locale = await getLocale({
337
+ // Сначала проверяет cookie intlayer (по умолчанию: 'INTLAYER_LOCALE')
338
+ getCookie: (name) => cookieList.get(name)?.value,
339
+
340
+ // Затем проверяет header intlayer (по умолчанию: 'x-intlayer-locale')
341
+ // И, наконец, проверить заголовок accept-language ('accept-language')
342
+ getHeader: (name) => headerList.get(name),
343
+ });
344
+
345
+ return (
346
+ <html lang={locale} dir={getHTMLTextDir(locale)}>
347
+ <IntlayerClientProvider defaultLocale={locale}>
348
+ <body>{children}</body>
349
+ </IntlayerClientProvider>
350
+ </html>
351
+ );
352
+ };
353
+
354
+ export default RootLayout;
355
+ ```
356
+
357
+ ```jsx {1,8} fileName="src/app/layout.csx" codeFormat="commonjs"
358
+ require("./globals.css");
359
+ const { IntlayerClientProvider } = require("next-intlayer");
360
+ const { getHTMLTextDir, getIntlayer } = require("intlayer");
361
+ const { getLocale } = require("next-intlayer/server");
362
+ const { headers, cookies } = require("next/headers");
363
+ const { generateStaticParams } = require("next-intlayer");
364
+
365
+ const generateMetadata = async ({ params }) => {
366
+ const { locale } = await params;
367
+ const { title, description, keywords } = getIntlayer("metadata", locale);
368
+
369
+ return {
370
+ title,
371
+ description,
372
+ keywords,
373
+ };
374
+ };
375
+
376
+ const RootLayout = async ({ children }) => {
377
+ // Ожидаем заголовки и куки в Next.js 15+
378
+ const headerList = await headers();
379
+ const cookieList = await cookies();
380
+
381
+ const locale = await getLocale({
382
+ // Сначала проверяем cookie intlayer (по умолчанию: 'INTLAYER_LOCALE')
383
+ getCookie: (name) => cookieList.get(name)?.value,
384
+
385
+ // Затем проверяем заголовок intlayer (по умолчанию: 'x-intlayer-locale')
386
+ // И, наконец, проверяем заголовок accept-language ('accept-language')
387
+ getHeader: (name) => headerList.get(name),
388
+ });
389
+
390
+ return (
391
+ <html lang={locale} dir={getHTMLTextDir(locale)}>
392
+ <IntlayerClientProvider defaultLocale={locale}>
393
+ <body>{children}</body>
394
+ </IntlayerClientProvider>
395
+ </html>
396
+ );
397
+ };
398
+
399
+ module.exports = {
400
+ default: RootLayout,
401
+ generateStaticParams,
402
+ generateMetadata,
403
+ };
404
+ ```
405
+
406
+ ### Шаг 5: Объявите ваш контент
407
+
408
+ Создавайте и управляйте вашими объявлениями контента для хранения переводов:
409
+
410
+ ```tsx fileName="src/app/metadata.content.ts" contentDeclarationFormat="typescript"
411
+ import { t, type Dictionary } from "intlayer";
412
+ import { Metadata } from "next";
413
+
414
+ const metadataContent = {
415
+ key: "metadata",
416
+ content: {
417
+ title: t({
418
+ ru: "Заголовок моего проекта",
419
+ en: "My Project Title",
420
+ fr: "Le Titre de mon Projet",
421
+ es: "El Título de mi Proyecto",
422
+ }),
423
+
424
+ description: t({
425
+ ru: "Ознакомьтесь с нашей инновационной платформой, созданной для оптимизации рабочего процесса и повышения продуктивности.",
426
+ en: "Discover our innovative platform designed to streamline your workflow and boost productivity.",
427
+ ru: "Откройте для себя нашу инновационную платформу, созданную для оптимизации рабочего процесса и повышения продуктивности.",
428
+ fr: "Découvrez notre plateforme innovante conçue pour simplifier votre flux de travail et booster votre productivité.",
429
+ es: "Descubra su plataforma innovadora diseñada para simplificar su flujo de trabajo y aumentar su productividad.",
430
+ }),
431
+
432
+ keywords: t({
433
+ ru: ["инновации", "продуктивность", "рабочий процесс", "SaaS"],
434
+ en: ["innovation", "productivity", "workflow", "SaaS"],
435
+ fr: ["innovation", "productivité", "flux de travail", "SaaS"],
436
+ es: ["innovación", "productividad", "flujo de trabajo", "SaaS"],
437
+ }),
438
+ },
439
+ } as Dictionary<Metadata>;
440
+
441
+ export default metadataContent;
442
+ ```
443
+
444
+ ```tsx fileName="src/app/metadata.content.mjs" contentDeclarationFormat="typescript"
445
+ import { t, type Dictionary } from "intlayer";
446
+
447
+ /** @type {import('intlayer').Dictionary<import('next').Metadata>} */
448
+ const metadataContent = {
449
+ key: "metadata",
450
+ content: {
451
+ title: t({
452
+ ru: "Название моего проекта",
453
+ en: "My Project Title",
454
+ fr: "Le Titre de mon Projet",
455
+ es: "El Título de mi Proyecto",
456
+ }),
457
+
458
+ description: t({
459
+ ru: "Ознакомьтесь с нашей инновационной платформой, созданной для оптимизации рабочего процесса и повышения продуктивности.",
460
+ en: "Discover our innovative platform designed to streamline your workflow and boost productivity.",
461
+ fr: "Découvrez notre plateforme innovante conçue pour simplifier votre flux de travail et booster votre productivité.",
462
+ es: "Descubra nuestra plataforma innovadora diseñada para simplificar su flujo de trabajo y aumentar su productividad.",
463
+ }),
464
+
465
+ keywords: t({
466
+ ru: ["инновации", "продуктивность", "рабочий процесс", "SaaS"],
467
+ en: ["innovation", "productivity", "workflow", "SaaS"],
468
+ fr: ["innovation", "productivité", "flux de travail", "SaaS"],
469
+ es: ["innovación", "productividad", "flujo de trabajo", "SaaS"],
470
+ }),
471
+ },
472
+ };
473
+
474
+ export default metadataContent;
475
+ ```
476
+
477
+ ```javascript fileName="src/app/metadata.content.cjs" contentDeclarationFormat="commonjs"
478
+ const { t } = require("intlayer");
479
+
480
+ // Тип: словарь метаданных для Next.js
481
+ /** @type {import('intlayer').Dictionary<import('next').Metadata>} */
482
+ const metadataContent = {
483
+ key: "metadata",
484
+ content: {
485
+ title: t({
486
+ ru: "Название моего проекта",
487
+ en: "My Project Title",
488
+ fr: "Le Titre de mon Projet",
489
+ es: "El Título de mi Proyecto",
490
+ }),
491
+
492
+ description: t({
493
+ ru: "Ознакомьтесь с нашей инновационной платформой, созданной для оптимизации рабочего процесса и повышения продуктивности.",
494
+ en: "Discover our innovative platform designed to streamline your workflow and boost productivity.",
495
+ fr: "Découvrez notre plateforme innovante conçue pour simplifier votre flux de travail et booster votre productivité.",
496
+ es: "Descubra nuestra plataforma innovadora diseñada para simplificar su flujo de trabajo y aumentar su productividad.",
497
+ }),
498
+
499
+ keywords: t({
500
+ ru: ["инновации", "продуктивность", "рабочий процесс", "SaaS"],
501
+ en: ["innovation", "productivity", "workflow", "SaaS"],
502
+ fr: ["innovation", "productivité", "flux de travail", "SaaS"],
503
+ es: ["innovación", "productividad", "flujo de trabajo", "SaaS"],
504
+ }),
505
+ },
506
+ };
507
+
508
+ module.exports = metadataContent;
509
+ ```
510
+
511
+ ```json fileName="src/app/metadata.content.json" contentDeclarationFormat="json"
512
+ {
513
+ "key": "metadata",
514
+ "content": {
515
+ "title": {
516
+ "nodeType": "translation",
517
+ "translation": {
518
+ "ru": "Название моего проекта",
519
+ "en": "My Project Title",
520
+ "fr": "Le Titre de mon Projet",
521
+ "es": "El Título de mi Proyecto"
522
+ }
523
+ },
524
+ "description": {
525
+ "nodeType": "translation",
526
+ "translation": {
527
+ "ru": "Ознакомьтесь с нашей инновационной платформой, созданной для упрощения вашего рабочего процесса и повышения продуктивности.",
528
+ "en": "Discover our innovative platform designed to streamline your workflow and boost productivity.",
529
+ "ru": "Откройте для себя нашу инновационную платформу, созданную для упрощения рабочего процесса и повышения вашей продуктивности.",
530
+ "fr": "Découvrez notre plateforme innovante conçue pour simplifier votre flux de travail et booster votre productivité.",
531
+ "es": "Descubra nuestra plataforma innovadora diseñada para simplificar su flujo de trabajo y aumentar su productividad."
532
+ }
533
+ },
534
+ "keywords": {
535
+ "nodeType": "translation",
536
+ "translation": {
537
+ "ru": ["инновации", "продуктивность", "рабочий процесс", "SaaS"],
538
+ "en": ["innovation", "productivity", "workflow", "SaaS"],
539
+ "fr": ["innovation", "productivité", "flux de travail", "SaaS"],
540
+ "es": ["innovación", "productividad", "flujo de trabajo", "SaaS"]
541
+ }
542
+ }
543
+ }
544
+ }
545
+ ```
546
+
547
+ ```tsx fileName="src/app/page.content.ts" contentDeclarationFormat="typescript"
548
+ import { t, type Dictionary } from "intlayer";
549
+
550
+ const pageContent = {
551
+ key: "page",
552
+ content: {
553
+ getStarted: {
554
+ main: t({
555
+ ru: "Начните с редактирования",
556
+ en: "Get started by editing",
557
+ fr: "Commencez par éditer",
558
+ es: "Comience por editar",
559
+ }),
560
+ pageLink: "src/app/page.tsx",
561
+ },
562
+ },
563
+ } satisfies Dictionary;
564
+
565
+ export default pageContent;
566
+ ```
567
+
568
+ ```javascript fileName="src/app/page.content.mjs" contentDeclarationFormat="esm"
569
+ import { t } from "intlayer";
570
+
571
+ /** @type {import('intlayer').Dictionary} */
572
+ const pageContent = {
573
+ key: "page",
574
+ content: {
575
+ getStarted: {
576
+ main: t({
577
+ ru: "Начните с редактирования",
578
+ en: "Get started by editing",
579
+ fr: "Commencez par éditer",
580
+ es: "Comience por editar",
581
+ }),
582
+ pageLink: "src/app/page.tsx",
583
+ },
584
+ },
585
+ };
586
+
587
+ export default pageContent;
588
+ ```
589
+
590
+ ```javascript fileName="src/app/page.content.cjs" contentDeclarationFormat="commonjs"
591
+ const { t } = require("intlayer");
592
+
593
+ /** @type {import('intlayer').Dictionary} */
594
+ const pageContent = {
595
+ key: "page",
596
+ content: {
597
+ getStarted: {
598
+ main: t({
599
+ ru: "Начните с редактирования",
600
+ en: "Get started by editing",
601
+ fr: "Commencez par éditer",
602
+ es: "Comience por editar",
603
+ }),
604
+ pageLink: "src/app/page.tsx",
605
+ },
606
+ },
607
+ };
608
+
609
+ module.exports = pageContent;
610
+ ```
611
+
612
+ ```json fileName="src/app/page.content.json" contentDeclarationFormat="json"
613
+ {
614
+ "$schema": "https://intlayer.org/schema.json",
615
+ "key": "page",
616
+ "content": {
617
+ "getStarted": {
618
+ "nodeType": "translation",
619
+ "translation": {
620
+ "ru": "Начните с редактирования",
621
+ "en": "Get started by editing",
622
+ "fr": "Commencez par éditer",
623
+ "es": "Comience por editar"
624
+ }
625
+ },
626
+ "pageLink": "src/app/page.tsx"
627
+ }
628
+ }
629
+ ```
630
+
631
+ > Ваши объявления контента могут быть определены в любом месте вашего приложения, при условии что они включены в директорию `contentDir` (по умолчанию `./src`). И соответствуют расширению файла объявления контента (по умолчанию `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
632
+
633
+ > Для получения подробной информации обратитесь к [документации по объявлениям контента](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/dictionary/content_file.md).
634
+
635
+ ### Шаг 6: Использование контента в коде
636
+
637
+ Получайте доступ к словарям контента по всему приложению:
638
+
639
+ ```tsx fileName="src/app/page.tsx" codeFormat="typescript"
640
+ import type { FC } from "react";
641
+ import { ClientComponentExample } from "@components/clientComponentExample/ClientComponentExample";
642
+ import { ServerComponentExample } from "@components/serverComponentExample/ServerComponentExample";
643
+ import { IntlayerServerProvider, useIntlayer } from "next-intlayer/server";
644
+ import { NextPage } from "next";
645
+ import { getLocale } from "intlayer";
646
+ import { headers, cookies } from "next/headers";
647
+
648
+ const PageContent: FC = () => {
649
+ const content = useIntlayer("page");
650
+
651
+ return (
652
+ <>
653
+ <p>{content.getStarted.main}</p>
654
+ <code>{content.getStarted.pageLink}</code>
655
+ </>
656
+ );
657
+ };
658
+
659
+ const Page: NextPage = async () => {
660
+ // Ожидайте headers и cookies в Next.js 15+
661
+ const headerList = await headers();
662
+ const cookieList = await cookies();
663
+
664
+ const locale = await getLocale({
665
+ // Сначала проверьте cookie intlayer (по умолчанию: 'INTLAYER_LOCALE')
666
+ getCookie: (name) => cookieList.get(name)?.value,
667
+
668
+ // Затем проверяем заголовок intlayer (по умолчанию: 'x-intlayer-locale')
669
+ // И, наконец, проверяем заголовок accept-language ('accept-language')
670
+ getHeader: (name) => headerList.get(name),
671
+ });
672
+
673
+ return (
674
+ <IntlayerServerProvider locale={locale}>
675
+ <PageContent />
676
+ <ServerComponentExample />
677
+ <ClientComponentExample />
678
+ </IntlayerServerProvider>
679
+ );
680
+ };
681
+
682
+ export default Page;
683
+ ```
684
+
685
+ ```jsx fileName="src/app/page.mjx" codeFormat="esm"
686
+ import { ClientComponentExample } from "@components/clientComponentExample/ClientComponentExample";
687
+ import { ServerComponentExample } from "@components/serverComponentExample/ServerComponentExample";
688
+ import { IntlayerServerProvider, useIntlayer, getLocale } from "next-intlayer/server";
689
+ import { headers, cookies } from "next/headers";
690
+ import { NextPage } from "next";
691
+
692
+ const Page: NextPage = async () => {
693
+ const content = useIntlayer("page");
694
+
695
+ return (
696
+ <>
697
+ <p>{content.getStarted.main}</p>
698
+ <code>{content.getStarted.pageLink}</code>
699
+ </>
700
+ );
701
+ };
702
+
703
+ const Page = async () => {
704
+
705
+ // Ожидание headers и cookies в Next.js 15+
706
+ const headerList = await headers();
707
+ const cookieList = await cookies();
708
+
709
+ const locale = await getLocale({
710
+ // Сначала проверяем cookie intlayer (по умолчанию: 'INTLAYER_LOCALE')
711
+ getCookie: (name) => cookieList.get(name)?.value,
712
+
713
+ // Затем проверяем заголовок intlayer (по умолчанию: 'x-intlayer-locale')
714
+ // И наконец проверяем заголовок accept-language ('accept-language')
715
+ getHeader: (name) => headerList.get(name),
716
+ });
717
+
718
+ return (
719
+ <IntlayerServerProvider locale={locale}>
720
+ <PageContent />
721
+ <ServerComponentExample />
722
+ <ClientComponentExample />
723
+ </IntlayerServerProvider>
724
+ );
725
+ };
726
+
727
+ export default Page;
728
+ ```
729
+
730
+ ```jsx fileName="src/app/page.csx" codeFormat="commonjs"
731
+ import { ClientComponentExample } from "@components/clientComponentExample/ClientComponentExample";
732
+ import { ServerComponentExample } from "@components/serverComponentExample/ServerComponentExample";
733
+ import { IntlayerServerProvider, useIntlayer, getLocale } from "next-intlayer/server";
734
+ import { NextPage } from "next";
735
+ import { headers, cookies } from "next/headers";
736
+
737
+ const Page: NextPage = async () => {
738
+ const content = useIntlayer("page");
739
+
740
+ return (
741
+ <>
742
+ <p>{content.getStarted.main}</p>
743
+ <code>{content.getStarted.pageLink}</code>
744
+ </>
745
+ );
746
+ };
747
+
748
+ const Page: NextPage = async () => {
749
+ // Ожидание headers и cookies в Next.js 15+
750
+ const headerList = await headers();
751
+ const cookieList = await cookies();
752
+
753
+ const locale = await getLocale({
754
+ // Сначала проверяем cookie intlayer (по умолчанию: 'INTLAYER_LOCALE')
755
+ getCookie: (name) => cookieList.get(name)?.value,
756
+
757
+ // Затем проверяем заголовок intlayer (по умолчанию: 'x-intlayer-locale')
758
+ // И, наконец, проверяем заголовок accept-language ('accept-language')
759
+ getHeader: (name) => headerList.get(name),
760
+ });
761
+
762
+ return (
763
+ <IntlayerServerProvider locale={locale}>
764
+ <PageContent />
765
+ <ServerComponentExample />
766
+ <ClientComponentExample />
767
+ </IntlayerServerProvider>
768
+ );
769
+ };
770
+ ```
771
+
772
+ - **`IntlayerClientProvider`** используется для предоставления locale клиентским компонентам. Его можно разместить в любом родительском компоненте, включая layout. Однако рекомендуется помещать его в layout, потому что Next.js использует общий код layout между страницами, что делает это более эффективным. Используя `IntlayerClientProvider` в layout, вы избегаете повторной инициализации на каждой странице, повышаете производительность и поддерживаете единый контекст локализации во всём приложении.
773
+ - **`IntlayerServerProvider`** используется для предоставления locale серверным дочерним компонентам. Его нельзя установить в layout.
774
+
775
+ > Layout и page не могут разделять общий server context, потому что система server context основана на хранилище данных, привязанном к каждому запросу (через механизм [React's cache](https://react.dev/reference/react/cache)), из‑за чего каждый «context» воссоздаётся для разных сегментов приложения. Размещение provider в общем layout нарушит эту изоляцию и помешает корректной передаче значений server context в ваши server components.
776
+
777
+ ```tsx {4,7} fileName="src/components/clientComponentExample/ClientComponentExample.tsx" codeFormat="typescript"
778
+ "use client";
779
+
780
+ import type { FC } from "react";
781
+ import { useIntlayer } from "next-intlayer";
782
+
783
+ export const ClientComponentExample: FC = () => {
784
+ const content = useIntlayer("client-component-example"); // Создаёт соответствующее объявление контента
785
+
786
+ return (
787
+ <div>
788
+ <h2>{content.title}</h2>
789
+ <p>{content.content}</p>
790
+ </div>
791
+ );
792
+ };
793
+ ```
794
+
795
+ ```jsx {3,6} fileName="src/components/clientComponentExample/ClientComponentExample.mjx" codeFormat="esm"
796
+ "use client";
797
+
798
+ import { useIntlayer } from "next-intlayer";
799
+
800
+ const ClientComponentExample = () => {
801
+ const content = useIntlayer("client-component-example"); // Создать объявление связанного контента
802
+
803
+ return (
804
+ <div>
805
+ <h2>{content.title}</h2>
806
+ <p>{content.content}</p>
807
+ </div>
808
+ );
809
+ };
810
+ ```
811
+
812
+ ```jsx {3,6} fileName="src/components/clientComponentExample/ClientComponentExample.csx" codeFormat="commonjs"
813
+ "use client";
814
+
815
+ const { useIntlayer } = require("next-intlayer");
816
+
817
+ const ClientComponentExample = () => {
818
+ const content = useIntlayer("client-component-example"); // Создать декларацию связанного контента
819
+
820
+ return (
821
+ <div>
822
+ <h2>{content.title}</h2>
823
+ <p>{content.content}</p>
824
+ </div>
825
+ );
826
+ };
827
+ ```
828
+
829
+ ```tsx {2} fileName="src/components/serverComponentExample/ServerComponentExample.tsx" codeFormat="typescript"
830
+ import type { FC } from "react";
831
+ import { useIntlayer } from "next-intlayer/server";
832
+
833
+ export const ServerComponentExample: FC = () => {
834
+ const content = useIntlayer("server-component-example"); // Создать декларацию связанного контента
835
+
836
+ return (
837
+ <div>
838
+ <h2>{content.title}</h2>
839
+ <p>{content.content}</p>
840
+ </div>
841
+ );
842
+ };
843
+ ```
844
+
845
+ ```jsx {1} fileName="src/components/serverComponentExample/ServerComponentExample.mjx" codeFormat="esm"
846
+ import { useIntlayer } from "next-intlayer/server";
847
+
848
+ const ServerComponentExample = () => {
849
+ const content = useIntlayer("server-component-example"); // Создает объявление связанного контента
850
+
851
+ return (
852
+ <div>
853
+ <h2>{content.title}</h2>
854
+ <p>{content.content}</p>
855
+ </div>
856
+ );
857
+ };
858
+ ```
859
+
860
+ ```jsx {1} fileName="src/components/serverComponentExample/ServerComponentExample.csx" codeFormat="commonjs"
861
+ const { useIntlayer } = require("next-intlayer/server");
862
+
863
+ const ServerComponentExample = () => {
864
+ const content = useIntlayer("server-component-example"); // Создает объявление связанного контента
865
+
866
+ return (
867
+ <div>
868
+ <h2>{content.title}</h2>
869
+ <p>{content.content}</p>
870
+ </div>
871
+ );
872
+ };
873
+ ```
874
+
875
+ > Если вы хотите использовать содержимое в строковом атрибуте, таком как `alt`, `title`, `href`, `aria-label` и т.д., вы должны вызвать значение функции, например:
876
+
877
+ > ```jsx
878
+ > <img src={content.image.src.value} alt={content.image.value} />
879
+ > ```
880
+
881
+ > Чтобы узнать больше о хуке `useIntlayer`, см. [документацию](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/packages/next-intlayer/useIntlayer.md).
882
+
883
+ ### (Опционально) Шаг 7: Настройка прокси для определения локали
884
+
885
+ Настройте прокси для определения предпочитаемой пользователем локали:
886
+
887
+ ```typescript fileName="src/proxy.ts" codeFormat="typescript"
888
+ export { intlayerProxy as proxy } from "next-intlayer/proxy";
889
+
890
+ export const config = {
891
+ matcher:
892
+ "/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
893
+ };
894
+ ```
895
+
896
+ ```javascript fileName="src/proxy.mjs" codeFormat="esm"
897
+ export { intlayerProxy as proxy } from "next-intlayer/proxy";
898
+
899
+ export const config = {
900
+ matcher:
901
+ "/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
902
+ };
903
+ ```
904
+
905
+ ```javascript fileName="src/proxy.cjs" codeFormat="commonjs"
906
+ const { intlayerProxy } = require("next-intlayer/proxy");
907
+
908
+ const config = {
909
+ matcher:
910
+ "/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
911
+ };
912
+
913
+ module.exports = { proxy: intlayerProxy, config };
914
+ ```
915
+
916
+ > Прокси `intlayerProxy` используется для определения предпочитаемой локали пользователя и перенаправления его на соответствующий URL, как указано в [конфигурации](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/configuration.md). Кроме того, он позволяет сохранять предпочитаемую локаль пользователя в cookie.
917
+
918
+ > Если требуется связать несколько прокси вместе (например, `intlayerProxy` с прокси авторизации или пользовательскими прокси), Intlayer предоставляет вспомогательную функцию `multipleProxies`.
919
+
920
+ ```ts
921
+ import { multipleProxies, intlayerProxy } from "next-intlayer/proxy";
922
+ import { customProxy } from "@utils/customProxy";
923
+
924
+ export const proxy = multipleProxies([intlayerProxy, customProxy]);
925
+ ```
926
+
927
+ ### (Необязательно) Шаг 8: Изменение языка вашего контента
928
+
929
+ Чтобы изменить язык содержимого в Next.js, рекомендуется использовать компонент `Link`, чтобы перенаправлять пользователей на соответствующую локализованную страницу. Компонент `Link` поддерживает предзагрузку страницы (prefetch), что помогает избежать полной перезагрузки страницы.
930
+
931
+ ```tsx fileName="src/components/localeSwitcher/LocaleSwitcher.tsx" codeFormat="typescript"
932
+ "use client";
933
+
934
+ import type { FC } from "react";
935
+ import { Locales, getHTMLTextDir, getLocaleName } from "intlayer";
936
+ import { useLocale } from "next-intlayer";
937
+
938
+ export const LocaleSwitcher: FC = () => {
939
+ const { locale, availableLocales, setLocale } = useLocale({
940
+ onChange: () => window.location.reload(),
941
+ });
942
+
943
+ return (
944
+ <div>
945
+ <button popoverTarget="localePopover">{getLocaleName(locale)}</button>
946
+ <div id="localePopover" popover="auto">
947
+ {availableLocales.map((localeItem) => (
948
+ <button
949
+ key={localeItem}
950
+ aria-current={locale === localeItem ? "page" : undefined}
951
+ onClick={() => setLocale(localeItem)}
952
+ >
953
+ <span>
954
+ {/* Локаль — например FR */}
955
+ {localeItem}
956
+ </span>
957
+ <span>
958
+ {/* Название языка в своей локали — например Français */}
959
+ {getLocaleName(localeItem, locale)}
960
+ </span>
961
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
962
+ {/* Название языка в текущей локали — например Francés при текущей локали Locales.SPANISH */}
963
+ {getLocaleName(localeItem)}
964
+ </span>
965
+ <span dir="ltr" lang={Locales.ENGLISH}>
966
+ {/* Название языка на английском — напр., French */}
967
+ {getLocaleName(localeItem, Locales.ENGLISH)}
968
+ </span>
969
+ </button>
970
+ ))}
971
+ </div>
972
+ </div>
973
+ );
974
+ };
975
+ ```
976
+
977
+ ```jsx fileName="src/components/localeSwitcher/LocaleSwitcher.msx" codeFormat="esm"
978
+ "use client";
979
+
980
+ import { Locales, getHTMLTextDir, getLocaleName } from "intlayer";
981
+ import { useLocale } from "next-intlayer";
982
+
983
+ export const LocaleSwitcher = () => {
984
+ const { locale, availableLocales, setLocale } = useLocale({
985
+ onChange: () => window.location.reload(),
986
+ });
987
+
988
+ return (
989
+ <div>
990
+ <button popoverTarget="localePopover">{getLocaleName(locale)}</button>
991
+ <div id="localePopover" popover="auto">
992
+ {availableLocales.map((localeItem) => (
993
+ <button
994
+ key={localeItem}
995
+ aria-current={locale === localeItem ? "page" : undefined}
996
+ onClick={() => setLocale(localeItem)}
997
+ >
998
+ <span>
999
+ {/* Локаль - например FR */}
1000
+ {localeItem}
1001
+ </span>
1002
+ <span>
1003
+ {/* Название языка в его собственной локали - например Français */}
1004
+ {getLocaleName(localeItem, locale)}
1005
+ </span>
1006
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
1007
+ {/* Название языка в текущей локали - например Francés, если текущая локаль установлена в Locales.SPANISH */}
1008
+ {getLocaleName(localeItem)}
1009
+ </span>
1010
+ <span dir="ltr" lang={Locales.ENGLISH}>
1011
+ {/* Название языка на английском - например French */}
1012
+ {getLocaleName(localeItem, Locales.ENGLISH)}
1013
+ </span>
1014
+ </button>
1015
+ ))}
1016
+ </div>
1017
+ </div>
1018
+ );
1019
+ };
1020
+ ```
1021
+
1022
+ ```jsx fileName="src/components/localeSwitcher/LocaleSwitcher.csx" codeFormat="commonjs"
1023
+ "use client";
1024
+
1025
+ const { Locales, getHTMLTextDir, getLocaleName } = require("intlayer");
1026
+ const { useLocale } = require("next-intlayer");
1027
+
1028
+ export const LocaleSwitcher = () => {
1029
+ const path
1030
+ const { locale availableLocales, setLocale } = useLocale({
1031
+ onChange: ()=> window.location.reload(),
1032
+ });
1033
+
1034
+ return (
1035
+ <div>
1036
+ <button popoverTarget="localePopover">{getLocaleName(locale)}</button>
1037
+ <div id="localePopover" popover="auto">
1038
+ {availableLocales.map((localeItem) => (
1039
+ <button
1040
+ key={localeItem}
1041
+ aria-current={locale === localeItem ? "page" : undefined}
1042
+ onClick={() => setLocale(localeItem)}
1043
+ >
1044
+ <span>
1045
+ {/* Локаль - напр., FR */}
1046
+ {localeItem}
1047
+ </span>
1048
+ <span>
1049
+ {/* Название языка на его собственном языке - напр., Français */}
1050
+ {getLocaleName(localeItem, locale)}
1051
+ </span>
1052
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
1053
+ {/* Название языка на текущем языке интерфейса - напр., Francés при текущей локали Locales.SPANISH */}
1054
+ {getLocaleName(localeItem)}
1055
+ </span>
1056
+ <span dir="ltr" lang={Locales.ENGLISH}>
1057
+ {/* Название языка на английском - напр., French */}
1058
+ {getLocaleName(localeItem, Locales.ENGLISH)}
1059
+ </span>
1060
+ </button>
1061
+ ))}
1062
+ </div>
1063
+ </div>
1064
+ );
1065
+ };
1066
+ ```
1067
+
1068
+ > Альтернативный способ — использовать функцию `setLocale`, предоставляемую хуком `useLocale`. Эта функция не будет позволять предзагружать страницу. См. документацию по хуку [`useLocale`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/packages/next-intlayer/useLocale.md) для получения дополнительных сведений.
1069
+
1070
+ > Ссылки в документации:
1071
+ >
1072
+ > - [`useLocale` хук](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/packages/next-intlayer/useLocale.md)
1073
+ > - [`getLocaleName` хук](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/packages/next-intlayer/getLocaleName.md)
1074
+ > - [`getLocalizedUrl` хук](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/packages/next-intlayer/getLocalizedUrl.md)
1075
+ > - [хук `getHTMLTextDir`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/packages/intlayer/getHTMLTextDir.md)
1076
+ > - [атрибут `hrefLang`](https://developers.google.com/search/docs/specialty/international/localized-versions?hl=fr)
1077
+ > - [атрибут `lang`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)
1078
+ > - [атрибут `dir`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)
1079
+ > - [атрибут `aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)
1080
+ >
1081
+ > ### (Необязательно) Шаг 9: Получить текущую локаль в Server Actions
1082
+ >
1083
+ > Если вам нужна активная локаль внутри Server Action (например, чтобы локализовать письма или выполнить логику, зависящую от локали), вызовите `getLocale` из `next-intlayer/server`:
1084
+
1085
+ ```tsx fileName="src/app/actions/getLocale.ts" codeFormat="typescript"
1086
+ "use server";
1087
+
1088
+ import { getLocale } from "next-intlayer/server";
1089
+
1090
+ export const myServerAction = async () => {
1091
+ const locale = await getLocale();
1092
+
1093
+ // Выполните действия с локалью
1094
+ };
1095
+ ```
1096
+
1097
+ > Функция `getLocale` использует каскадную стратегию для определения локали пользователя:
1098
+ >
1099
+ > 1. Сначала она проверяет заголовки запроса на наличие значения локали, которое могло быть установлено proxy
1100
+ > 2. Если в заголовках локаль не найдена, она ищет локаль в cookies
1101
+ > 3. Если cookies не найдено, она пытается определить предпочитаемый язык пользователя из настроек браузера
1102
+ > 4. В крайнем случае используется локаль по умолчанию, настроенная в приложении
1103
+ >
1104
+ > Это гарантирует выбор наиболее подходящей локали на основе доступного контекста.
1105
+
1106
+ ### (Необязательно) Шаг 10: Оптимизируйте размер бандла
1107
+
1108
+ При использовании `next-intlayer` словари по умолчанию включаются в бандл для каждой страницы. Чтобы оптимизировать размер бандла, Intlayer предоставляет опциональный SWC-плагин, который интеллектуально заменяет вызовы `useIntlayer` с помощью макросов. Это гарантирует, что словари будут включаться в бандлы только для тех страниц, которые действительно их используют.
1109
+
1110
+ Чтобы включить эту оптимизацию, установите пакет `@intlayer/swc`. После установки `next-intlayer` автоматически обнаружит и начнёт использовать плагин:
1111
+
1112
+ ```bash packageManager="npm"
1113
+ npm install @intlayer/swc --save-dev
1114
+ npx intlayer init
1115
+ ```
1116
+
1117
+ ```bash packageManager="pnpm"
1118
+ pnpm add @intlayer/swc --save-dev
1119
+ pnpm intlayer init
1120
+ ```
1121
+
1122
+ ```bash packageManager="yarn"
1123
+ yarn add @intlayer/swc --save-dev
1124
+ yarn intlayer init
1125
+ ```
1126
+
1127
+ ```bash packageManager="bun"
1128
+ bun add @intlayer/swc --dev
1129
+ bunx intlayer init
1130
+ ```
1131
+
1132
+ > Примечание: Эта оптимизация доступна только для Next.js 13 и выше.
1133
+
1134
+ > Примечание: Этот пакет не устанавливается по умолчанию, поскольку SWC-плагины в Next.js всё ещё экспериментальны. Это может измениться в будущем.
1135
+
1136
+ > Примечание: Если установить опцию как `importMode: 'dynamic'` или `importMode: 'live'`, будет полагаться на Suspense, поэтому вам придётся оборачивать вызовы `useIntlayer` в границу `Suspense`. Это означает, что вы не сможете использовать `useIntlayer` прямо на верхнем уровне вашего компонента Page / Layout.
1137
+
1138
+ ### Отслеживание изменений словарей в Turbopack
1139
+
1140
+ Когда вы используете Turbopack в качестве сервера разработки с командой `next dev`, изменения словарей по умолчанию не будут автоматически обнаруживаться.
1141
+
1142
+ Это ограничение возникает из-за того, что Turbopack не может параллельно запускать плагины webpack для отслеживания изменений в ваших файлах с содержимым. Чтобы обойти это, вам нужно использовать команду `intlayer watch`, чтобы одновременно запустить сервер разработки и наблюдатель сборки Intlayer.
1143
+
1144
+ ```json5 fileName="package.json"
1145
+ {
1146
+ // ... Ваши существующие настройки package.json
1147
+ "scripts": {
1148
+ // ... Ваши существующие конфигурации скриптов
1149
+ "dev": "intlayer watch --with 'next dev'",
1150
+ },
1151
+ }
1152
+ ```
1153
+
1154
+ > Если вы используете next-intlayer@<=6.x.x, необходимо сохранять флаг `--turbopack`, чтобы приложение Next.js 16 корректно работало с Turbopack. Рекомендуем использовать next-intlayer@>=7.x.x, чтобы избежать этого ограничения.
1155
+
1156
+ ### Настройка TypeScript
1157
+
1158
+ Intlayer использует module augmentation, чтобы получить преимущества TypeScript и укрепить вашу codebase.
1159
+
1160
+ ![Автодополнение](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
1161
+
1162
+ ![Ошибка перевода](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
1163
+
1164
+ Убедитесь, что конфигурация TypeScript включает автогенерируемые типы.
1165
+
1166
+ ```json5 fileName="tsconfig.json"
1167
+ {
1168
+ // ... Ваши существующие конфигурации TypeScript
1169
+ "include": [
1170
+ // ... Ваши существующие конфигурации TypeScript
1171
+ ".intlayer/**/*.ts", // Включить автоматически сгенерированные типы
1172
+ ],
1173
+ }
1174
+ ```
1175
+
1176
+ ### Конфигурация Git
1177
+
1178
+ Рекомендуется игнорировать файлы, сгенерированные Intlayer. Это позволяет избежать их добавления в ваш Git-репозиторий.
1179
+
1180
+ Для этого вы можете добавить следующие инструкции в файл `.gitignore`:
1181
+
1182
+ ```plaintext fileName=".gitignore"
1183
+ # Игнорировать файлы, сгенерированные Intlayer
1184
+ .intlayer
1185
+ ```
1186
+
1187
+ ### Расширение VS Code
1188
+
1189
+ Чтобы улучшить опыт разработки с Intlayer, вы можете установить официальное **Intlayer VS Code Extension**.
1190
+
1191
+ [Установить из VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
1192
+
1193
+ Это расширение предоставляет:
1194
+
1195
+ - **Автодополнение** для ключей переводов.
1196
+ - **Обнаружение ошибок в реальном времени** для отсутствующих переводов.
1197
+ - **Встроенные превью** переведённого контента.
1198
+ - **Быстрые действия** для простого создания и обновления переводов.
1199
+
1200
+ Для получения подробной информации о том, как использовать расширение, обратитесь к [документации Intlayer VS Code Extension](https://intlayer.org/doc/vs-code-extension).
1201
+
1202
+ ### Продвинутые возможности
1203
+
1204
+ Чтобы продолжить, вы можете реализовать [визуальный редактор](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/intlayer_visual_editor.md) или вынести свой контент, используя [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/intlayer_CMS.md).