@intlayer/docs 7.5.11 → 7.5.13

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 (417) 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/uk/compiler_vs_declarative_i18n.md +224 -0
  68. package/blog/uk/i18n_using_next-i18next.md +1086 -0
  69. package/blog/uk/i18n_using_next-intl.md +760 -0
  70. package/blog/uk/index.md +69 -0
  71. package/blog/uk/internationalization_and_SEO.md +273 -0
  72. package/blog/uk/intlayer_with_i18next.md +211 -0
  73. package/blog/uk/intlayer_with_next-i18next.md +202 -0
  74. package/blog/uk/intlayer_with_next-intl.md +203 -0
  75. package/blog/uk/intlayer_with_react-i18next.md +200 -0
  76. package/blog/uk/intlayer_with_react-intl.md +202 -0
  77. package/blog/uk/intlayer_with_vue-i18n.md +206 -0
  78. package/blog/uk/l10n_platform_alternative/Lokalise.md +80 -0
  79. package/blog/uk/l10n_platform_alternative/crowdin.md +80 -0
  80. package/blog/uk/l10n_platform_alternative/phrase.md +78 -0
  81. package/blog/uk/list_i18n_technologies/CMS/drupal.md +143 -0
  82. package/blog/uk/list_i18n_technologies/CMS/wix.md +167 -0
  83. package/blog/uk/list_i18n_technologies/CMS/wordpress.md +189 -0
  84. package/blog/uk/list_i18n_technologies/frameworks/angular.md +125 -0
  85. package/blog/uk/list_i18n_technologies/frameworks/flutter.md +128 -0
  86. package/blog/uk/list_i18n_technologies/frameworks/react-native.md +217 -0
  87. package/blog/uk/list_i18n_technologies/frameworks/react.md +155 -0
  88. package/blog/uk/list_i18n_technologies/frameworks/svelte.md +145 -0
  89. package/blog/uk/list_i18n_technologies/frameworks/vue.md +144 -0
  90. package/blog/uk/next-i18next_vs_next-intl_vs_intlayer.md +1499 -0
  91. package/blog/uk/nextjs-multilingual-seo-comparison.md +360 -0
  92. package/blog/uk/rag_powered_documentation_assistant.md +288 -0
  93. package/blog/uk/react-i18next_vs_react-intl_vs_intlayer.md +164 -0
  94. package/blog/uk/vue-i18n_vs_intlayer.md +279 -0
  95. package/blog/uk/what_is_internationalization.md +167 -0
  96. package/blog/vi/intlayer_with_i18next.md +0 -2
  97. package/blog/vi/intlayer_with_next-i18next.md +0 -2
  98. package/blog/vi/intlayer_with_react-i18next.md +0 -2
  99. package/blog/zh/intlayer_with_i18next.md +0 -2
  100. package/blog/zh/intlayer_with_next-i18next.md +0 -2
  101. package/blog/zh/intlayer_with_react-i18next.md +0 -2
  102. package/blog/zh/intlayer_with_vue-i18n.md +0 -46
  103. package/dist/cjs/generated/blog.entry.cjs +58 -29
  104. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  105. package/dist/cjs/generated/docs.entry.cjs +218 -99
  106. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  107. package/dist/cjs/generated/frequentQuestions.entry.cjs +50 -15
  108. package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
  109. package/dist/cjs/generated/legal.entry.cjs +4 -2
  110. package/dist/cjs/generated/legal.entry.cjs.map +1 -1
  111. package/dist/esm/generated/blog.entry.mjs +58 -29
  112. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  113. package/dist/esm/generated/docs.entry.mjs +218 -99
  114. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  115. package/dist/esm/generated/frequentQuestions.entry.mjs +50 -15
  116. package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
  117. package/dist/esm/generated/legal.entry.mjs +4 -2
  118. package/dist/esm/generated/legal.entry.mjs.map +1 -1
  119. package/dist/types/generated/blog.entry.d.ts.map +1 -1
  120. package/dist/types/generated/docs.entry.d.ts +1 -0
  121. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  122. package/dist/types/generated/frequentQuestions.entry.d.ts +1 -0
  123. package/dist/types/generated/frequentQuestions.entry.d.ts.map +1 -1
  124. package/dist/types/generated/legal.entry.d.ts.map +1 -1
  125. package/docs/ar/configuration.md +6 -1
  126. package/docs/ar/dictionary/content_file.md +6 -1
  127. package/docs/ar/intlayer_with_next-i18next.md +0 -1
  128. package/docs/ar/intlayer_with_nextjs_14.md +28 -0
  129. package/docs/ar/intlayer_with_nextjs_15.md +28 -0
  130. package/docs/ar/intlayer_with_nextjs_16.md +28 -0
  131. package/docs/ar/intlayer_with_nextjs_no_locale_path.md +1159 -0
  132. package/docs/ar/plugins/sync-json.md +6 -2
  133. package/docs/de/configuration.md +6 -1
  134. package/docs/de/dictionary/content_file.md +6 -1
  135. package/docs/de/intlayer_with_next-i18next.md +0 -1
  136. package/docs/de/intlayer_with_nextjs_14.md +28 -0
  137. package/docs/de/intlayer_with_nextjs_15.md +28 -0
  138. package/docs/de/intlayer_with_nextjs_16.md +28 -0
  139. package/docs/de/intlayer_with_nextjs_no_locale_path.md +1152 -0
  140. package/docs/de/plugins/sync-json.md +6 -2
  141. package/docs/en/configuration.md +6 -1
  142. package/docs/en/dictionary/content_file.md +6 -1
  143. package/docs/en/intlayer_with_next-i18next.md +0 -1
  144. package/docs/en/intlayer_with_nextjs_14.md +28 -0
  145. package/docs/en/intlayer_with_nextjs_15.md +28 -0
  146. package/docs/en/intlayer_with_nextjs_16.md +31 -1
  147. package/docs/en/intlayer_with_nextjs_no_locale_path.md +1132 -0
  148. package/docs/en/plugins/sync-json.md +6 -2
  149. package/docs/en-GB/configuration.md +6 -1
  150. package/docs/en-GB/dictionary/content_file.md +3 -1
  151. package/docs/en-GB/intlayer_with_next-i18next.md +0 -1
  152. package/docs/en-GB/intlayer_with_nextjs_14.md +28 -0
  153. package/docs/en-GB/intlayer_with_nextjs_15.md +28 -0
  154. package/docs/en-GB/intlayer_with_nextjs_16.md +28 -0
  155. package/docs/en-GB/intlayer_with_nextjs_no_locale_path.md +1154 -0
  156. package/docs/en-GB/plugins/sync-json.md +6 -2
  157. package/docs/es/configuration.md +6 -1
  158. package/docs/es/dictionary/content_file.md +6 -1
  159. package/docs/es/intlayer_with_next-i18next.md +0 -1
  160. package/docs/es/intlayer_with_nextjs_14.md +28 -0
  161. package/docs/es/intlayer_with_nextjs_15.md +28 -0
  162. package/docs/es/intlayer_with_nextjs_16.md +28 -0
  163. package/docs/es/intlayer_with_nextjs_no_locale_path.md +1143 -0
  164. package/docs/es/plugins/sync-json.md +6 -2
  165. package/docs/fr/configuration.md +6 -1
  166. package/docs/fr/dictionary/content_file.md +3 -1
  167. package/docs/fr/intlayer_with_next-i18next.md +0 -1
  168. package/docs/fr/intlayer_with_nextjs_14.md +28 -0
  169. package/docs/fr/intlayer_with_nextjs_15.md +28 -0
  170. package/docs/fr/intlayer_with_nextjs_16.md +28 -0
  171. package/docs/fr/intlayer_with_nextjs_no_locale_path.md +1174 -0
  172. package/docs/fr/plugins/sync-json.md +9 -5
  173. package/docs/hi/configuration.md +6 -1
  174. package/docs/hi/dictionary/content_file.md +3 -1
  175. package/docs/hi/intlayer_with_next-i18next.md +0 -1
  176. package/docs/hi/intlayer_with_nextjs_14.md +28 -0
  177. package/docs/hi/intlayer_with_nextjs_15.md +28 -0
  178. package/docs/hi/intlayer_with_nextjs_16.md +28 -0
  179. package/docs/hi/intlayer_with_nextjs_no_locale_path.md +1151 -0
  180. package/docs/hi/plugins/sync-json.md +6 -2
  181. package/docs/id/configuration.md +6 -1
  182. package/docs/id/dictionary/content_file.md +3 -1
  183. package/docs/id/intlayer_with_next-i18next.md +0 -1
  184. package/docs/id/intlayer_with_nextjs_14.md +28 -0
  185. package/docs/id/intlayer_with_nextjs_15.md +28 -0
  186. package/docs/id/intlayer_with_nextjs_16.md +28 -0
  187. package/docs/id/intlayer_with_nextjs_no_locale_path.md +1154 -0
  188. package/docs/id/plugins/sync-json.md +6 -2
  189. package/docs/it/configuration.md +6 -1
  190. package/docs/it/dictionary/content_file.md +3 -1
  191. package/docs/it/intlayer_with_next-i18next.md +0 -1
  192. package/docs/it/intlayer_with_nextjs_14.md +28 -0
  193. package/docs/it/intlayer_with_nextjs_15.md +28 -0
  194. package/docs/it/intlayer_with_nextjs_16.md +28 -0
  195. package/docs/it/intlayer_with_nextjs_no_locale_path.md +1148 -0
  196. package/docs/it/plugins/sync-json.md +6 -2
  197. package/docs/ja/configuration.md +6 -1
  198. package/docs/ja/dictionary/content_file.md +3 -1
  199. package/docs/ja/intlayer_with_next-i18next.md +0 -1
  200. package/docs/ja/intlayer_with_nextjs_14.md +28 -0
  201. package/docs/ja/intlayer_with_nextjs_15.md +28 -0
  202. package/docs/ja/intlayer_with_nextjs_16.md +28 -0
  203. package/docs/ja/intlayer_with_nextjs_no_locale_path.md +1222 -0
  204. package/docs/ja/plugins/sync-json.md +6 -2
  205. package/docs/ko/configuration.md +6 -1
  206. package/docs/ko/dictionary/content_file.md +3 -1
  207. package/docs/ko/intlayer_with_next-i18next.md +0 -1
  208. package/docs/ko/intlayer_with_nextjs_14.md +28 -0
  209. package/docs/ko/intlayer_with_nextjs_15.md +28 -0
  210. package/docs/ko/intlayer_with_nextjs_16.md +28 -0
  211. package/docs/ko/intlayer_with_nextjs_no_locale_path.md +1205 -0
  212. package/docs/ko/plugins/sync-json.md +6 -2
  213. package/docs/pl/configuration.md +3 -1
  214. package/docs/pl/dictionary/content_file.md +3 -1
  215. package/docs/pl/intlayer_with_next-i18next.md +0 -1
  216. package/docs/pl/intlayer_with_nextjs_14.md +28 -0
  217. package/docs/pl/intlayer_with_nextjs_15.md +28 -0
  218. package/docs/pl/intlayer_with_nextjs_16.md +28 -0
  219. package/docs/pl/intlayer_with_nextjs_no_locale_path.md +1149 -0
  220. package/docs/pl/plugins/sync-json.md +6 -2
  221. package/docs/pt/configuration.md +6 -1
  222. package/docs/pt/dictionary/content_file.md +3 -1
  223. package/docs/pt/intlayer_with_next-i18next.md +0 -1
  224. package/docs/pt/intlayer_with_nextjs_14.md +28 -0
  225. package/docs/pt/intlayer_with_nextjs_15.md +28 -0
  226. package/docs/pt/intlayer_with_nextjs_16.md +28 -0
  227. package/docs/pt/intlayer_with_nextjs_no_locale_path.md +1152 -0
  228. package/docs/pt/plugins/sync-json.md +6 -2
  229. package/docs/ru/configuration.md +6 -1
  230. package/docs/ru/dictionary/content_file.md +6 -1
  231. package/docs/ru/intlayer_with_next-i18next.md +0 -1
  232. package/docs/ru/intlayer_with_nextjs_14.md +28 -0
  233. package/docs/ru/intlayer_with_nextjs_15.md +28 -0
  234. package/docs/ru/intlayer_with_nextjs_16.md +28 -0
  235. package/docs/ru/intlayer_with_nextjs_no_locale_path.md +1204 -0
  236. package/docs/ru/plugins/sync-json.md +6 -2
  237. package/docs/tr/configuration.md +6 -1
  238. package/docs/tr/dictionary/content_file.md +3 -1
  239. package/docs/tr/intlayer_with_next-i18next.md +0 -1
  240. package/docs/tr/intlayer_with_nextjs_14.md +28 -0
  241. package/docs/tr/intlayer_with_nextjs_15.md +28 -0
  242. package/docs/tr/intlayer_with_nextjs_16.md +28 -0
  243. package/docs/tr/intlayer_with_nextjs_no_locale_path.md +1159 -0
  244. package/docs/tr/plugins/sync-json.md +6 -2
  245. package/docs/uk/CI_CD.md +198 -0
  246. package/docs/uk/autoFill.md +307 -0
  247. package/docs/uk/bundle_optimization.md +185 -0
  248. package/docs/uk/cli/build.md +64 -0
  249. package/docs/uk/cli/ci.md +137 -0
  250. package/docs/uk/cli/configuration.md +63 -0
  251. package/docs/uk/cli/debug.md +46 -0
  252. package/docs/uk/cli/doc-review.md +43 -0
  253. package/docs/uk/cli/doc-translate.md +132 -0
  254. package/docs/uk/cli/editor.md +28 -0
  255. package/docs/uk/cli/fill.md +130 -0
  256. package/docs/uk/cli/index.md +190 -0
  257. package/docs/uk/cli/init.md +84 -0
  258. package/docs/uk/cli/list.md +90 -0
  259. package/docs/uk/cli/list_projects.md +128 -0
  260. package/docs/uk/cli/live.md +41 -0
  261. package/docs/uk/cli/login.md +157 -0
  262. package/docs/uk/cli/pull.md +78 -0
  263. package/docs/uk/cli/push.md +98 -0
  264. package/docs/uk/cli/sdk.md +71 -0
  265. package/docs/uk/cli/test.md +76 -0
  266. package/docs/uk/cli/transform.md +65 -0
  267. package/docs/uk/cli/version.md +24 -0
  268. package/docs/uk/cli/watch.md +37 -0
  269. package/docs/uk/compiler.md +133 -0
  270. package/docs/uk/component_i18n.md +194 -0
  271. package/docs/uk/configuration.md +742 -0
  272. package/docs/uk/dictionary/condition.md +237 -0
  273. package/docs/uk/dictionary/content_file.md +1134 -0
  274. package/docs/uk/dictionary/enumeration.md +245 -0
  275. package/docs/uk/dictionary/file.md +232 -0
  276. package/docs/uk/dictionary/function_fetching.md +212 -0
  277. package/docs/uk/dictionary/gender.md +273 -0
  278. package/docs/uk/dictionary/insertion.md +187 -0
  279. package/docs/uk/dictionary/markdown.md +383 -0
  280. package/docs/uk/dictionary/nesting.md +273 -0
  281. package/docs/uk/dictionary/translation.md +332 -0
  282. package/docs/uk/formatters.md +595 -0
  283. package/docs/uk/how_works_intlayer.md +256 -0
  284. package/docs/uk/index.md +175 -0
  285. package/docs/uk/interest_of_intlayer.md +297 -0
  286. package/docs/uk/intlayer_CMS.md +569 -0
  287. package/docs/uk/intlayer_visual_editor.md +292 -0
  288. package/docs/uk/intlayer_with_angular.md +710 -0
  289. package/docs/uk/intlayer_with_astro.md +256 -0
  290. package/docs/uk/intlayer_with_create_react_app.md +1258 -0
  291. package/docs/uk/intlayer_with_express.md +429 -0
  292. package/docs/uk/intlayer_with_fastify.md +446 -0
  293. package/docs/uk/intlayer_with_lynx+react.md +548 -0
  294. package/docs/uk/intlayer_with_nestjs.md +283 -0
  295. package/docs/uk/intlayer_with_next-i18next.md +640 -0
  296. package/docs/uk/intlayer_with_next-intl.md +456 -0
  297. package/docs/uk/intlayer_with_nextjs_14.md +1646 -0
  298. package/docs/uk/intlayer_with_nextjs_15.md +1910 -0
  299. package/docs/uk/intlayer_with_nextjs_16.md +1763 -0
  300. package/docs/uk/intlayer_with_nextjs_no_locale_path.md +1159 -0
  301. package/docs/uk/intlayer_with_nextjs_page_router.md +1541 -0
  302. package/docs/uk/intlayer_with_nuxt.md +711 -0
  303. package/docs/uk/intlayer_with_react_native+expo.md +715 -0
  304. package/docs/uk/intlayer_with_react_router_v7.md +600 -0
  305. package/docs/uk/intlayer_with_react_router_v7_fs_routes.md +669 -0
  306. package/docs/uk/intlayer_with_svelte_kit.md +579 -0
  307. package/docs/uk/intlayer_with_tanstack.md +818 -0
  308. package/docs/uk/intlayer_with_vite+preact.md +1748 -0
  309. package/docs/uk/intlayer_with_vite+react.md +1449 -0
  310. package/docs/uk/intlayer_with_vite+solid.md +302 -0
  311. package/docs/uk/intlayer_with_vite+svelte.md +520 -0
  312. package/docs/uk/intlayer_with_vite+vue.md +1113 -0
  313. package/docs/uk/introduction.md +222 -0
  314. package/docs/uk/locale_mapper.md +242 -0
  315. package/docs/uk/mcp_server.md +211 -0
  316. package/docs/uk/packages/express-intlayer/t.md +465 -0
  317. package/docs/uk/packages/intlayer/getConfiguration.md +145 -0
  318. package/docs/uk/packages/intlayer/getEnumeration.md +159 -0
  319. package/docs/uk/packages/intlayer/getHTMLTextDir.md +121 -0
  320. package/docs/uk/packages/intlayer/getLocaleLang.md +81 -0
  321. package/docs/uk/packages/intlayer/getLocaleName.md +135 -0
  322. package/docs/uk/packages/intlayer/getLocalizedUrl.md +338 -0
  323. package/docs/uk/packages/intlayer/getMultilingualUrls.md +359 -0
  324. package/docs/uk/packages/intlayer/getPathWithoutLocale.md +75 -0
  325. package/docs/uk/packages/intlayer/getPrefix.md +213 -0
  326. package/docs/uk/packages/intlayer/getTranslation.md +190 -0
  327. package/docs/uk/packages/intlayer/getTranslationContent.md +189 -0
  328. package/docs/uk/packages/next-intlayer/t.md +365 -0
  329. package/docs/uk/packages/next-intlayer/useDictionary.md +276 -0
  330. package/docs/uk/packages/next-intlayer/useIntlayer.md +263 -0
  331. package/docs/uk/packages/next-intlayer/useLocale.md +166 -0
  332. package/docs/uk/packages/react-intlayer/t.md +311 -0
  333. package/docs/uk/packages/react-intlayer/useDictionary.md +295 -0
  334. package/docs/uk/packages/react-intlayer/useI18n.md +250 -0
  335. package/docs/uk/packages/react-intlayer/useIntlayer.md +251 -0
  336. package/docs/uk/packages/react-intlayer/useLocale.md +210 -0
  337. package/docs/uk/per_locale_file.md +345 -0
  338. package/docs/uk/plugins/sync-json.md +398 -0
  339. package/docs/uk/readme.md +265 -0
  340. package/docs/uk/releases/v6.md +305 -0
  341. package/docs/uk/releases/v7.md +624 -0
  342. package/docs/uk/roadmap.md +346 -0
  343. package/docs/uk/testing.md +204 -0
  344. package/docs/uk/vs_code_extension.md +133 -0
  345. package/docs/vi/configuration.md +6 -1
  346. package/docs/vi/dictionary/content_file.md +6 -1
  347. package/docs/vi/intlayer_with_next-i18next.md +0 -1
  348. package/docs/vi/intlayer_with_nextjs_14.md +28 -0
  349. package/docs/vi/intlayer_with_nextjs_15.md +28 -0
  350. package/docs/vi/intlayer_with_nextjs_16.md +28 -0
  351. package/docs/vi/intlayer_with_nextjs_no_locale_path.md +1151 -0
  352. package/docs/vi/plugins/sync-json.md +6 -2
  353. package/docs/zh/configuration.md +6 -1
  354. package/docs/zh/dictionary/content_file.md +6 -1
  355. package/docs/zh/intlayer_with_next-i18next.md +0 -1
  356. package/docs/zh/intlayer_with_nextjs_14.md +28 -0
  357. package/docs/zh/intlayer_with_nextjs_15.md +28 -0
  358. package/docs/zh/intlayer_with_nextjs_16.md +28 -0
  359. package/docs/zh/intlayer_with_nextjs_no_locale_path.md +1206 -0
  360. package/docs/zh/plugins/sync-json.md +9 -5
  361. package/frequent_questions/ar/SSR_Next_no_[locale].md +1 -1
  362. package/frequent_questions/ar/error-vite-env-only.md +77 -0
  363. package/frequent_questions/de/SSR_Next_no_[locale].md +1 -1
  364. package/frequent_questions/de/error-vite-env-only.md +77 -0
  365. package/frequent_questions/en/SSR_Next_no_[locale].md +1 -1
  366. package/frequent_questions/en/error-vite-env-only.md +77 -0
  367. package/frequent_questions/en-GB/SSR_Next_no_[locale].md +1 -1
  368. package/frequent_questions/en-GB/error-vite-env-only.md +77 -0
  369. package/frequent_questions/es/SSR_Next_no_[locale].md +1 -1
  370. package/frequent_questions/es/error-vite-env-only.md +76 -0
  371. package/frequent_questions/fr/SSR_Next_no_[locale].md +1 -1
  372. package/frequent_questions/fr/error-vite-env-only.md +77 -0
  373. package/frequent_questions/hi/SSR_Next_no_[locale].md +1 -1
  374. package/frequent_questions/hi/error-vite-env-only.md +77 -0
  375. package/frequent_questions/id/SSR_Next_no_[locale].md +1 -1
  376. package/frequent_questions/id/error-vite-env-only.md +77 -0
  377. package/frequent_questions/it/SSR_Next_no_[locale].md +1 -1
  378. package/frequent_questions/it/error-vite-env-only.md +77 -0
  379. package/frequent_questions/ja/SSR_Next_no_[locale].md +1 -1
  380. package/frequent_questions/ja/error-vite-env-only.md +77 -0
  381. package/frequent_questions/ko/SSR_Next_no_[locale].md +1 -1
  382. package/frequent_questions/ko/error-vite-env-only.md +77 -0
  383. package/frequent_questions/pl/SSR_Next_no_[locale].md +1 -1
  384. package/frequent_questions/pl/error-vite-env-only.md +77 -0
  385. package/frequent_questions/pt/SSR_Next_no_[locale].md +1 -1
  386. package/frequent_questions/pt/error-vite-env-only.md +77 -0
  387. package/frequent_questions/ru/SSR_Next_no_[locale].md +1 -1
  388. package/frequent_questions/ru/error-vite-env-only.md +77 -0
  389. package/frequent_questions/tr/SSR_Next_no_[locale].md +1 -1
  390. package/frequent_questions/tr/error-vite-env-only.md +77 -0
  391. package/frequent_questions/uk/SSR_Next_no_[locale].md +104 -0
  392. package/frequent_questions/uk/array_as_content_declaration.md +72 -0
  393. package/frequent_questions/uk/build_dictionaries.md +58 -0
  394. package/frequent_questions/uk/build_error_CI_CD.md +74 -0
  395. package/frequent_questions/uk/bun_set_up.md +53 -0
  396. package/frequent_questions/uk/customized_locale_list.md +64 -0
  397. package/frequent_questions/uk/domain_routing.md +113 -0
  398. package/frequent_questions/uk/error-vite-env-only.md +77 -0
  399. package/frequent_questions/uk/esbuild_error.md +29 -0
  400. package/frequent_questions/uk/get_locale_cookie.md +142 -0
  401. package/frequent_questions/uk/intlayer_command_undefined.md +155 -0
  402. package/frequent_questions/uk/locale_incorect_in_url.md +73 -0
  403. package/frequent_questions/uk/package_version_error.md +181 -0
  404. package/frequent_questions/uk/static_rendering.md +44 -0
  405. package/frequent_questions/uk/translated_path_url.md +55 -0
  406. package/frequent_questions/uk/unknown_command.md +97 -0
  407. package/frequent_questions/vi/SSR_Next_no_[locale].md +1 -1
  408. package/frequent_questions/vi/error-vite-env-only.md +77 -0
  409. package/frequent_questions/zh/SSR_Next_no_[locale].md +1 -1
  410. package/frequent_questions/zh/error-vite-env-only.md +77 -0
  411. package/legal/uk/privacy_notice.md +83 -0
  412. package/legal/uk/terms_of_service.md +55 -0
  413. package/package.json +6 -6
  414. package/src/generated/blog.entry.ts +29 -0
  415. package/src/generated/docs.entry.ts +119 -0
  416. package/src/generated/frequentQuestions.entry.ts +35 -0
  417. package/src/generated/legal.entry.ts +2 -0
@@ -0,0 +1,1154 @@
1
+ ---
2
+ createdAt: 2026-01-10
3
+ updatedAt: 2026-01-10
4
+ title: How to translate your Next.js 16 app (without [locale] in the page path) – i18n guide 2026
5
+ description: Discover how to make your Next.js 16 website multilingual without [locale] in the page path. Follow the documentation to internationalise (i18n) and translate it.
6
+ keywords:
7
+ - Internationalisation
8
+ - Documentation
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: Initial release
24
+ ---
25
+
26
+ # Translate your Next.js 16 site (without [locale] in the page path) using Intlayer | Internationalisation (i18n)
27
+
28
+ <Tab defaultTab="video">
29
+ <TabItem label="Video" value="video">
30
+
31
+ <iframe title="The best i18n solution for Next.js? Discover 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="Code" 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="Demo CodeSandbox - How to internationalise your application using 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
+ See [Application Template](https://github.com/aymericzip/intlayer-next-no-lolale-path-template) on GitHub.
48
+
49
+ ## Table of contents
50
+
51
+ <TOC/>
52
+
53
+ ## What is Intlayer?
54
+
55
+ **Intlayer** is an innovative, open-source internationalisation (i18n) library designed to simplify multilingual support in modern web applications. Intlayer seamlessly integrates with the latest **Next.js 16** framework, including its powerful **App Router**. It is optimised to work with **Server Components** for efficient rendering and is fully compatible with [**Turbopack**](https://nextjs.org/docs/architecture/turbopack).
56
+
57
+ With Intlayer, you can:
58
+
59
+ - **Easily manage translations** using declarative dictionaries at the component level.
60
+ - **Dynamically localise metadata, routes, and content.**
61
+ - **Access translations in both client-side and server-side components.**
62
+ - **Ensure TypeScript support** with auto-generated types, improving autocompletion and error detection.
63
+ - **Benefit from advanced features**, like dynamic locale detection and switching.
64
+
65
+ > Intlayer is compatible with Next.js 12, 13, 14, and 16. If you are using Next.js Page Router, you can refer to this [guide](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/intlayer_with_nextjs_page_router.md). For Next.js 12, 13, 14 with App Router, refer to this [guide](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/intlayer_with_nextjs_14.md).
66
+
67
+ ---
68
+
69
+ ## Step-by-Step Guide to Set Up Intlayer in a Next.js Application
70
+
71
+ ### Step 1: Install Dependencies
72
+
73
+ Install the necessary packages using 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
+ The core package that provides internationalisation tools for configuration management, translation, [content declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/dictionary/content_file.md), transpilation, and [CLI commands](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/cli/index.md).
98
+
99
+ - **next-intlayer**
100
+
101
+ The package that integrates Intlayer with Next.js. It provides context providers and hooks for Next.js internationalisation. Additionally, it includes the Next.js plugin for integrating Intlayer with [Webpack](https://webpack.js.org/) or [Turbopack](https://nextjs.org/docs/app/api-reference/turbopack), as well as a proxy for detecting the user's preferred locale, managing cookies, and handling URL redirects.
102
+
103
+ ### Step 2: Configure Your Project
104
+
105
+ Here is the final structure we will create:
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
+ > If you do not want locale routing, intlayer can be used as a simple provider or hook. See [this guide](https://github.com/aymericzip/intlayer/blob/main/docs/docs/{{locale}}/intlayer_with_nextjs_no_locale_path.md) for more details.
132
+
133
+ Create a config file to configure the languages used by your application:
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
+ // Your other locales
145
+ ],
146
+ defaultLocale: Locales.ENGLISH,
147
+ },
148
+ routing: {
149
+ mode: "search-params", // or `no-prefix` — useful for middleware detection
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
+ // Your other locales
167
+ ],
168
+ defaultLocale: Locales.ENGLISH,
169
+ },
170
+ routing: {
171
+ mode: "search-params", // or `no-prefix` — useful for middleware detection
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
+ // Your other locales
189
+ ],
190
+ defaultLocale: Locales.ENGLISH,
191
+ },
192
+ routing: {
193
+ mode: "search-params", // or `no-prefix` - useful for middleware detection
194
+ },
195
+ };
196
+
197
+ module.exports = config;
198
+ ```
199
+
200
+ > Through this configuration file, you can set up localised URLs, proxy redirection, cookie names, the location and extension of your content declarations, disable Intlayer logs in the console, and more. For a complete list of available parameters, refer to the [configuration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/configuration.md).
201
+
202
+ ### Step 3: Integrate Intlayer into your Next.js configuration
203
+
204
+ Configure your Next.js setup to use 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
+ /* config options here */
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
+ /* configuration options go here */
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
+ /* configuration options go here */
234
+ };
235
+
236
+ module.exports = withIntlayer(nextConfig);
237
+ ```
238
+
239
+ > The `withIntlayer()` Next.js plugin is used to integrate Intlayer with Next.js. It builds content declaration files and watches them in development mode. It defines Intlayer environment variables within the [Webpack](https://webpack.js.org/) or [Turbopack](https://nextjs.org/docs/app/api-reference/turbopack) environments. Additionally, it provides aliases to optimise performance and ensures compatibility with server components.
240
+
241
+ > The `withIntlayer()` function returns a promise. It allows you to prepare the Intlayer dictionaries before the build starts. If you want to use it with other plugins, you can await it. Example:
242
+ >
243
+ > ```ts
244
+ > const nextConfig = await withIntlayer(nextConfig);
245
+ > const nextConfigWithOtherPlugins = withOtherPlugins(nextConfig);
246
+ >
247
+ > export default nextConfigWithOtherPlugins;
248
+ > ```
249
+ >
250
+ > If you want to use it synchronously, use the `withIntlayerSync()` function. For example:
251
+ >
252
+ > ```ts
253
+ > const nextConfig = withIntlayerSync(nextConfig);
254
+ > const nextConfigWithOtherPlugins = withOtherPlugins(nextConfig);
255
+ >
256
+ > export default nextConfigWithOtherPlugins;
257
+ > ```
258
+ >
259
+ > Intlayer automatically detects whether your project is using **webpack** or **Turbopack** based on the command-line flags `--webpack`, `--turbo`, or `--turbopack`, as well as your current **Next.js version**.
260
+ >
261
+ > Since `next>=16`, if you are using **Rspack**, you must explicitly force Intlayer to use the webpack configuration by disabling Turbopack:
262
+ >
263
+ > ```ts
264
+ > withRspack(withIntlayer(nextConfig, { enableTurbopack: false }));
265
+ > ```
266
+
267
+ ### Step 4: Define dynamic locale routes
268
+
269
+ Remove everything from `RootLayout` and replace it with the following code:
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
+ export { generateStaticParams } from "next-intlayer";
318
+
319
+ export const generateMetadata = async ({ params }) => {
320
+ const { locale } = await params;
321
+ const { title, description, keywords } = getIntlayer("metadata", locale);
322
+
323
+ return {
324
+ title,
325
+ description,
326
+ keywords,
327
+ };
328
+ };
329
+
330
+ const RootLayout = async ({ children }) => {
331
+ const locale = await getLocale();
332
+
333
+ return (
334
+ <html lang={locale} dir={getHTMLTextDir(locale)}>
335
+ <IntlayerClientProvider defaultLocale={locale}>
336
+ <body>{children}</body>
337
+ </IntlayerClientProvider>
338
+ </html>
339
+ );
340
+ };
341
+
342
+ export default RootLayout;
343
+ ```
344
+
345
+ ```jsx {1,8} fileName="src/app/layout.csx" codeFormat="commonjs"
346
+ require("./globals.css");
347
+ const { IntlayerClientProvider } = require("next-intlayer");
348
+ const { getHTMLTextDir, getIntlayer } = require("intlayer");
349
+ const { getLocale } = require("next-intlayer/server");
350
+ const { generateStaticParams } = require("next-intlayer");
351
+
352
+ const generateMetadata = async ({ params }) => {
353
+ const { locale } = await params;
354
+ const { title, description, keywords } = getIntlayer("metadata", locale);
355
+
356
+ return {
357
+ title,
358
+ description,
359
+ keywords,
360
+ };
361
+ };
362
+
363
+ const RootLayout = async ({ children }) => {
364
+ const locale = await getLocale();
365
+
366
+ return (
367
+ <html lang={locale} dir={getHTMLTextDir(locale)}>
368
+ <IntlayerClientProvider defaultLocale={locale}>
369
+ <body>{children}</body>
370
+ </IntlayerClientProvider>
371
+ </html>
372
+ );
373
+ };
374
+
375
+ module.exports = {
376
+ default: RootLayout,
377
+ generateStaticParams,
378
+ generateMetadata,
379
+ };
380
+ ```
381
+
382
+ ### Step 5: Declare your content
383
+
384
+ Create and manage your content declarations to store translations:
385
+
386
+ ```tsx fileName="src/app/metadata.content.ts" contentDeclarationFormat="typescript"
387
+ import { t, type Dictionary } from "intlayer";
388
+ import { Metadata } from "next";
389
+
390
+ const metadataContent = {
391
+ key: "metadata",
392
+ content: {
393
+ title: t({
394
+ "en-GB": "My Project Title",
395
+ en: "My Project Title",
396
+ fr: "Le Titre de mon Projet",
397
+ es: "El Título de mi Proyecto",
398
+ }),
399
+
400
+ description: t({
401
+ "en-GB":
402
+ "Discover our innovative platform designed to streamline your workflow and boost productivity.",
403
+ en: "Discover our innovative platform designed to streamline your workflow and boost productivity.",
404
+ fr: "Découvrez notre plateforme innovante conçue pour simplifier votre flux de travail et booster votre productivité.",
405
+ es: "Descubra nuestra plataforma innovadora diseñada para simplificar su flujo de trabajo y aumentar su productividad.",
406
+ }),
407
+
408
+ keywords: t({
409
+ "en-GB": ["innovation", "productivity", "workflow", "SaaS"],
410
+ en: ["innovation", "productivity", "workflow", "SaaS"],
411
+ "en-GB": ["innovation", "productivity", "workflow", "SaaS"],
412
+ fr: ["innovation", "productivité", "flux de travail", "SaaS"],
413
+ es: ["innovación", "productividad", "flujo de trabajo", "SaaS"],
414
+ }),
415
+ },
416
+ } as Dictionary<Metadata>;
417
+
418
+ export default metadataContent;
419
+ ```
420
+
421
+ ```tsx fileName="src/app/metadata.content.mjs" contentDeclarationFormat="typescript"
422
+ import { t, type Dictionary } from "intlayer";
423
+
424
+ /** @type {import('intlayer').Dictionary<import('next').Metadata>} */
425
+ const metadataContent = {
426
+ key: "metadata",
427
+ content: {
428
+ title: t({
429
+ "en-GB": "My Project Title",
430
+ en: "My Project Title",
431
+ fr: "Le Titre de mon Projet",
432
+ es: "El Título de mi Proyecto",
433
+ }),
434
+
435
+ description: t({
436
+ "en-GB":
437
+ "Discover our innovative platform designed to streamline your workflow and boost productivity.",
438
+ en: "Discover our innovative platform designed to streamline your workflow and boost productivity.",
439
+ "en-GB":
440
+ "Discover our innovative platform designed to streamline your workflow and boost productivity.",
441
+ fr: "Découvrez notre plateforme innovante conçue pour simplifier votre flux de travail et booster votre productivité.",
442
+ es: "Descubra nuestra plataforma innovadora diseñada para simplificar su flujo de trabajo y aumentar su productividad.",
443
+ }),
444
+
445
+ keywords: t({
446
+ "en-GB": ["innovation", "productivity", "workflow", "SaaS"],
447
+ en: ["innovation", "productivity", "workflow", "SaaS"],
448
+ fr: ["innovation", "productivité", "flux de travail", "SaaS"],
449
+ es: ["innovación", "productividad", "flujo de trabajo", "SaaS"],
450
+ }),
451
+ },
452
+ };
453
+
454
+ export default metadataContent;
455
+ ```
456
+
457
+ ```javascript fileName="src/app/metadata.content.cjs" contentDeclarationFormat="commonjs"
458
+ const { t } = require("intlayer");
459
+
460
+ /** @type {import('intlayer').Dictionary<import('next').Metadata>} */
461
+ const metadataContent = {
462
+ key: "metadata",
463
+ content: {
464
+ title: t({
465
+ "en-GB": "My Project Title",
466
+ en: "My Project Title",
467
+ fr: "Le Titre de mon Projet",
468
+ es: "El Título de mi Proyecto",
469
+ }),
470
+
471
+ description: t({
472
+ "en-GB":
473
+ "Discover our innovative platform designed to streamline your workflow and boost productivity.",
474
+ en: "Discover our innovative platform designed to streamline your workflow and boost productivity.",
475
+ fr: "Découvrez notre plateforme innovante conçue pour simplifier votre flux de travail et booster votre productivité.",
476
+ es: "Descubra nuestra plataforma innovadora diseñada para simplificar su flujo de trabajo y aumentar su productividad.",
477
+ }),
478
+
479
+ keywords: t({
480
+ "en-GB": ["innovation", "productivity", "workflow", "SaaS"],
481
+ en: ["innovation", "productivity", "workflow", "SaaS"],
482
+ fr: ["innovation", "productivité", "flux de travail", "SaaS"],
483
+ es: ["innovación", "productividad", "flujo de trabajo", "SaaS"],
484
+ }),
485
+ },
486
+ };
487
+
488
+ module.exports = metadataContent;
489
+ ```
490
+
491
+ ```json fileName="src/app/metadata.content.json" contentDeclarationFormat="json"
492
+ {
493
+ "key": "metadata",
494
+ "content": {
495
+ "title": {
496
+ "nodeType": "translation",
497
+ "translation": {
498
+ "en-GB": "My Project Title",
499
+ "en": "My Project Title",
500
+ "fr": "Le Titre de mon Projet",
501
+ "es": "El Título de mi Proyecto"
502
+ }
503
+ },
504
+ "description": {
505
+ "nodeType": "translation",
506
+ "translation": {
507
+ "en-GB": "Discover our innovative platform designed to streamline your workflow and boost productivity.",
508
+ "en": "Discover our innovative platform designed to streamline your workflow and boost productivity.",
509
+ "fr": "Découvrez notre plateforme innovante conçue pour simplifier votre flux de travail et booster votre productivité.",
510
+ "es": "Descubra nuestra plataforma innovadora diseñada para simplificar su flujo de trabajo y aumentar su productividad."
511
+ }
512
+ },
513
+ "keywords": {
514
+ "nodeType": "translation",
515
+ "translation": {
516
+ "en-GB": ["innovation", "productivity", "workflow", "SaaS"],
517
+ "en": ["innovation", "productivity", "workflow", "SaaS"],
518
+ "fr": ["innovation", "productivité", "flux de travail", "SaaS"],
519
+ "es": ["innovación", "productividad", "flujo de trabajo", "SaaS"]
520
+ }
521
+ }
522
+ }
523
+ }
524
+ ```
525
+
526
+ ```tsx fileName="src/app/page.content.ts" contentDeclarationFormat="typescript"
527
+ import { t, type Dictionary } from "intlayer";
528
+
529
+ const pageContent = {
530
+ key: "page",
531
+ content: {
532
+ getStarted: {
533
+ main: t({
534
+ "en-GB": "Get started by editing",
535
+ en: "Get started by editing",
536
+ fr: "Commencez par éditer",
537
+ es: "Comience por editar",
538
+ }),
539
+ pageLink: "src/app/page.tsx",
540
+ },
541
+ },
542
+ } satisfies Dictionary;
543
+
544
+ export default pageContent;
545
+ ```
546
+
547
+ ```javascript fileName="src/app/page.content.mjs" contentDeclarationFormat="esm"
548
+ import { t } from "intlayer";
549
+
550
+ /** @type {import('intlayer').Dictionary} */
551
+ const pageContent = {
552
+ key: "page",
553
+ content: {
554
+ getStarted: {
555
+ main: t({
556
+ "en-GB": "Get started by editing",
557
+ en: "Get started by editing",
558
+ fr: "Commencez par éditer",
559
+ es: "Comience por editar",
560
+ }),
561
+ pageLink: "src/app/page.tsx",
562
+ },
563
+ },
564
+ };
565
+
566
+ export default pageContent;
567
+ ```
568
+
569
+ ```javascript fileName="src/app/page.content.cjs" contentDeclarationFormat="commonjs"
570
+ const { t } = require("intlayer");
571
+
572
+ /** @type {import('intlayer').Dictionary} */
573
+ const pageContent = {
574
+ key: "page",
575
+ content: {
576
+ getStarted: {
577
+ main: t({
578
+ "en-GB": "Get started by editing",
579
+ en: "Get started by editing",
580
+ fr: "Commencez par éditer",
581
+ es: "Comience por editar",
582
+ }),
583
+ pageLink: "src/app/page.tsx",
584
+ },
585
+ },
586
+ };
587
+
588
+ module.exports = pageContent;
589
+ ```
590
+
591
+ ```json fileName="src/app/page.content.json" contentDeclarationFormat="json"
592
+ {
593
+ "$schema": "https://intlayer.org/schema.json",
594
+ "key": "page",
595
+ "content": {
596
+ "getStarted": {
597
+ "nodeType": "translation",
598
+ "translation": {
599
+ "en-GB": "Get started by editing",
600
+ "en": "Get started by editing",
601
+ "fr": "Commencez par éditer",
602
+ "es": "Comience por editar"
603
+ }
604
+ },
605
+ "pageLink": "src/app/page.tsx"
606
+ }
607
+ }
608
+ ```
609
+
610
+ > Your content declarations can be defined anywhere in your application, provided they are placed in the `contentDir` directory (by default, `./src`) and use the content declaration file extensions (by default, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
611
+
612
+ > For more details, refer to the [content declaration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/dictionary/content_file.md).
613
+
614
+ ### Step 6: Utilise Content in Your Code
615
+
616
+ Access your content dictionaries throughout your application:
617
+
618
+ ```tsx fileName="src/app/page.tsx" codeFormat="typescript"
619
+ import type { FC } from "react";
620
+ import { ClientComponentExample } from "@components/clientComponentExample/ClientComponentExample";
621
+ import { ServerComponentExample } from "@components/serverComponentExample/ServerComponentExample";
622
+ import {
623
+ IntlayerServerProvider,
624
+ useIntlayer,
625
+ getLocale,
626
+ } from "next-intlayer/server";
627
+ import { NextPage } from "next";
628
+ import { headers, cookies } from "next/headers";
629
+
630
+ const PageContent: FC = () => {
631
+ const content = useIntlayer("page");
632
+
633
+ return (
634
+ <>
635
+ <p>{content.getStarted.main}</p>
636
+ <code>{content.getStarted.pageLink}</code>
637
+ </>
638
+ );
639
+ };
640
+
641
+ const Page: NextPage = async () => {
642
+ const locale = await getLocale();
643
+
644
+ return (
645
+ <IntlayerServerProvider locale={locale}>
646
+ <PageContent />
647
+ <ServerComponentExample />
648
+ <ClientComponentExample />
649
+ </IntlayerServerProvider>
650
+ );
651
+ };
652
+
653
+ export default Page;
654
+ ```
655
+
656
+ ```jsx fileName="src/app/page.mjx" codeFormat="esm"
657
+ import { ClientComponentExample } from "@components/clientComponentExample/ClientComponentExample";
658
+ import { ServerComponentExample } from "@components/serverComponentExample/ServerComponentExample";
659
+ import { IntlayerServerProvider, useIntlayer } from "next-intlayer/server";
660
+ import { getLocale } from "intlayer";
661
+ import { headers, cookies } from "next/headers";
662
+ import { NextPage } from "next";
663
+
664
+ const Page: NextPage = async () => {
665
+ const content = useIntlayer("page");
666
+
667
+ return (
668
+ <>
669
+ <p>{content.getStarted.main}</p>
670
+ <code>{content.getStarted.pageLink}</code>
671
+ </>
672
+ );
673
+ };
674
+
675
+ const Page = async () => {
676
+
677
+ const locale = await getLocale();
678
+
679
+ return (
680
+ <IntlayerServerProvider locale={locale}>
681
+ <PageContent />
682
+ <ServerComponentExample />
683
+ <ClientComponentExample />
684
+ </IntlayerServerProvider>
685
+ );
686
+ };
687
+
688
+ export default Page;
689
+ ```
690
+
691
+ ```jsx fileName="src/app/page.csx" codeFormat="commonjs"
692
+ import { ClientComponentExample } from "@components/clientComponentExample/ClientComponentExample";
693
+ import { ServerComponentExample } from "@components/serverComponentExample/ServerComponentExample";
694
+ import { IntlayerServerProvider, useIntlayer, getLocale } from "next-intlayer/server";
695
+ import { NextPage } from "next";
696
+ import { headers, cookies } from "next/headers";
697
+
698
+ const Page: NextPage = async () => {
699
+ const content = useIntlayer("page");
700
+
701
+ return (
702
+ <>
703
+ <p>{content.getStarted.main}</p>
704
+ <code>{content.getStarted.pageLink}</code>
705
+ </>
706
+ );
707
+ };
708
+
709
+ const Page: NextPage = async () => {
710
+ const locale = await getLocale();
711
+
712
+ return (
713
+ <IntlayerServerProvider locale={locale}>
714
+ <PageContent />
715
+ <ServerComponentExample />
716
+ <ClientComponentExample />
717
+ </IntlayerServerProvider>
718
+ );
719
+ };
720
+ ```
721
+
722
+ - **`IntlayerClientProvider`** is used to provide the locale to client-side components. It can be placed in any parent component, including the layout. However, placing it in a layout is recommended because Next.js shares layout code across pages, making it more efficient. By using `IntlayerClientProvider` in the layout, you avoid reinitialising it for every page, improving performance and maintaining a consistent localisation context throughout your application.
723
+ - **`IntlayerServerProvider`** is used to provide the locale to the server-side children. It cannot be set in the layout.
724
+
725
+ > Layouts and pages cannot share a common server context because the server context system is based on a per-request data store (via [React's cache](https://react.dev/reference/react/cache) mechanism), causing each "context" to be re-created for different segments of the application. Placing the provider in a shared layout would break this isolation, preventing the correct propagation of the server context values to your server components.
726
+
727
+ ```tsx {4,7} fileName="src/components/clientComponentExample/ClientComponentExample.tsx" codeFormat="typescript"
728
+ "use client";
729
+
730
+ import type { FC } from "react";
731
+ import { useIntlayer } from "next-intlayer";
732
+
733
+ export const ClientComponentExample: FC = () => {
734
+ const content = useIntlayer("client-component-example"); // Declare related content
735
+
736
+ return (
737
+ <div>
738
+ <h2>{content.title}</h2>
739
+ <p>{content.content}</p>
740
+ </div>
741
+ );
742
+ };
743
+ ```
744
+
745
+ ```jsx {3,6} fileName="src/components/clientComponentExample/ClientComponentExample.mjx" codeFormat="esm"
746
+ "use client";
747
+
748
+ import { useIntlayer } from "next-intlayer";
749
+
750
+ const ClientComponentExample = () => {
751
+ const content = useIntlayer("client-component-example"); // Declare related content
752
+
753
+ return (
754
+ <div>
755
+ <h2>{content.title}</h2>
756
+ <p>{content.content}</p>
757
+ </div>
758
+ );
759
+ };
760
+ ```
761
+
762
+ ```jsx {3,6} fileName="src/components/clientComponentExample/ClientComponentExample.csx" codeFormat="commonjs"
763
+ "use client";
764
+
765
+ const { useIntlayer } = require("next-intlayer");
766
+
767
+ const ClientComponentExample = () => {
768
+ const content = useIntlayer("client-component-example"); // Create the related content declaration
769
+
770
+ return (
771
+ <div>
772
+ <h2>{content.title}</h2>
773
+ <p>{content.content}</p>
774
+ </div>
775
+ );
776
+ };
777
+ ```
778
+
779
+ ```tsx {2} fileName="src/components/serverComponentExample/ServerComponentExample.tsx" codeFormat="typescript"
780
+ import type { FC } from "react";
781
+ import { useIntlayer } from "next-intlayer/server";
782
+
783
+ export const ServerComponentExample: FC = () => {
784
+ const content = useIntlayer("server-component-example"); // Create the related content declaration
785
+
786
+ return (
787
+ <div>
788
+ <h2>{content.title}</h2>
789
+ <p>{content.content}</p>
790
+ </div>
791
+ );
792
+ };
793
+ ```
794
+
795
+ ```jsx {1} fileName="src/components/serverComponentExample/ServerComponentExample.mjx" codeFormat="esm"
796
+ import { useIntlayer } from "next-intlayer/server";
797
+
798
+ const ServerComponentExample = () => {
799
+ const content = useIntlayer("server-component-example"); // Create a related content declaration
800
+
801
+ return (
802
+ <div>
803
+ <h2>{content.title}</h2>
804
+ <p>{content.content}</p>
805
+ </div>
806
+ );
807
+ };
808
+ ```
809
+
810
+ ```jsx {1} fileName="src/components/serverComponentExample/ServerComponentExample.csx" codeFormat="commonjs"
811
+ const { useIntlayer } = require("next-intlayer/server");
812
+
813
+ const ServerComponentExample = () => {
814
+ const content = useIntlayer("server-component-example"); // Create a related content declaration
815
+
816
+ return (
817
+ <div>
818
+ <h2>{content.title}</h2>
819
+ <p>{content.content}</p>
820
+ </div>
821
+ );
822
+ };
823
+ ```
824
+
825
+ > If you want to use your content in a `string` attribute, such as `alt`, `title`, `href`, `aria-label`, etc., you must call the value of the function, for example:
826
+
827
+ > ```jsx
828
+ > <img src={content.image.src.value} alt={content.image.value} />
829
+ > ```
830
+
831
+ > To learn more about the `useIntlayer` hook, refer to the [documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/next-intlayer/useIntlayer.md).
832
+
833
+ ### (Optional) Step 7: Configure Proxy for Locale Detection
834
+
835
+ Set up the proxy to detect the user's preferred locale:
836
+
837
+ ```typescript fileName="src/proxy.ts" codeFormat="typescript"
838
+ export { intlayerProxy as proxy } from "next-intlayer/proxy";
839
+
840
+ export const config = {
841
+ matcher:
842
+ "/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
843
+ };
844
+ ```
845
+
846
+ ```javascript fileName="src/proxy.mjs" codeFormat="esm"
847
+ export { intlayerProxy as proxy } from "next-intlayer/proxy";
848
+
849
+ export const config = {
850
+ matcher:
851
+ "/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
852
+ };
853
+ ```
854
+
855
+ ```javascript fileName="src/proxy.cjs" codeFormat="commonjs"
856
+ const { intlayerProxy } = require("next-intlayer/proxy");
857
+
858
+ const config = {
859
+ matcher:
860
+ "/((?!api|static|assets|robots|sitemap|sw|service-worker|manifest|.*\\..*|_next).*)",
861
+ };
862
+
863
+ module.exports = { proxy: intlayerProxy, config };
864
+ ```
865
+
866
+ > The `intlayerProxy` is used to detect the user's preferred locale and redirect them to the appropriate URL as specified in the [configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/configuration.md). Additionally, it allows saving the user's preferred locale in a cookie.
867
+
868
+ > If you need to chain several proxies together (for example, `intlayerProxy` with authentication or custom proxies), Intlayer now provides a helper called `multipleProxies`.
869
+
870
+ ```ts
871
+ import { multipleProxies, intlayerProxy } from "next-intlayer/proxy";
872
+ import { customProxy } from "@utils/customProxy";
873
+
874
+ export const proxy = multipleProxies([intlayerProxy, customProxy]);
875
+ ```
876
+
877
+ ### (Optional) Step 8: Change the language of your content
878
+
879
+ To change the language of your content in Next.js, the recommended approach is to use the `Link` component to navigate users to the appropriate localised page. The `Link` component enables prefetching of the page, which helps avoid a full page reload.
880
+
881
+ ```tsx fileName="src/components/localeSwitcher/LocaleSwitcher.tsx" codeFormat="typescript"
882
+ "use client";
883
+
884
+ import type { FC } from "react";
885
+ import { Locales, getHTMLTextDir, getLocaleName } from "intlayer";
886
+ import { useLocale } from "next-intlayer";
887
+
888
+ export const LocaleSwitcher: FC = () => {
889
+ const { locale, availableLocales, setLocale } = useLocale({
890
+ onChange: () => window.location.reload(),
891
+ });
892
+
893
+ return (
894
+ <div>
895
+ <button popoverTarget="localePopover">{getLocaleName(locale)}</button>
896
+ <div id="localePopover" popover="auto">
897
+ {availableLocales.map((localeItem) => (
898
+ <button
899
+ key={localeItem}
900
+ aria-current={locale === localeItem ? "page" : undefined}
901
+ onClick={() => setLocale(localeItem)}
902
+ >
903
+ <span>
904
+ {/* Locale — e.g. FR */}
905
+ {localeItem}
906
+ </span>
907
+ <span>
908
+ {/* Language in its own locale — e.g. Français */}
909
+ {getLocaleName(localeItem, locale)}
910
+ </span>
911
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
912
+ {/* Language in the current locale — e.g. Francés with current locale set to Locales.SPANISH */}
913
+ {getLocaleName(localeItem)}
914
+ </span>
915
+ <span dir="ltr" lang={Locales.ENGLISH}>
916
+ {/* Language in English — e.g. French */}
917
+ {getLocaleName(localeItem, Locales.ENGLISH)}
918
+ </span>
919
+ </button>
920
+ ))}
921
+ </div>
922
+ </div>
923
+ );
924
+ };
925
+ ```
926
+
927
+ ```jsx fileName="src/components/localeSwitcher/LocaleSwitcher.msx" codeFormat="esm"
928
+ "use client";
929
+
930
+ import { Locales, getHTMLTextDir, getLocaleName } from "intlayer";
931
+ import { useLocale } from "next-intlayer";
932
+
933
+ export const LocaleSwitcher = () => {
934
+ const { locale, availableLocales, setLocale } = useLocale({
935
+ onChange: () => window.location.reload(),
936
+ });
937
+
938
+ return (
939
+ <div>
940
+ <button popoverTarget="localePopover">{getLocaleName(locale)}</button>
941
+ <div id="localePopover" popover="auto">
942
+ {availableLocales.map((localeItem) => (
943
+ <button
944
+ key={localeItem}
945
+ aria-current={locale === localeItem ? "page" : undefined}
946
+ onClick={() => setLocale(localeItem)}
947
+ >
948
+ <span>
949
+ {/* Locale — e.g. FR */}
950
+ {localeItem}
951
+ </span>
952
+ <span>
953
+ {/* Language in its own locale — e.g. Français */}
954
+ {getLocaleName(localeItem, locale)}
955
+ </span>
956
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
957
+ {/* Language in the current locale — e.g. Francés when the current locale is set to Locales.SPANISH */}
958
+ {getLocaleName(localeItem)}
959
+ </span>
960
+ <span dir="ltr" lang={Locales.ENGLISH}>
961
+ {/* Language in English — e.g. French */}
962
+ {getLocaleName(localeItem, Locales.ENGLISH)}
963
+ </span>
964
+ </button>
965
+ ))}
966
+ </div>
967
+ </div>
968
+ );
969
+ };
970
+ ```
971
+
972
+ ```jsx fileName="src/components/localeSwitcher/LocaleSwitcher.csx" codeFormat="commonjs"
973
+ "use client";
974
+
975
+ const { Locales, getHTMLTextDir, getLocaleName } = require("intlayer");
976
+ const { useLocale } = require("next-intlayer");
977
+
978
+ export const LocaleSwitcher = () => {
979
+ const path
980
+ const { locale availableLocales, setLocale } = useLocale({
981
+ onChange: ()=> window.location.reload(),
982
+ });
983
+
984
+ return (
985
+ <div>
986
+ <button popoverTarget="localePopover">{getLocaleName(locale)}</button>
987
+ <div id="localePopover" popover="auto">
988
+ {availableLocales.map((localeItem) => (
989
+ <button
990
+ key={localeItem}
991
+ aria-current={locale === localeItem ? "page" : undefined}
992
+ onClick={() => setLocale(localeItem)}
993
+ >
994
+ <span>
995
+ {/* Locale — e.g. FR */}
996
+ {localeItem}
997
+ </span>
998
+ <span>
999
+ {/* Language in its own locale — e.g. Français */}
1000
+ {getLocaleName(localeItem, locale)}
1001
+ </span>
1002
+ <span dir={getHTMLTextDir(localeItem)} lang={localeItem}>
1003
+ {/* Language in the current locale — e.g. Francés when current locale is Locales.SPANISH */}
1004
+ {getLocaleName(localeItem)}
1005
+ </span>
1006
+ <span dir="ltr" lang={Locales.ENGLISH}>
1007
+ {/* Language in English — e.g. French */}
1008
+ {getLocaleName(localeItem, Locales.ENGLISH)}
1009
+ </span>
1010
+ </button>
1011
+ ))}
1012
+ </div>
1013
+ </div>
1014
+ );
1015
+ };
1016
+ ```
1017
+
1018
+ > An alternative is to use the `setLocale` function provided by the `useLocale` hook. This function does not allow prefetching the page. See the [`useLocale` hook documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/next-intlayer/useLocale.md) for more details.
1019
+
1020
+ > Documentation references:
1021
+ >
1022
+ > - [`useLocale` hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/next-intlayer/useLocale.md)
1023
+ > - [`getLocaleName` hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/next-intlayer/getLocaleName.md)
1024
+ > - [`getLocalizedUrl` hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/next-intlayer/getLocalizedUrl.md)
1025
+ > - [`getHTMLTextDir` hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/packages/intlayer/getHTMLTextDir.md)
1026
+ > - [`hrefLang` attribute](https://developers.google.com/search/docs/specialty/international/localized-versions?hl=fr)
1027
+ > - [`lang` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)
1028
+ > - [`dir` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)
1029
+ > - [`aria-current` attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)
1030
+
1031
+ ### (Optional) Step 9: Get the current locale in Server Actions
1032
+
1033
+ If you need the active locale inside a Server Action (e.g., to localise emails or run locale-aware logic), call `getLocale` from `next-intlayer/server`:
1034
+
1035
+ ```tsx fileName="src/app/actions/getLocale.ts" codeFormat="typescript"
1036
+ "use server";
1037
+
1038
+ import { getLocale } from "next-intlayer/server";
1039
+
1040
+ export const myServerAction = async () => {
1041
+ const locale = await getLocale();
1042
+
1043
+ // Do something with the locale
1044
+ };
1045
+ ```
1046
+
1047
+ > The `getLocale` function follows a cascading strategy to determine the user's locale:
1048
+ >
1049
+ > 1. First, it checks the request headers for a locale value that may have been set by a proxy
1050
+ > 2. If no locale is found in the headers, it looks for a locale stored in cookies.
1051
+ > 3. If no cookie is present, it attempts to detect the user's preferred language from the browser's settings.
1052
+ > 4. As a last resort, it falls back to the application's configured default locale.
1053
+ >
1054
+ > This ensures the most appropriate locale is selected based on the available context.
1055
+
1056
+ ### (Optional) Step 10: Optimise your bundle size
1057
+
1058
+ When using `next-intlayer`, dictionaries are included in the bundle for every page by default. To optimise bundle size, Intlayer provides an optional SWC plugin that intelligently replaces `useIntlayer` calls using macros. This ensures dictionaries are only included in bundles for pages that actually use them.
1059
+
1060
+ To enable this optimisation, install the `@intlayer/swc` package. Once installed, `next-intlayer` will automatically detect and use the plugin:
1061
+
1062
+ ```bash packageManager="npm"
1063
+ npm install @intlayer/swc --save-dev
1064
+ npx intlayer init
1065
+ ```
1066
+
1067
+ ```bash packageManager="pnpm"
1068
+ pnpm add @intlayer/swc --save-dev
1069
+ pnpm intlayer init
1070
+ ```
1071
+
1072
+ ```bash packageManager="yarn"
1073
+ yarn add @intlayer/swc --save-dev
1074
+ yarn intlayer init
1075
+ ```
1076
+
1077
+ ```bash packageManager="bun"
1078
+ bun add @intlayer/swc --dev
1079
+ bunx intlayer init
1080
+ ```
1081
+
1082
+ > Note: This optimisation is only available for Next.js 13 and above.
1083
+
1084
+ > Note: This package is not installed by default because SWC plugins are still experimental in Next.js. This may change in the future.
1085
+
1086
+ > Note: If you set the option to `importMode: 'dynamic'` or `importMode: 'live'`, it will rely on Suspense, so you will need to wrap your `useIntlayer` calls in a `Suspense` boundary. That means you will not be able to use `useIntlayer` directly at the top level of your page or layout component.
1087
+
1088
+ ### Watch dictionary changes on Turbopack
1089
+
1090
+ When using Turbopack as your development server with the `next dev` command, dictionary changes won't be detected automatically by default.
1091
+
1092
+ This limitation occurs because Turbopack cannot run webpack plugins in parallel to monitor changes to your content files. As a workaround, you'll need to use the `intlayer watch` command to run both the development server and the Intlayer build watcher simultaneously.
1093
+
1094
+ ```json5 fileName="package.json"
1095
+ {
1096
+ // ... Your existing package.json configuration
1097
+ "scripts": {
1098
+ // ... Your existing scripts configuration
1099
+ "dev": "intlayer watch --with 'next dev'",
1100
+ },
1101
+ }
1102
+ ```
1103
+
1104
+ > If you are using next-intlayer@<=6.x.x, you must keep the `--turbopack` flag to make the Next.js 16 application work correctly with Turbopack. We recommend using next-intlayer@>=7.x.x to avoid this limitation.
1105
+
1106
+ ### Configure TypeScript
1107
+
1108
+ Intlayer uses module augmentation to get the benefits of TypeScript and make your codebase more robust.
1109
+
1110
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
1111
+
1112
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
1113
+
1114
+ Ensure your TypeScript configuration includes the auto-generated types.
1115
+
1116
+ ```json5 fileName="tsconfig.json"
1117
+ {
1118
+ // ... Your existing TypeScript configuration
1119
+ "include": [
1120
+ // ... Your existing TypeScript configuration
1121
+ ".intlayer/**/*.ts", // Include the auto-generated types
1122
+ ],
1123
+ }
1124
+ ```
1125
+
1126
+ ### Git Configuration
1127
+
1128
+ It is recommended to ignore the files generated by Intlayer. This prevents you from committing them to your Git repository.
1129
+
1130
+ To do this, you can add the following entries to your `.gitignore` file:
1131
+
1132
+ ```plaintext fileName=".gitignore"
1133
+ # Ignore the files generated by Intlayer
1134
+ .intlayer
1135
+ ```
1136
+
1137
+ ### VS Code Extension
1138
+
1139
+ To enhance your development experience with Intlayer, you can install the official **Intlayer VS Code Extension**.
1140
+
1141
+ [Install from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
1142
+
1143
+ This extension provides:
1144
+
1145
+ - **Autocompletion** for translation keys.
1146
+ - **Real-time error detection** for missing translations.
1147
+ - **Inline previews** of translated content.
1148
+ - **Quick actions** to easily create and update translations.
1149
+
1150
+ For more details on how to use the extension, refer to the [Intlayer VS Code Extension documentation](https://intlayer.org/doc/vs-code-extension).
1151
+
1152
+ ### Going further
1153
+
1154
+ To go further, you can implement the [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/intlayer_visual_editor.md) or externalise your content using the [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/intlayer_CMS.md).