@intlayer/docs 9.1.3 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (482) hide show
  1. package/blog/ar/index.md +1 -1
  2. package/blog/ar/rag_powered_documentation_assistant.md +7 -0
  3. package/blog/de/index.md +1 -1
  4. package/blog/de/rag_powered_documentation_assistant.md +6 -0
  5. package/blog/en/index.md +1 -1
  6. package/blog/en-GB/index.md +1 -1
  7. package/blog/en-GB/rag_powered_documentation_assistant.md +6 -0
  8. package/blog/es/index.md +1 -1
  9. package/blog/es/rag_powered_documentation_assistant.md +7 -0
  10. package/blog/fr/i18n_meaning.md +7 -1
  11. package/blog/fr/index.md +1 -1
  12. package/blog/fr/list_i18n_technologies/frameworks/angular.md +5 -1
  13. package/blog/fr/rag_powered_documentation_assistant.md +6 -0
  14. package/blog/hi/index.md +1 -1
  15. package/blog/hi/next-i18next_vs_next-intl_vs_intlayer.md +119 -42
  16. package/blog/hi/rag_powered_documentation_assistant.md +7 -0
  17. package/blog/id/index.md +1 -1
  18. package/blog/id/rag_powered_documentation_assistant.md +6 -0
  19. package/blog/it/index.md +1 -1
  20. package/blog/it/rag_powered_documentation_assistant.md +6 -0
  21. package/blog/ja/index.md +1 -1
  22. package/blog/ja/rag_powered_documentation_assistant.md +7 -0
  23. package/blog/ko/index.md +1 -1
  24. package/blog/ko/list_i18n_technologies/frameworks/react.md +7 -7
  25. package/blog/ko/rag_powered_documentation_assistant.md +6 -0
  26. package/blog/pl/index.md +1 -1
  27. package/blog/pl/rag_powered_documentation_assistant.md +6 -0
  28. package/blog/pt/index.md +1 -1
  29. package/blog/pt/rag_powered_documentation_assistant.md +6 -0
  30. package/blog/ru/index.md +1 -1
  31. package/blog/ru/rag_powered_documentation_assistant.md +7 -0
  32. package/blog/tr/intlayer_with_react-intl.md +3 -1
  33. package/blog/tr/next-i18next_vs_next-intl_vs_intlayer.md +175 -42
  34. package/blog/tr/rag_powered_documentation_assistant.md +6 -0
  35. package/blog/uk/index.md +1 -1
  36. package/blog/uk/rag_powered_documentation_assistant.md +6 -0
  37. package/blog/vi/index.md +1 -1
  38. package/blog/vi/rag_powered_documentation_assistant.md +6 -0
  39. package/blog/zh/index.md +1 -1
  40. package/blog/zh/intlayer_with_i18next.md +87 -28
  41. package/blog/zh/intlayer_with_next-i18next.md +86 -29
  42. package/blog/zh/intlayer_with_next-intl.md +88 -28
  43. package/blog/zh/intlayer_with_react-i18next.md +87 -28
  44. package/blog/zh/intlayer_with_react-intl.md +88 -27
  45. package/blog/zh/intlayer_with_vue-i18n.md +117 -8
  46. package/blog/zh/rag_powered_documentation_assistant.md +6 -0
  47. package/dist/cjs/common.cjs +24 -1
  48. package/dist/cjs/common.cjs.map +1 -1
  49. package/dist/cjs/generated/blog.entry.cjs +58 -31
  50. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  51. package/dist/cjs/generated/docs.entry.cjs +265 -218
  52. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  53. package/dist/cjs/generated/frequentQuestions.entry.cjs +48 -21
  54. package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
  55. package/dist/cjs/generated/legal.entry.cjs +33 -6
  56. package/dist/cjs/generated/legal.entry.cjs.map +1 -1
  57. package/dist/esm/common.mjs +24 -1
  58. package/dist/esm/common.mjs.map +1 -1
  59. package/dist/esm/generated/blog.entry.mjs +58 -31
  60. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  61. package/dist/esm/generated/docs.entry.mjs +265 -218
  62. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  63. package/dist/esm/generated/frequentQuestions.entry.mjs +48 -21
  64. package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
  65. package/dist/esm/generated/legal.entry.mjs +33 -6
  66. package/dist/esm/generated/legal.entry.mjs.map +1 -1
  67. package/dist/types/common.d.ts.map +1 -1
  68. package/dist/types/generated/blog.entry.d.ts.map +1 -1
  69. package/dist/types/generated/docs.entry.d.ts +1 -0
  70. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  71. package/dist/types/generated/frequentQuestions.entry.d.ts.map +1 -1
  72. package/dist/types/generated/legal.entry.d.ts.map +1 -1
  73. package/docs/ar/analytics.md +222 -0
  74. package/docs/ar/autoFill.md +28 -9
  75. package/docs/ar/bundle_optimization.md +58 -25
  76. package/docs/ar/configuration.md +25 -8
  77. package/docs/ar/dictionary/file.md +3 -1
  78. package/docs/ar/dictionary/nesting.md +47 -30
  79. package/docs/ar/formatters.md +148 -193
  80. package/docs/ar/intlayer_CMS.md +152 -0
  81. package/docs/ar/intlayer_with_angular_21.md +9 -9
  82. package/docs/ar/intlayer_with_nextjs_14.md +1 -28
  83. package/docs/ar/intlayer_with_nextjs_15.md +1 -33
  84. package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +40 -83
  85. package/docs/ar/intlayer_with_solid_start.md +1078 -0
  86. package/docs/ar/intlayer_with_vite+vue.md +1 -3
  87. package/docs/ar/live-sync.md +4 -0
  88. package/docs/ar/packages/intlayer/getLocalizedUrl.md +26 -24
  89. package/docs/ar/packages/intlayer/getMultilingualUrls.md +4 -18
  90. package/docs/ar/packages/react-intlayer/useDictionary.md +4 -21
  91. package/docs/ar/packages/react-intlayer/useIntlayer.md +2 -2
  92. package/docs/ar/packages/vite-intlayer/exports.md +15 -0
  93. package/docs/ar/packages/vite-intlayer/intlayer.md +121 -6
  94. package/docs/ar/packages/vite-intlayer/intlayerPrune.md +70 -3
  95. package/docs/ar/releases/v9.md +0 -37
  96. package/docs/ar/self_hosting.md +46 -49
  97. package/docs/bn/bundle_optimization.md +58 -25
  98. package/docs/bn/configuration.md +25 -8
  99. package/docs/bn/intlayer_with_angular_21.md +9 -9
  100. package/docs/cs/bundle_optimization.md +58 -25
  101. package/docs/cs/configuration.md +25 -8
  102. package/docs/cs/intlayer_with_angular_21.md +9 -9
  103. package/docs/de/analytics.md +222 -0
  104. package/docs/de/autoFill.md +28 -9
  105. package/docs/de/bundle_optimization.md +58 -25
  106. package/docs/de/configuration.md +25 -8
  107. package/docs/de/dictionary/file.md +3 -1
  108. package/docs/de/dictionary/nesting.md +47 -31
  109. package/docs/de/formatters.md +208 -334
  110. package/docs/de/intlayer_CMS.md +66 -15
  111. package/docs/de/intlayer_with_angular_21.md +9 -9
  112. package/docs/de/intlayer_with_nestjs.md +11 -7
  113. package/docs/de/intlayer_with_nextjs_14.md +1 -28
  114. package/docs/de/intlayer_with_nextjs_15.md +1 -33
  115. package/docs/de/intlayer_with_solid_start.md +1078 -0
  116. package/docs/de/intlayer_with_vite+vue.md +1 -3
  117. package/docs/de/live-sync.md +4 -0
  118. package/docs/de/packages/intlayer/getLocalizedUrl.md +33 -25
  119. package/docs/de/packages/intlayer/getMultilingualUrls.md +4 -18
  120. package/docs/de/packages/react-intlayer/useDictionary.md +2 -5
  121. package/docs/de/packages/vite-intlayer/exports.md +15 -0
  122. package/docs/de/packages/vite-intlayer/intlayer.md +121 -6
  123. package/docs/de/packages/vite-intlayer/intlayerPrune.md +77 -4
  124. package/docs/de/releases/v9.md +0 -15
  125. package/docs/de/self_hosting.md +46 -50
  126. package/docs/en/bundle_optimization.md +51 -23
  127. package/docs/en/cli/doc-review.md +13 -2
  128. package/docs/en/configuration.md +24 -15
  129. package/docs/en/intlayer_with_angular_21.md +9 -9
  130. package/docs/en/intlayer_with_solid_start.md +1091 -0
  131. package/docs/en/intlayer_with_vite+solid.md +12 -0
  132. package/docs/en/live-sync.md +4 -0
  133. package/docs/en-GB/analytics.md +222 -0
  134. package/docs/en-GB/autoFill.md +26 -7
  135. package/docs/en-GB/bundle_optimization.md +58 -25
  136. package/docs/en-GB/configuration.md +25 -8
  137. package/docs/en-GB/dictionary/file.md +2 -0
  138. package/docs/en-GB/dictionary/nesting.md +64 -205
  139. package/docs/en-GB/formatters.md +146 -181
  140. package/docs/en-GB/intlayer_CMS.md +152 -0
  141. package/docs/en-GB/intlayer_with_angular_21.md +9 -9
  142. package/docs/en-GB/intlayer_with_nestjs.md +6 -2
  143. package/docs/en-GB/intlayer_with_nextjs_14.md +0 -27
  144. package/docs/en-GB/intlayer_with_nextjs_15.md +1 -33
  145. package/docs/en-GB/intlayer_with_react_router_v7_fs_routes.md +40 -82
  146. package/docs/en-GB/intlayer_with_solid_start.md +1078 -0
  147. package/docs/en-GB/intlayer_with_vite+vue.md +1 -3
  148. package/docs/en-GB/live-sync.md +4 -0
  149. package/docs/en-GB/packages/intlayer/getLocalizedUrl.md +30 -22
  150. package/docs/en-GB/packages/intlayer/getMultilingualUrls.md +16 -48
  151. package/docs/en-GB/packages/vite-intlayer/exports.md +15 -0
  152. package/docs/en-GB/packages/vite-intlayer/intlayer.md +121 -6
  153. package/docs/en-GB/packages/vite-intlayer/intlayerPrune.md +77 -4
  154. package/docs/en-GB/self_hosting.md +60 -49
  155. package/docs/es/analytics.md +222 -0
  156. package/docs/es/autoFill.md +28 -9
  157. package/docs/es/bundle_optimization.md +58 -25
  158. package/docs/es/configuration.md +24 -7
  159. package/docs/es/dictionary/file.md +3 -1
  160. package/docs/es/dictionary/nesting.md +47 -30
  161. package/docs/es/formatters.md +114 -168
  162. package/docs/es/intlayer_CMS.md +35 -10
  163. package/docs/es/intlayer_with_angular_21.md +9 -9
  164. package/docs/es/intlayer_with_nextjs_14.md +1 -28
  165. package/docs/es/intlayer_with_nextjs_15.md +1 -33
  166. package/docs/es/intlayer_with_solid_start.md +1078 -0
  167. package/docs/es/live-sync.md +4 -0
  168. package/docs/es/packages/intlayer/getLocalizedUrl.md +31 -23
  169. package/docs/es/packages/intlayer/getMultilingualUrls.md +4 -18
  170. package/docs/es/packages/vite-intlayer/exports.md +15 -0
  171. package/docs/es/packages/vite-intlayer/intlayer.md +121 -6
  172. package/docs/es/packages/vite-intlayer/intlayerPrune.md +69 -2
  173. package/docs/es/releases/v9.md +0 -15
  174. package/docs/es/self_hosting.md +46 -49
  175. package/docs/fr/analytics.md +222 -0
  176. package/docs/fr/autoFill.md +27 -8
  177. package/docs/fr/bundle_optimization.md +58 -25
  178. package/docs/fr/configuration.md +25 -8
  179. package/docs/fr/dictionary/file.md +2 -0
  180. package/docs/fr/dictionary/nesting.md +37 -184
  181. package/docs/fr/formatters.md +95 -236
  182. package/docs/fr/intlayer_CMS.md +66 -15
  183. package/docs/fr/intlayer_with_angular_21.md +9 -9
  184. package/docs/fr/intlayer_with_nextjs_14.md +1 -28
  185. package/docs/fr/intlayer_with_nextjs_15.md +1 -33
  186. package/docs/fr/intlayer_with_solid_start.md +1078 -0
  187. package/docs/fr/live-sync.md +4 -0
  188. package/docs/fr/packages/intlayer/getLocalizedUrl.md +37 -27
  189. package/docs/fr/packages/intlayer/getMultilingualUrls.md +18 -20
  190. package/docs/fr/packages/vite-intlayer/exports.md +15 -0
  191. package/docs/fr/packages/vite-intlayer/intlayer.md +121 -6
  192. package/docs/fr/packages/vite-intlayer/intlayerPrune.md +77 -4
  193. package/docs/fr/releases/v9.md +0 -15
  194. package/docs/fr/self_hosting.md +46 -49
  195. package/docs/hi/analytics.md +222 -0
  196. package/docs/hi/autoFill.md +28 -9
  197. package/docs/hi/bundle_optimization.md +58 -25
  198. package/docs/hi/configuration.md +25 -8
  199. package/docs/hi/dictionary/file.md +3 -1
  200. package/docs/hi/dictionary/nesting.md +47 -30
  201. package/docs/hi/formatters.md +233 -334
  202. package/docs/hi/how_works_intlayer.md +3 -1
  203. package/docs/hi/intlayer_CMS.md +152 -0
  204. package/docs/hi/intlayer_with_angular_21.md +9 -9
  205. package/docs/hi/intlayer_with_nestjs.md +11 -7
  206. package/docs/hi/intlayer_with_nextjs_14.md +1 -28
  207. package/docs/hi/intlayer_with_nextjs_15.md +1 -33
  208. package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +40 -83
  209. package/docs/hi/intlayer_with_solid_start.md +1077 -0
  210. package/docs/hi/intlayer_with_vite+preact.md +56 -49
  211. package/docs/hi/intlayer_with_vite+react.md +48 -41
  212. package/docs/hi/intlayer_with_vite+solid.md +32 -41
  213. package/docs/hi/intlayer_with_vite+vue.md +49 -44
  214. package/docs/hi/live-sync.md +4 -0
  215. package/docs/hi/packages/intlayer/getLocalizedUrl.md +26 -24
  216. package/docs/hi/packages/intlayer/getMultilingualUrls.md +4 -18
  217. package/docs/hi/packages/next-intlayer/t.md +33 -1
  218. package/docs/hi/packages/react-intlayer/useDictionary.md +4 -21
  219. package/docs/hi/packages/vite-intlayer/exports.md +15 -0
  220. package/docs/hi/packages/vite-intlayer/intlayer.md +121 -6
  221. package/docs/hi/packages/vite-intlayer/intlayerPrune.md +78 -5
  222. package/docs/hi/plugins/sync-json.md +9 -9
  223. package/docs/hi/releases/v9.md +0 -15
  224. package/docs/hi/self_hosting.md +38 -51
  225. package/docs/id/analytics.md +223 -0
  226. package/docs/id/bundle_optimization.md +58 -25
  227. package/docs/id/configuration.md +25 -8
  228. package/docs/id/dictionary/nesting.md +37 -184
  229. package/docs/id/formatters.md +208 -305
  230. package/docs/id/intlayer_CMS.md +164 -0
  231. package/docs/id/intlayer_with_angular_21.md +9 -9
  232. package/docs/id/intlayer_with_nextjs_14.md +1 -26
  233. package/docs/id/intlayer_with_react_router_v7_fs_routes.md +70 -63
  234. package/docs/id/intlayer_with_solid_start.md +1078 -0
  235. package/docs/id/live-sync.md +4 -0
  236. package/docs/id/packages/intlayer/getMultilingualUrls.md +4 -18
  237. package/docs/id/packages/react-intlayer/useIntlayer.md +2 -2
  238. package/docs/id/packages/vite-intlayer/exports.md +15 -0
  239. package/docs/id/packages/vite-intlayer/intlayer.md +121 -6
  240. package/docs/id/packages/vite-intlayer/intlayerPrune.md +78 -5
  241. package/docs/id/releases/v9.md +12 -0
  242. package/docs/id/self_hosting.md +61 -50
  243. package/docs/it/analytics.md +222 -0
  244. package/docs/it/autoFill.md +27 -8
  245. package/docs/it/bundle_optimization.md +58 -25
  246. package/docs/it/configuration.md +25 -8
  247. package/docs/it/dictionary/file.md +3 -1
  248. package/docs/it/dictionary/nesting.md +47 -30
  249. package/docs/it/formatters.md +114 -168
  250. package/docs/it/intlayer_CMS.md +66 -15
  251. package/docs/it/intlayer_with_angular_21.md +9 -9
  252. package/docs/it/intlayer_with_nestjs.md +11 -7
  253. package/docs/it/intlayer_with_nextjs_14.md +1 -28
  254. package/docs/it/intlayer_with_nextjs_15.md +1 -33
  255. package/docs/it/intlayer_with_solid_start.md +1078 -0
  256. package/docs/it/intlayer_with_vite+vue.md +1 -3
  257. package/docs/it/live-sync.md +4 -0
  258. package/docs/it/packages/intlayer/getLocalizedUrl.md +34 -26
  259. package/docs/it/packages/intlayer/getMultilingualUrls.md +4 -18
  260. package/docs/it/packages/react-intlayer/useDictionary.md +4 -21
  261. package/docs/it/packages/vite-intlayer/exports.md +15 -0
  262. package/docs/it/packages/vite-intlayer/intlayer.md +121 -6
  263. package/docs/it/packages/vite-intlayer/intlayerPrune.md +77 -4
  264. package/docs/it/releases/v9.md +0 -15
  265. package/docs/it/self_hosting.md +60 -49
  266. package/docs/ja/analytics.md +222 -0
  267. package/docs/ja/autoFill.md +28 -9
  268. package/docs/ja/bundle_optimization.md +58 -25
  269. package/docs/ja/configuration.md +25 -8
  270. package/docs/ja/dictionary/content_file.md +15 -7
  271. package/docs/ja/dictionary/file.md +3 -1
  272. package/docs/ja/dictionary/nesting.md +47 -30
  273. package/docs/ja/formatters.md +133 -187
  274. package/docs/ja/intlayer_visual_editor.md +3 -1
  275. package/docs/ja/intlayer_with_angular_21.md +6 -6
  276. package/docs/ja/intlayer_with_nestjs.md +2 -12
  277. package/docs/ja/intlayer_with_nextjs_14.md +1 -28
  278. package/docs/ja/intlayer_with_nextjs_15.md +1 -33
  279. package/docs/ja/intlayer_with_react_router_v7.md +456 -20
  280. package/docs/ja/intlayer_with_solid_start.md +1078 -0
  281. package/docs/ja/intlayer_with_vite+preact.md +73 -41
  282. package/docs/ja/intlayer_with_vite+vue.md +1 -3
  283. package/docs/ja/live-sync.md +4 -0
  284. package/docs/ja/mcp_server.md +3 -9
  285. package/docs/ja/packages/intlayer/getLocalizedUrl.md +26 -24
  286. package/docs/ja/packages/intlayer/getMultilingualUrls.md +3 -17
  287. package/docs/ja/packages/vite-intlayer/exports.md +15 -0
  288. package/docs/ja/packages/vite-intlayer/intlayer.md +121 -6
  289. package/docs/ja/packages/vite-intlayer/intlayerPrune.md +79 -6
  290. package/docs/ja/releases/v9.md +12 -0
  291. package/docs/ja/self_hosting.md +46 -50
  292. package/docs/ko/analytics.md +222 -0
  293. package/docs/ko/autoFill.md +28 -9
  294. package/docs/ko/bundle_optimization.md +58 -25
  295. package/docs/ko/configuration.md +25 -8
  296. package/docs/ko/dictionary/file.md +3 -1
  297. package/docs/ko/dictionary/nesting.md +47 -30
  298. package/docs/ko/formatters.md +133 -187
  299. package/docs/ko/intlayer_with_angular_21.md +9 -9
  300. package/docs/ko/intlayer_with_lynx+react.md +133 -39
  301. package/docs/ko/intlayer_with_nextjs_14.md +1 -28
  302. package/docs/ko/intlayer_with_nextjs_15.md +1 -33
  303. package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +40 -188
  304. package/docs/ko/intlayer_with_solid_start.md +1078 -0
  305. package/docs/ko/intlayer_with_vite+preact.md +57 -23
  306. package/docs/ko/intlayer_with_vite+vue.md +1 -3
  307. package/docs/ko/live-sync.md +4 -0
  308. package/docs/ko/packages/intlayer/getLocalizedUrl.md +26 -24
  309. package/docs/ko/packages/intlayer/getMultilingualUrls.md +4 -18
  310. package/docs/ko/packages/vite-intlayer/exports.md +15 -0
  311. package/docs/ko/packages/vite-intlayer/intlayer.md +121 -6
  312. package/docs/ko/packages/vite-intlayer/intlayerPrune.md +79 -6
  313. package/docs/ko/releases/v9.md +12 -0
  314. package/docs/ko/self_hosting.md +60 -49
  315. package/docs/nl/bundle_optimization.md +58 -25
  316. package/docs/nl/configuration.md +25 -8
  317. package/docs/nl/intlayer_with_angular_21.md +9 -9
  318. package/docs/pl/analytics.md +220 -0
  319. package/docs/pl/bundle_optimization.md +58 -25
  320. package/docs/pl/configuration.md +25 -8
  321. package/docs/pl/dictionary/nesting.md +47 -30
  322. package/docs/pl/formatters.md +208 -305
  323. package/docs/pl/intlayer_CMS.md +152 -0
  324. package/docs/pl/intlayer_with_angular_21.md +9 -9
  325. package/docs/pl/intlayer_with_nextjs_14.md +1 -26
  326. package/docs/pl/intlayer_with_solid_start.md +1078 -0
  327. package/docs/pl/live-sync.md +4 -0
  328. package/docs/pl/packages/intlayer/getMultilingualUrls.md +4 -18
  329. package/docs/pl/packages/react-intlayer/useDictionary.md +2 -19
  330. package/docs/pl/packages/vite-intlayer/exports.md +15 -0
  331. package/docs/pl/packages/vite-intlayer/intlayer.md +121 -6
  332. package/docs/pl/packages/vite-intlayer/intlayerPrune.md +77 -4
  333. package/docs/pl/releases/v9.md +0 -15
  334. package/docs/pl/self_hosting.md +60 -49
  335. package/docs/pt/analytics.md +222 -0
  336. package/docs/pt/bundle_optimization.md +58 -24
  337. package/docs/pt/configuration.md +25 -8
  338. package/docs/pt/dictionary/file.md +3 -1
  339. package/docs/pt/dictionary/nesting.md +47 -30
  340. package/docs/pt/formatters.md +112 -168
  341. package/docs/pt/intlayer_CMS.md +66 -15
  342. package/docs/pt/intlayer_with_angular_21.md +9 -9
  343. package/docs/pt/intlayer_with_astro_lit.md +26 -1
  344. package/docs/pt/intlayer_with_nextjs_14.md +1 -28
  345. package/docs/pt/intlayer_with_nextjs_15.md +1 -33
  346. package/docs/pt/intlayer_with_solid_start.md +1078 -0
  347. package/docs/pt/intlayer_with_vite+vue.md +1 -3
  348. package/docs/pt/live-sync.md +4 -0
  349. package/docs/pt/packages/intlayer/getLocalizedUrl.md +34 -26
  350. package/docs/pt/packages/intlayer/getMultilingualUrls.md +4 -18
  351. package/docs/pt/packages/vite-intlayer/exports.md +15 -0
  352. package/docs/pt/packages/vite-intlayer/intlayer.md +121 -6
  353. package/docs/pt/packages/vite-intlayer/intlayerPrune.md +78 -6
  354. package/docs/pt/releases/v9.md +0 -15
  355. package/docs/pt/self_hosting.md +60 -49
  356. package/docs/ru/analytics.md +222 -0
  357. package/docs/ru/autoFill.md +27 -8
  358. package/docs/ru/bundle_optimization.md +58 -25
  359. package/docs/ru/configuration.md +25 -8
  360. package/docs/ru/dictionary/file.md +3 -1
  361. package/docs/ru/dictionary/nesting.md +64 -205
  362. package/docs/ru/formatters.md +108 -128
  363. package/docs/ru/intlayer_with_angular_21.md +9 -9
  364. package/docs/ru/intlayer_with_nextjs_14.md +1 -28
  365. package/docs/ru/intlayer_with_nextjs_15.md +1 -33
  366. package/docs/ru/intlayer_with_solid_start.md +1078 -0
  367. package/docs/ru/intlayer_with_vite+vue.md +1 -3
  368. package/docs/ru/live-sync.md +4 -0
  369. package/docs/ru/packages/intlayer/getLocalizedUrl.md +34 -26
  370. package/docs/ru/packages/intlayer/getMultilingualUrls.md +4 -18
  371. package/docs/ru/packages/react-intlayer/useDictionary.md +4 -21
  372. package/docs/ru/packages/vite-intlayer/exports.md +15 -0
  373. package/docs/ru/packages/vite-intlayer/intlayer.md +121 -6
  374. package/docs/ru/packages/vite-intlayer/intlayerPrune.md +77 -4
  375. package/docs/ru/releases/v9.md +0 -15
  376. package/docs/ru/self_hosting.md +60 -49
  377. package/docs/tr/analytics.md +222 -0
  378. package/docs/tr/autoFill.md +28 -9
  379. package/docs/tr/bundle_optimization.md +58 -25
  380. package/docs/tr/configuration.md +25 -8
  381. package/docs/tr/dictionary/file.md +2 -0
  382. package/docs/tr/dictionary/nesting.md +47 -30
  383. package/docs/tr/formatters.md +144 -190
  384. package/docs/tr/intlayer_CMS.md +152 -0
  385. package/docs/tr/intlayer_with_angular_21.md +9 -9
  386. package/docs/tr/intlayer_with_nestjs.md +2 -12
  387. package/docs/tr/intlayer_with_nextjs_15.md +1 -33
  388. package/docs/tr/intlayer_with_solid_start.md +1078 -0
  389. package/docs/tr/intlayer_with_vite+vue.md +1 -3
  390. package/docs/tr/live-sync.md +4 -0
  391. package/docs/tr/packages/intlayer/getMultilingualUrls.md +4 -18
  392. package/docs/tr/packages/vite-intlayer/exports.md +15 -0
  393. package/docs/tr/packages/vite-intlayer/intlayer.md +121 -6
  394. package/docs/tr/packages/vite-intlayer/intlayerPrune.md +77 -4
  395. package/docs/tr/self_hosting.md +47 -50
  396. package/docs/uk/analytics.md +222 -0
  397. package/docs/uk/bundle_optimization.md +58 -25
  398. package/docs/uk/configuration.md +25 -8
  399. package/docs/uk/dictionary/nesting.md +47 -30
  400. package/docs/uk/formatters.md +128 -185
  401. package/docs/uk/intlayer_CMS.md +152 -0
  402. package/docs/uk/intlayer_with_angular_21.md +9 -9
  403. package/docs/uk/intlayer_with_nextjs_14.md +1 -26
  404. package/docs/uk/intlayer_with_solid_start.md +1078 -0
  405. package/docs/uk/live-sync.md +4 -0
  406. package/docs/uk/packages/react-intlayer/useDictionary.md +2 -19
  407. package/docs/uk/packages/vite-intlayer/exports.md +15 -0
  408. package/docs/uk/packages/vite-intlayer/intlayer.md +121 -6
  409. package/docs/uk/packages/vite-intlayer/intlayerPrune.md +77 -4
  410. package/docs/uk/releases/v9.md +0 -15
  411. package/docs/uk/self_hosting.md +60 -50
  412. package/docs/ur/bundle_optimization.md +58 -25
  413. package/docs/ur/configuration.md +25 -8
  414. package/docs/ur/intlayer_with_angular_21.md +9 -9
  415. package/docs/vi/analytics.md +222 -0
  416. package/docs/vi/bundle_optimization.md +58 -25
  417. package/docs/vi/configuration.md +24 -8
  418. package/docs/vi/dictionary/nesting.md +37 -184
  419. package/docs/vi/formatters.md +208 -309
  420. package/docs/vi/intlayer_CMS.md +164 -0
  421. package/docs/vi/intlayer_with_angular_21.md +9 -9
  422. package/docs/vi/intlayer_with_nextjs_14.md +0 -25
  423. package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +70 -63
  424. package/docs/vi/intlayer_with_solid_start.md +1078 -0
  425. package/docs/vi/live-sync.md +4 -0
  426. package/docs/vi/packages/intlayer/getMultilingualUrls.md +4 -18
  427. package/docs/vi/packages/react-intlayer/useIntlayer.md +2 -2
  428. package/docs/vi/packages/vite-intlayer/exports.md +15 -0
  429. package/docs/vi/packages/vite-intlayer/intlayer.md +121 -6
  430. package/docs/vi/packages/vite-intlayer/intlayerPrune.md +77 -4
  431. package/docs/vi/plugins/sync-json.md +6 -6
  432. package/docs/vi/releases/v9.md +12 -0
  433. package/docs/vi/self_hosting.md +61 -50
  434. package/docs/zh/CI_CD.md +4 -0
  435. package/docs/zh/analytics.md +222 -0
  436. package/docs/zh/autoFill.md +28 -9
  437. package/docs/zh/bundle_optimization.md +58 -25
  438. package/docs/zh/configuration.md +24 -8
  439. package/docs/zh/dictionary/file.md +2 -0
  440. package/docs/zh/dictionary/nesting.md +47 -30
  441. package/docs/zh/formatters.md +140 -188
  442. package/docs/zh/intlayer_CMS.md +164 -0
  443. package/docs/zh/intlayer_with_analog.md +193 -3
  444. package/docs/zh/intlayer_with_angular_19.md +272 -3
  445. package/docs/zh/intlayer_with_angular_21.md +7 -7
  446. package/docs/zh/intlayer_with_create_react_app.md +348 -26
  447. package/docs/zh/intlayer_with_lynx+react.md +263 -4
  448. package/docs/zh/intlayer_with_nextjs_14.md +1 -28
  449. package/docs/zh/intlayer_with_nextjs_15.md +1 -33
  450. package/docs/zh/intlayer_with_nextjs_no_locale_path.md +558 -1
  451. package/docs/zh/intlayer_with_nuxt.md +182 -7
  452. package/docs/zh/intlayer_with_react_router_v7.md +183 -25
  453. package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +306 -42
  454. package/docs/zh/intlayer_with_solid_start.md +1077 -0
  455. package/docs/zh/intlayer_with_storybook.md +260 -3
  456. package/docs/zh/intlayer_with_svelte_kit.md +428 -48
  457. package/docs/zh/intlayer_with_tanstack+solid.md +713 -13
  458. package/docs/zh/intlayer_with_tanstack.md +731 -20
  459. package/docs/zh/intlayer_with_vanilla.md +314 -4
  460. package/docs/zh/intlayer_with_vite+lit.md +465 -4
  461. package/docs/zh/intlayer_with_vite+preact.md +422 -116
  462. package/docs/zh/intlayer_with_vite+react.md +324 -45
  463. package/docs/zh/intlayer_with_vite+react_compiler.md +228 -13
  464. package/docs/zh/intlayer_with_vite+solid.md +462 -32
  465. package/docs/zh/intlayer_with_vite+vanilla.md +497 -4
  466. package/docs/zh/live-sync.md +4 -0
  467. package/docs/zh/mcp_server.md +3 -9
  468. package/docs/zh/packages/intlayer/getLocalizedUrl.md +26 -24
  469. package/docs/zh/packages/intlayer/getMultilingualUrls.md +4 -18
  470. package/docs/zh/packages/vite-intlayer/exports.md +29 -0
  471. package/docs/zh/packages/vite-intlayer/intlayer.md +121 -6
  472. package/docs/zh/packages/vite-intlayer/intlayerPrune.md +79 -6
  473. package/docs/zh/releases/v9.md +12 -0
  474. package/docs/zh/self_hosting.md +60 -50
  475. package/docs/zh-TW/bundle_optimization.md +58 -25
  476. package/docs/zh-TW/intlayer_with_angular_21.md +7 -7
  477. package/package.json +7 -7
  478. package/src/common.ts +39 -2
  479. package/src/generated/blog.entry.ts +66 -34
  480. package/src/generated/docs.entry.ts +273 -221
  481. package/src/generated/frequentQuestions.entry.ts +56 -24
  482. package/src/generated/legal.entry.ts +41 -9
@@ -55,11 +55,62 @@ author: aymericzip
55
55
 
56
56
  ---
57
57
 
58
- ### 第2步:实现 Intlayer 插件以封装 JSON
58
+ ## Vue-i18n Intlayer 的分步设置指南
59
59
 
60
- 创建一个 Intlayer 配置文件以定义您支持的语言环境:
60
+ <Steps>
61
61
 
62
- **如果您还想导出用于 vue-i18n 的 JSON 字典**,请添加 `syncJSON` 插件:
62
+ <Step number={1} title="安装依赖项">
63
+
64
+ 使用您首选的包管理器安装必要的包:
65
+
66
+ ```bash packageManager="npm"
67
+ npx intlayer init --interactive
68
+ ```
69
+
70
+ ```bash packageManager="pnpm"
71
+ pnpm dlx intlayer@canary init --interactive
72
+ ```
73
+
74
+ ```bash packageManager="yarn"
75
+ yarn dlx intlayer@canary init --interactive
76
+ ```
77
+
78
+ ```bash packageManager="bun"
79
+ bunx intlayer@canary init --interactive
80
+ ```
81
+
82
+ > `--interactive` 标志是可选的。如果您是 AI 代理,请使用 `intlayer-cli init`。
83
+
84
+ > 此命令将检测您的环境并安装所需的包。例如:
85
+
86
+ ```bash packageManager="npm"
87
+ npm install intlayer @intlayer/sync-json-plugin --save-dev
88
+ ```
89
+
90
+ ```bash packageManager="pnpm"
91
+ pnpm add intlayer @intlayer/sync-json-plugin --save-dev
92
+ ```
93
+
94
+ ```bash packageManager="yarn"
95
+ yarn add intlayer @intlayer/sync-json-plugin --dev
96
+ ```
97
+
98
+ ```bash packageManager="bun"
99
+ bun add intlayer @intlayer/sync-json-plugin --dev
100
+ ```
101
+
102
+ **包说明:**
103
+
104
+ - **intlayer**:用于内容声明和管理的核心库
105
+ - **@intlayer/sync-json-plugin**:将 Intlayer 内容声明同步到 vue-i18n JSON 格式的插件
106
+
107
+ </Step>
108
+
109
+ <Step number={2} title="实现 Intlayer 插件来包装 JSON">
110
+
111
+ 创建一个 Intlayer 配置文件来定义您支持的语言环境:
112
+
113
+ **如果您还想为 vue-i18n 导出 JSON 字典**,请添加 `syncJSON` 插件:
63
114
 
64
115
  ```typescript fileName="intlayer.config.ts"
65
116
  import { Locales, type IntlayerConfig } from "intlayer";
@@ -81,16 +132,74 @@ const config: IntlayerConfig = {
81
132
  export default config;
82
133
  ```
83
134
 
84
- `syncJSON` 插件会自动包装 JSON。它会读取和写入 JSON 文件,而不会改变内容结构。
135
+ `syncJSON` 插件将自动包装 JSON。它将读取和写入 JSON 文件,而不改变内容架构。
85
136
 
86
- 如果你想让 JSON 与 intlayer 内容声明文件(`.content` 文件)共存,Intlayer 会按以下方式处理:
137
+ 如果您想让 JSON 与 intlayer 内容声明文件(`.content` 文件)共存,Intlayer 将按照以下方式处理:
87
138
 
88
139
  1. 加载 JSON 和内容声明文件,并将它们转换为 intlayer 字典。
89
- 2. 如果 JSON 和内容声明文件之间存在冲突,Intlayer 会合并所有字典。具体合并方式取决于插件的优先级以及内容声明文件的优先级(所有优先级均可配置)。
140
+ 2. 如果 JSON 和内容声明文件之间存在冲突,Intlayer 将合并所有字典。根据插件的优先级和内容声明文件的优先级(都是可配置的)。
141
+
142
+ 如果使用 CLI 或 CMS 对 JSON 进行更改以翻译内容,Intlayer 将使用新的翻译更新 JSON 文件。
143
+
144
+ 有关 `syncJSON` 插件的更多详细信息,请参阅 [syncJSON 插件文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/plugins/sync-json.md)。
145
+
146
+ </Step>
147
+
148
+ <Step number={3} title="设置 AI 提供商">
149
+
150
+ Intlayer 为您的 i18next 工作流解锁了一系列高级自动化和开发者友好的功能。
151
+
152
+ - **自动检测和填充缺失的翻译**:Intlayer 扫描您的 JSON 字典,找到未翻译或缺失的键,仅翻译这些部分,因此您的 JSON 的 99% 保持不变。
153
+ - **大型 JSON 文件的分块翻译**:当您的翻译文件非常大时,Intlayer 自动将处理分成可管理的块,独立翻译它们以避免 API 限制和内存问题。
154
+ - **命名空间并行化**:如果您有数百个命名空间(或文件),Intlayer 将并行化翻译任务,有效加快 CI/CD 或批量翻译操作的速度。
155
+ - **灵活的 AI 提供商支持**:选择您首选的 AI 提供商(例如 OpenAI、Claude、Gemini),只需配置凭据即可。使用您自己的 API 密钥,并根据需要切换提供商。
156
+ - **强大的 AI 响应处理**:Intlayer 可以处理您的 AI 提供商将文本作为字符串或对象返回的边界情况,甚至在格式不一致时自动重试。
157
+ - **CLI 和 CI/CD 就绪**:直接在您的测试或管道中运行 Intlayer 的检查和自动填充,使您的本地化过程强大且自动化。
158
+ - **集成到您现有的设置之上**:您不需要改变您的 i18next 或 Next.js 基础。Intlayer 作为您当前设置的附加插件,为您提供所有这些好处,同时最小化迁移。
159
+
160
+ 以下是如何设置 AI 提供商的示例:
161
+
162
+ ```ts fileName="intlayer.config.ts"
163
+ import { Locales, type IntlayerConfig } from "intlayer";
164
+ import { loadJSON, syncJSON } from "@intlayer/sync-json-plugin";
165
+
166
+ const config: IntlayerConfig = {
167
+ internationalization: {
168
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
169
+ defaultLocale: Locales.ENGLISH,
170
+ },
171
+ ai: {
172
+ provider: "openai",
173
+ model: "gpt-5-mini",
174
+ apiKey: process.env.OPENAI_API_KEY,
175
+ },
176
+ plugins: [
177
+ syncJSON({
178
+ format: "vue-i18n",
179
+ source: ({ key, locale }) => `./src/locales/${locale}/${key}.json`,
180
+ }),
181
+ ],
182
+ };
183
+
184
+ export default config;
185
+ ```
186
+
187
+ 然后您可以执行以下命令来填充您的翻译:
188
+
189
+ ```bash
190
+ npx intlayer fill
191
+ ```
192
+
193
+ 这将使用您配置的 AI 提供商填充您的翻译。
194
+
195
+ > 在 [Intlayer AI 配置文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/configuration.md#ai-configuration) 中查看所有可用的 AI 提供商。
196
+ > 在 [Intlayer CLI 文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/cli/index.md) 中查看所有可用的命令。
197
+
198
+ ---
90
199
 
91
- 如果通过 CLI 翻译 JSON 或使用 CMS 进行更改,Intlayer 会使用新的翻译更新 JSON 文件。
200
+ </Step>
92
201
 
93
- 要查看更多关于 `syncJSON` 插件的详细信息,请参阅 [syncJSON 插件文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/plugins/sync-json.md)。
202
+ </Steps>
94
203
 
95
204
  ## Git 配置
96
205
 
@@ -79,6 +79,12 @@ author: aymericzip
79
79
 
80
80
  每个向量都是文本的数学指纹,支持相似度搜索。
81
81
 
82
+ ## 使用 Sanity 跳过复杂性
83
+
84
+ Sanity 值得在此提及,作为本文指向的 CMS 选项。Markdown 文件需要任意的 token 拆分——具有文章所描述的分块大小和重叠权衡——而 Sanity 的 Content Lake 将文档存储为类型化的、架构定义的 JSON 文档。每个字段、标题和内容块已经是一个语义单元,这意味着 RAG 检索在有意义的边界上操作,而不是近似的 token 计数。
85
+
86
+ Sanity 的 GROQ 查询语言让你能够检索与用户查询相关的确切文档字段——标题、正文、相关部分——而无需获取整个文档。MCP 服务器将 Content Lake 直接连接到 AI 代理,因此为文档网站提供支持的相同结构化内容也会馈送到你的 RAG 管道中,无需单独的摄入步骤。
87
+
82
88
  ## 结论
83
89
 
84
90
  RAG 是使大型语言模型(LLM)实用的最简单且最强大的方法之一。通过结合**检索 + 生成**,您可以将静态文档转变为**智能助手**,同时获得持续的产品洞察流。
@@ -48,12 +48,35 @@ const getFileMetadata = async (files, docKey, locale = defaultLocale) => {
48
48
  const file = await getFile(files, docKey, locale);
49
49
  return formatMetadata(docKey, file, locale);
50
50
  };
51
- const getFileMetadataRecord = async (files, locale = defaultLocale) => {
51
+ /**
52
+ * Per-locale metadata records, keyed by the entry map they were built from.
53
+ *
54
+ * Building a record parses the frontmatter of every document of a category, and
55
+ * callers such as {@link getFileMetadataBySlug} need the whole record just to
56
+ * resolve a single slug — which a static site generator repeats for every page
57
+ * it renders. Documents are read once per process anyway (each entry caches its
58
+ * own read), so the derived metadata is equally safe to keep.
59
+ */
60
+ const fileMetadataRecordCache = /* @__PURE__ */ new WeakMap();
61
+ const buildFileMetadataRecord = async (files, locale) => {
52
62
  const filesEntries = (await Promise.allSettled(Object.entries(files).map(async ([key]) => {
53
63
  return [key, await getFileMetadata(files, key, locale)];
54
64
  }))).filter((r) => r.status === "fulfilled").map((r) => r.value);
55
65
  return Object.fromEntries(filesEntries);
56
66
  };
67
+ const getFileMetadataRecord = async (files, locale = defaultLocale) => {
68
+ let localeCache = fileMetadataRecordCache.get(files);
69
+ if (!localeCache) {
70
+ localeCache = /* @__PURE__ */ new Map();
71
+ fileMetadataRecordCache.set(files, localeCache);
72
+ }
73
+ let record = localeCache.get(locale);
74
+ if (!record) {
75
+ record = buildFileMetadataRecord(files, locale);
76
+ localeCache.set(locale, record);
77
+ }
78
+ return await record;
79
+ };
57
80
  const getFileMetadataBySlug = async (files, slugs, locale = defaultLocale, strict = false) => {
58
81
  const slugsArray = Array.isArray(slugs) ? slugs : [slugs];
59
82
  const filesMetadata = await getFileMetadataRecord(files, defaultLocale);
@@ -1 +1 @@
1
- {"version":3,"file":"common.cjs","names":["Locales"],"sources":["../../src/common.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getLocalizedUrl } from '@intlayer/core/localization';\nimport { getMarkdownMetadata } from '@intlayer/core/transpiler';\nimport * as Locales from '@intlayer/types/locales';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\nexport const defaultLocale = Locales.ENGLISH;\n\nexport const GITHUB_URL_PREFIX =\n 'https://github.com/aymericzip/intlayer/blob/main/docs';\nexport const URL_PREFIX = 'https://intlayer.org/';\n\nexport const getKeys = <T extends Record<string, any>>(obj: T): (keyof T)[] =>\n Object.keys(obj) as (keyof T)[];\n\nexport const getFiles = async <\n F extends Record<`./${string}`, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n lang: LocalesValues = defaultLocale as LocalesValues\n): Promise<Record<string, string>> => {\n const filesEntries = await Promise.all(\n Object.entries(files)\n .map(([key, value]) => [key, value[lang as LocalesValues]])\n .map(async ([key, value]) => [key, await value])\n );\n const filesResult = Object.fromEntries(filesEntries);\n return filesResult;\n};\n\nexport const getFile = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n docKey: keyof F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<string> => {\n const fileRecord = files[docKey];\n\n if (!fileRecord) {\n throw new Error(`File ${docKey as string} not found`);\n }\n\n const file = await files[docKey]?.[locale];\n\n if (!file) {\n const englishFile = await files[docKey]?.[defaultLocale as LocalesValues];\n\n if (!englishFile) {\n throw new Error(`File ${docKey as string} not found`);\n }\n\n return englishFile;\n }\n\n return file;\n};\n\nexport type FileMetadata = {\n docKey: string;\n url: string;\n relativeUrl: string;\n githubUrl: string;\n title: string;\n slugs: string[];\n description: string;\n keywords: string[];\n updatedAt: string;\n createdAt: string;\n author?: string;\n youtubeVideo?: string;\n applicationTemplate?: string;\n applicationShowcase?: string;\n history?: {\n version: string;\n date: string;\n changes: string;\n }[];\n};\n\nexport const formatMetadata = (\n docKey: string,\n file: string,\n locale: LocalesValues = defaultLocale as LocalesValues\n): FileMetadata => {\n const metadata = getMarkdownMetadata(file);\n\n const slugs = (metadata.slugs ?? []).map(String);\n const keywords = (metadata.keywords ?? []).map(String);\n\n const relativeUrl = join('/', ...slugs);\n\n const slicedDocKey = docKey.slice(1);\n\n // Normalise author: accept both a plain string handle (new format)\n // and a legacy object `{ github: '...' }` — always reduce to a plain string.\n const rawAuthor = metadata.author as\n | string\n | { name?: string; github?: string }\n | undefined;\n const author: string | undefined =\n typeof rawAuthor === 'string'\n ? rawAuthor || undefined\n : rawAuthor?.github || undefined;\n\n return {\n ...metadata,\n docKey,\n slugs,\n keywords,\n author,\n githubUrl: `${GITHUB_URL_PREFIX}${slicedDocKey}`.replace(\n '/en/',\n `/${locale}/`\n ),\n relativeUrl: getLocalizedUrl(relativeUrl, locale),\n url: getLocalizedUrl(join(URL_PREFIX, relativeUrl), locale),\n } as FileMetadata;\n};\n\nexport const getFileMetadata = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n R extends FileMetadata,\n>(\n files: F,\n docKey: keyof F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<R> => {\n const file = await getFile(files, docKey, locale);\n\n return formatMetadata(docKey as string, file, locale) as R;\n};\n\nexport const getFileMetadataRecord = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<Record<keyof F, FileMetadata>> => {\n const results = await Promise.allSettled(\n Object.entries(files).map(async ([key]) => {\n const metadata = await getFileMetadata(files, key as keyof F, locale);\n return [key, metadata] as [string, FileMetadata];\n })\n );\n const filesEntries = results\n .filter(\n (r): r is PromiseFulfilledResult<[string, FileMetadata]> =>\n r.status === 'fulfilled'\n )\n .map((r) => r.value);\n const filesResult = Object.fromEntries(filesEntries);\n return filesResult as Record<keyof F, FileMetadata>;\n};\n\nexport const getFileMetadataBySlug = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n slugs: string | string[],\n locale: LocalesValues = defaultLocale as LocalesValues,\n strict = false\n) => {\n const slugsArray = Array.isArray(slugs) ? slugs : [slugs];\n const filesMetadata = await getFileMetadataRecord(\n files,\n defaultLocale as LocalesValues\n );\n\n let fileMetadataArray: FileMetadata[] = Object.values(filesMetadata).filter(\n (fileMetadata) =>\n slugsArray.every((slug) => fileMetadata.slugs?.includes(slug))\n );\n\n if (strict) {\n fileMetadataArray = fileMetadataArray.filter(\n (fileMetadata) => fileMetadata.slugs.length === slugsArray.length\n );\n }\n\n if (locale !== defaultLocale) {\n const localizedFileMetadata = await Promise.all(\n fileMetadataArray.map(\n async (fileMetadata) =>\n await getFileMetadata(files, fileMetadata.docKey, locale)\n )\n );\n\n return localizedFileMetadata;\n }\n\n return fileMetadataArray;\n};\n\nexport const getFileBySlug = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n slugs: string | string[],\n locale: LocalesValues = defaultLocale as LocalesValues,\n strict = false\n) => {\n const slugsArray = Array.isArray(slugs) ? slugs : [slugs];\n const filesMetadata = await getFileMetadataRecord(\n files,\n defaultLocale as LocalesValues\n );\n\n let fileMetadataArray = Object.values(filesMetadata).filter((fileMetadata) =>\n slugsArray.every((slug) => fileMetadata.slugs?.includes(slug))\n );\n\n if (strict) {\n fileMetadataArray = fileMetadataArray.filter(\n (fileMetadata) => fileMetadata.slugs.length === slugsArray.length\n );\n }\n\n const fileList = await Promise.all(\n fileMetadataArray.map(async (fileMetadata) => {\n const file = await getFile(files, fileMetadata.docKey, locale);\n return file;\n })\n );\n\n return fileList;\n};\n"],"mappings":";;;;;;;;;AAMA,MAAa,gBAAgBA,wBAAQ;AAErC,MAAa,oBACX;AACF,MAAa,aAAa;AAE1B,MAAa,WAA0C,QACrD,OAAO,KAAK,GAAG;AAEjB,MAAa,WAAW,OAGtB,OACA,OAAsB,kBACc;CACpC,MAAM,eAAe,MAAM,QAAQ,IACjC,OAAO,QAAQ,KAAK,CAAC,CAClB,KAAK,CAAC,KAAK,WAAW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QAAQ,MAAM;CAE/D,CAAC,CACH;AAGF"}
1
+ {"version":3,"file":"common.cjs","names":["Locales"],"sources":["../../src/common.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getLocalizedUrl } from '@intlayer/core/localization';\nimport { getMarkdownMetadata } from '@intlayer/core/transpiler';\nimport * as Locales from '@intlayer/types/locales';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\nexport const defaultLocale = Locales.ENGLISH;\n\nexport const GITHUB_URL_PREFIX =\n 'https://github.com/aymericzip/intlayer/blob/main/docs';\nexport const URL_PREFIX = 'https://intlayer.org/';\n\nexport const getKeys = <T extends Record<string, any>>(obj: T): (keyof T)[] =>\n Object.keys(obj) as (keyof T)[];\n\nexport const getFiles = async <\n F extends Record<`./${string}`, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n lang: LocalesValues = defaultLocale as LocalesValues\n): Promise<Record<string, string>> => {\n const filesEntries = await Promise.all(\n Object.entries(files)\n .map(([key, value]) => [key, value[lang as LocalesValues]])\n .map(async ([key, value]) => [key, await value])\n );\n const filesResult = Object.fromEntries(filesEntries);\n return filesResult;\n};\n\nexport const getFile = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n docKey: keyof F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<string> => {\n const fileRecord = files[docKey];\n\n if (!fileRecord) {\n throw new Error(`File ${docKey as string} not found`);\n }\n\n const file = await files[docKey]?.[locale];\n\n if (!file) {\n const englishFile = await files[docKey]?.[defaultLocale as LocalesValues];\n\n if (!englishFile) {\n throw new Error(`File ${docKey as string} not found`);\n }\n\n return englishFile;\n }\n\n return file;\n};\n\nexport type FileMetadata = {\n docKey: string;\n url: string;\n relativeUrl: string;\n githubUrl: string;\n title: string;\n slugs: string[];\n description: string;\n keywords: string[];\n updatedAt: string;\n createdAt: string;\n author?: string;\n youtubeVideo?: string;\n applicationTemplate?: string;\n applicationShowcase?: string;\n history?: {\n version: string;\n date: string;\n changes: string;\n }[];\n};\n\nexport const formatMetadata = (\n docKey: string,\n file: string,\n locale: LocalesValues = defaultLocale as LocalesValues\n): FileMetadata => {\n const metadata = getMarkdownMetadata(file);\n\n const slugs = (metadata.slugs ?? []).map(String);\n const keywords = (metadata.keywords ?? []).map(String);\n\n const relativeUrl = join('/', ...slugs);\n\n const slicedDocKey = docKey.slice(1);\n\n // Normalise author: accept both a plain string handle (new format)\n // and a legacy object `{ github: '...' }` — always reduce to a plain string.\n const rawAuthor = metadata.author as\n | string\n | { name?: string; github?: string }\n | undefined;\n const author: string | undefined =\n typeof rawAuthor === 'string'\n ? rawAuthor || undefined\n : rawAuthor?.github || undefined;\n\n return {\n ...metadata,\n docKey,\n slugs,\n keywords,\n author,\n githubUrl: `${GITHUB_URL_PREFIX}${slicedDocKey}`.replace(\n '/en/',\n `/${locale}/`\n ),\n relativeUrl: getLocalizedUrl(relativeUrl, locale),\n url: getLocalizedUrl(join(URL_PREFIX, relativeUrl), locale),\n } as FileMetadata;\n};\n\nexport const getFileMetadata = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n R extends FileMetadata,\n>(\n files: F,\n docKey: keyof F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<R> => {\n const file = await getFile(files, docKey, locale);\n\n return formatMetadata(docKey as string, file, locale) as R;\n};\n\n/**\n * Per-locale metadata records, keyed by the entry map they were built from.\n *\n * Building a record parses the frontmatter of every document of a category, and\n * callers such as {@link getFileMetadataBySlug} need the whole record just to\n * resolve a single slug — which a static site generator repeats for every page\n * it renders. Documents are read once per process anyway (each entry caches its\n * own read), so the derived metadata is equally safe to keep.\n */\nconst fileMetadataRecordCache = new WeakMap<\n Record<string, unknown>,\n Map<LocalesValues, Promise<Record<string, FileMetadata>>>\n>();\n\nconst buildFileMetadataRecord = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n locale: LocalesValues\n): Promise<Record<keyof F, FileMetadata>> => {\n const results = await Promise.allSettled(\n Object.entries(files).map(async ([key]) => {\n const metadata = await getFileMetadata(files, key as keyof F, locale);\n return [key, metadata] as [string, FileMetadata];\n })\n );\n const filesEntries = results\n .filter(\n (r): r is PromiseFulfilledResult<[string, FileMetadata]> =>\n r.status === 'fulfilled'\n )\n .map((r) => r.value);\n const filesResult = Object.fromEntries(filesEntries);\n return filesResult as Record<keyof F, FileMetadata>;\n};\n\nexport const getFileMetadataRecord = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<Record<keyof F, FileMetadata>> => {\n let localeCache = fileMetadataRecordCache.get(files);\n\n if (!localeCache) {\n localeCache = new Map();\n fileMetadataRecordCache.set(files, localeCache);\n }\n\n let record = localeCache.get(locale);\n\n if (!record) {\n record = buildFileMetadataRecord(files, locale);\n localeCache.set(locale, record);\n }\n\n return (await record) as Record<keyof F, FileMetadata>;\n};\n\nexport const getFileMetadataBySlug = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n slugs: string | string[],\n locale: LocalesValues = defaultLocale as LocalesValues,\n strict = false\n) => {\n const slugsArray = Array.isArray(slugs) ? slugs : [slugs];\n const filesMetadata = await getFileMetadataRecord(\n files,\n defaultLocale as LocalesValues\n );\n\n let fileMetadataArray: FileMetadata[] = Object.values(filesMetadata).filter(\n (fileMetadata) =>\n slugsArray.every((slug) => fileMetadata.slugs?.includes(slug))\n );\n\n if (strict) {\n fileMetadataArray = fileMetadataArray.filter(\n (fileMetadata) => fileMetadata.slugs.length === slugsArray.length\n );\n }\n\n if (locale !== defaultLocale) {\n const localizedFileMetadata = await Promise.all(\n fileMetadataArray.map(\n async (fileMetadata) =>\n await getFileMetadata(files, fileMetadata.docKey, locale)\n )\n );\n\n return localizedFileMetadata;\n }\n\n return fileMetadataArray;\n};\n\nexport const getFileBySlug = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n slugs: string | string[],\n locale: LocalesValues = defaultLocale as LocalesValues,\n strict = false\n) => {\n const slugsArray = Array.isArray(slugs) ? slugs : [slugs];\n const filesMetadata = await getFileMetadataRecord(\n files,\n defaultLocale as LocalesValues\n );\n\n let fileMetadataArray = Object.values(filesMetadata).filter((fileMetadata) =>\n slugsArray.every((slug) => fileMetadata.slugs?.includes(slug))\n );\n\n if (strict) {\n fileMetadataArray = fileMetadataArray.filter(\n (fileMetadata) => fileMetadata.slugs.length === slugsArray.length\n );\n }\n\n const fileList = await Promise.all(\n fileMetadataArray.map(async (fileMetadata) => {\n const file = await getFile(files, fileMetadata.docKey, locale);\n return file;\n })\n );\n\n return fileList;\n};\n"],"mappings":";;;;;;;;;AAMA,MAAa,gBAAgBA,wBAAQ;AAErC,MAAa,oBACX;AACF,MAAa,aAAa;AAE1B,MAAa,WAA0C,QACrD,OAAO,KAAK,GAAG;AAEjB,MAAa,WAAW,OAGtB,OACA,OAAsB,kBACc;CACpC,MAAM,eAAe,MAAM,QAAQ,IACjC,OAAO,QAAQ,KAAK,CAAC,CAClB,KAAK,CAAC,KAAK,WAAW,CAAC,KAAK,MAAM,KAAsB,CAAC,CAAC,CAC1D,IAAI,OAAO,CAAC,KAAK,WAAW,CAAC,KAAK,MAAM,KAAK,CAAC,CACnD;CAEA,OADoB,OAAO,YAAY,YACtB;AACnB;AAEA,MAAa,UAAU,OAGrB,OACA,QACA,SAAwB,kBACJ;CAGpB,IAAI,CAFe,MAAM,SAGvB,MAAM,IAAI,MAAM,QAAQ,OAAiB,WAAW;CAGtD,MAAM,OAAO,MAAM,MAAM,OAAO,GAAG;CAEnC,IAAI,CAAC,MAAM;EACT,MAAM,cAAc,MAAM,MAAM,OAAO,GAAG;EAE1C,IAAI,CAAC,aACH,MAAM,IAAI,MAAM,QAAQ,OAAiB,WAAW;EAGtD,OAAO;CACT;CAEA,OAAO;AACT;AAwBA,MAAa,kBACX,QACA,MACA,SAAwB,kBACP;CACjB,MAAM,8DAA+B,IAAI;CAEzC,MAAM,SAAS,SAAS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