@intlayer/next-intl 8.12.5-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/README.md +330 -0
  2. package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
  3. package/dist/cjs/client/NextIntlClientProvider.cjs +28 -0
  4. package/dist/cjs/client/NextIntlClientProvider.cjs.map +1 -0
  5. package/dist/cjs/client/helpers.cjs +66 -0
  6. package/dist/cjs/client/helpers.cjs.map +1 -0
  7. package/dist/cjs/client/index.cjs +19 -0
  8. package/dist/cjs/client/useLocale.cjs +18 -0
  9. package/dist/cjs/client/useLocale.cjs.map +1 -0
  10. package/dist/cjs/client/useTranslations.cjs +39 -0
  11. package/dist/cjs/client/useTranslations.cjs.map +1 -0
  12. package/dist/cjs/createFormatter.cjs +59 -0
  13. package/dist/cjs/createFormatter.cjs.map +1 -0
  14. package/dist/cjs/createTranslator.cjs +111 -0
  15. package/dist/cjs/createTranslator.cjs.map +1 -0
  16. package/dist/cjs/getDictionary.cjs +45 -0
  17. package/dist/cjs/getDictionary.cjs.map +1 -0
  18. package/dist/cjs/getDictionaryDynamic.cjs +35 -0
  19. package/dist/cjs/getDictionaryDynamic.cjs.map +1 -0
  20. package/dist/cjs/getTranslationsDictionary.cjs +31 -0
  21. package/dist/cjs/getTranslationsDictionary.cjs.map +1 -0
  22. package/dist/cjs/getTranslationsDictionaryDynamic.cjs +27 -0
  23. package/dist/cjs/getTranslationsDictionaryDynamic.cjs.map +1 -0
  24. package/dist/cjs/hasLocale.cjs +25 -0
  25. package/dist/cjs/hasLocale.cjs.map +1 -0
  26. package/dist/cjs/index.cjs +23 -0
  27. package/dist/cjs/middleware.cjs +37 -0
  28. package/dist/cjs/middleware.cjs.map +1 -0
  29. package/dist/cjs/navigation/Link.cjs +30 -0
  30. package/dist/cjs/navigation/Link.cjs.map +1 -0
  31. package/dist/cjs/navigation/createNavigation.cjs +40 -0
  32. package/dist/cjs/navigation/createNavigation.cjs.map +1 -0
  33. package/dist/cjs/navigation/hooks.cjs +42 -0
  34. package/dist/cjs/navigation/hooks.cjs.map +1 -0
  35. package/dist/cjs/navigation/index.cjs +10 -0
  36. package/dist/cjs/navigation/localizeHref.cjs +26 -0
  37. package/dist/cjs/navigation/localizeHref.cjs.map +1 -0
  38. package/dist/cjs/package.cjs +122 -0
  39. package/dist/cjs/package.cjs.map +1 -0
  40. package/dist/cjs/plugin/index.cjs +163 -0
  41. package/dist/cjs/plugin/index.cjs.map +1 -0
  42. package/dist/cjs/routing.cjs +30 -0
  43. package/dist/cjs/routing.cjs.map +1 -0
  44. package/dist/cjs/server/getLocale.cjs +13 -0
  45. package/dist/cjs/server/getLocale.cjs.map +1 -0
  46. package/dist/cjs/server/getMessages.cjs +30 -0
  47. package/dist/cjs/server/getMessages.cjs.map +1 -0
  48. package/dist/cjs/server/getTranslations.cjs +45 -0
  49. package/dist/cjs/server/getTranslations.cjs.map +1 -0
  50. package/dist/cjs/server/helpers.cjs +28 -0
  51. package/dist/cjs/server/helpers.cjs.map +1 -0
  52. package/dist/cjs/server/index.cjs +18 -0
  53. package/dist/cjs/server/setLocale.cjs +38 -0
  54. package/dist/cjs/server/setLocale.cjs.map +1 -0
  55. package/dist/cjs/useDictionary.cjs +45 -0
  56. package/dist/cjs/useDictionary.cjs.map +1 -0
  57. package/dist/cjs/useDictionaryDynamic.cjs +37 -0
  58. package/dist/cjs/useDictionaryDynamic.cjs.map +1 -0
  59. package/dist/cjs/useTranslationsDictionary.cjs +37 -0
  60. package/dist/cjs/useTranslationsDictionary.cjs.map +1 -0
  61. package/dist/cjs/useTranslationsDictionaryDynamic.cjs +29 -0
  62. package/dist/cjs/useTranslationsDictionaryDynamic.cjs.map +1 -0
  63. package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
  64. package/dist/esm/client/NextIntlClientProvider.mjs +26 -0
  65. package/dist/esm/client/NextIntlClientProvider.mjs.map +1 -0
  66. package/dist/esm/client/helpers.mjs +59 -0
  67. package/dist/esm/client/helpers.mjs.map +1 -0
  68. package/dist/esm/client/index.mjs +8 -0
  69. package/dist/esm/client/useLocale.mjs +16 -0
  70. package/dist/esm/client/useLocale.mjs.map +1 -0
  71. package/dist/esm/client/useTranslations.mjs +37 -0
  72. package/dist/esm/client/useTranslations.mjs.map +1 -0
  73. package/dist/esm/createFormatter.mjs +57 -0
  74. package/dist/esm/createFormatter.mjs.map +1 -0
  75. package/dist/esm/createTranslator.mjs +108 -0
  76. package/dist/esm/createTranslator.mjs.map +1 -0
  77. package/dist/esm/getDictionary.mjs +43 -0
  78. package/dist/esm/getDictionary.mjs.map +1 -0
  79. package/dist/esm/getDictionaryDynamic.mjs +33 -0
  80. package/dist/esm/getDictionaryDynamic.mjs.map +1 -0
  81. package/dist/esm/getTranslationsDictionary.mjs +29 -0
  82. package/dist/esm/getTranslationsDictionary.mjs.map +1 -0
  83. package/dist/esm/getTranslationsDictionaryDynamic.mjs +25 -0
  84. package/dist/esm/getTranslationsDictionaryDynamic.mjs.map +1 -0
  85. package/dist/esm/hasLocale.mjs +23 -0
  86. package/dist/esm/hasLocale.mjs.map +1 -0
  87. package/dist/esm/index.mjs +10 -0
  88. package/dist/esm/middleware.mjs +34 -0
  89. package/dist/esm/middleware.mjs.map +1 -0
  90. package/dist/esm/navigation/Link.mjs +27 -0
  91. package/dist/esm/navigation/Link.mjs.map +1 -0
  92. package/dist/esm/navigation/createNavigation.mjs +37 -0
  93. package/dist/esm/navigation/createNavigation.mjs.map +1 -0
  94. package/dist/esm/navigation/hooks.mjs +39 -0
  95. package/dist/esm/navigation/hooks.mjs.map +1 -0
  96. package/dist/esm/navigation/index.mjs +5 -0
  97. package/dist/esm/navigation/localizeHref.mjs +24 -0
  98. package/dist/esm/navigation/localizeHref.mjs.map +1 -0
  99. package/dist/esm/package.mjs +119 -0
  100. package/dist/esm/package.mjs.map +1 -0
  101. package/dist/esm/plugin/index.mjs +159 -0
  102. package/dist/esm/plugin/index.mjs.map +1 -0
  103. package/dist/esm/routing.mjs +28 -0
  104. package/dist/esm/routing.mjs.map +1 -0
  105. package/dist/esm/server/getLocale.mjs +11 -0
  106. package/dist/esm/server/getLocale.mjs.map +1 -0
  107. package/dist/esm/server/getMessages.mjs +28 -0
  108. package/dist/esm/server/getMessages.mjs.map +1 -0
  109. package/dist/esm/server/getTranslations.mjs +44 -0
  110. package/dist/esm/server/getTranslations.mjs.map +1 -0
  111. package/dist/esm/server/helpers.mjs +25 -0
  112. package/dist/esm/server/helpers.mjs.map +1 -0
  113. package/dist/esm/server/index.mjs +9 -0
  114. package/dist/esm/server/setLocale.mjs +36 -0
  115. package/dist/esm/server/setLocale.mjs.map +1 -0
  116. package/dist/esm/useDictionary.mjs +43 -0
  117. package/dist/esm/useDictionary.mjs.map +1 -0
  118. package/dist/esm/useDictionaryDynamic.mjs +35 -0
  119. package/dist/esm/useDictionaryDynamic.mjs.map +1 -0
  120. package/dist/esm/useTranslationsDictionary.mjs +35 -0
  121. package/dist/esm/useTranslationsDictionary.mjs.map +1 -0
  122. package/dist/esm/useTranslationsDictionaryDynamic.mjs +27 -0
  123. package/dist/esm/useTranslationsDictionaryDynamic.mjs.map +1 -0
  124. package/dist/types/client/NextIntlClientProvider.d.ts +28 -0
  125. package/dist/types/client/NextIntlClientProvider.d.ts.map +1 -0
  126. package/dist/types/client/helpers.d.ts +45 -0
  127. package/dist/types/client/helpers.d.ts.map +1 -0
  128. package/dist/types/client/index.d.ts +7 -0
  129. package/dist/types/client/useLocale.d.ts +10 -0
  130. package/dist/types/client/useLocale.d.ts.map +1 -0
  131. package/dist/types/client/useTranslations.d.ts +74 -0
  132. package/dist/types/client/useTranslations.d.ts.map +1 -0
  133. package/dist/types/createFormatter.d.ts +15 -0
  134. package/dist/types/createFormatter.d.ts.map +1 -0
  135. package/dist/types/createTranslator.d.ts +40 -0
  136. package/dist/types/createTranslator.d.ts.map +1 -0
  137. package/dist/types/getDictionary.d.ts +23 -0
  138. package/dist/types/getDictionary.d.ts.map +1 -0
  139. package/dist/types/getDictionaryDynamic.d.ts +15 -0
  140. package/dist/types/getDictionaryDynamic.d.ts.map +1 -0
  141. package/dist/types/getTranslationsDictionary.d.ts +15 -0
  142. package/dist/types/getTranslationsDictionary.d.ts.map +1 -0
  143. package/dist/types/getTranslationsDictionaryDynamic.d.ts +12 -0
  144. package/dist/types/getTranslationsDictionaryDynamic.d.ts.map +1 -0
  145. package/dist/types/hasLocale.d.ts +20 -0
  146. package/dist/types/hasLocale.d.ts.map +1 -0
  147. package/dist/types/index.d.ts +9 -0
  148. package/dist/types/middleware.d.ts +22 -0
  149. package/dist/types/middleware.d.ts.map +1 -0
  150. package/dist/types/navigation/Link.d.ts +29 -0
  151. package/dist/types/navigation/Link.d.ts.map +1 -0
  152. package/dist/types/navigation/createNavigation.d.ts +21 -0
  153. package/dist/types/navigation/createNavigation.d.ts.map +1 -0
  154. package/dist/types/navigation/hooks.d.ts +33 -0
  155. package/dist/types/navigation/hooks.d.ts.map +1 -0
  156. package/dist/types/navigation/index.d.ts +5 -0
  157. package/dist/types/navigation/localizeHref.d.ts +23 -0
  158. package/dist/types/navigation/localizeHref.d.ts.map +1 -0
  159. package/dist/types/plugin/index.d.ts +12 -0
  160. package/dist/types/plugin/index.d.ts.map +1 -0
  161. package/dist/types/routing.d.ts +28 -0
  162. package/dist/types/routing.d.ts.map +1 -0
  163. package/dist/types/server/getLocale.d.ts +10 -0
  164. package/dist/types/server/getLocale.d.ts.map +1 -0
  165. package/dist/types/server/getMessages.d.ts +22 -0
  166. package/dist/types/server/getMessages.d.ts.map +1 -0
  167. package/dist/types/server/getTranslations.d.ts +85 -0
  168. package/dist/types/server/getTranslations.d.ts.map +1 -0
  169. package/dist/types/server/helpers.d.ts +21 -0
  170. package/dist/types/server/helpers.d.ts.map +1 -0
  171. package/dist/types/server/index.d.ts +8 -0
  172. package/dist/types/server/setLocale.d.ts +21 -0
  173. package/dist/types/server/setLocale.d.ts.map +1 -0
  174. package/dist/types/useDictionary.d.ts +22 -0
  175. package/dist/types/useDictionary.d.ts.map +1 -0
  176. package/dist/types/useDictionaryDynamic.d.ts +15 -0
  177. package/dist/types/useDictionaryDynamic.d.ts.map +1 -0
  178. package/dist/types/useTranslationsDictionary.d.ts +19 -0
  179. package/dist/types/useTranslationsDictionary.d.ts.map +1 -0
  180. package/dist/types/useTranslationsDictionaryDynamic.d.ts +12 -0
  181. package/dist/types/useTranslationsDictionaryDynamic.d.ts.map +1 -0
  182. package/package.json +142 -0
package/README.md ADDED
@@ -0,0 +1,330 @@
1
+ <p align="center">
2
+ <a href="https://intlayer.org" rel="">
3
+ <img src="https://raw.githubusercontent.com/aymericzip/intlayer/main/docs/assets/cover.png" width="60%" alt="Intlayer Logo" />
4
+ </a>
5
+ </p>
6
+
7
+ <h1 align="center">
8
+ <strong>Per-component i18n</strong>
9
+ </h1>
10
+
11
+ <h2 align="center">
12
+ <strong>AI-powered translation. Visual Editor. Multilingual CMS.</strong>
13
+ </h2>
14
+
15
+ <br />
16
+
17
+ <p align="center">
18
+ <a href="https://intlayer.org/doc/concept/content" rel="">Docs</a> •
19
+ <a href="https://intlayer.org/doc/environment/nextjs" rel="">Next.js</a> •
20
+ <a href="https://intlayer.org/doc/environment/vite-and-react" rel="">React + Vite</a> •
21
+ <a href="https://intlayer.org/doc/concept/cms" rel="">CMS</a> •
22
+ <a href="https://discord.gg/7uxamYVeCk" rel="noopener noreferrer nofollow">Discord</a>
23
+ </p>
24
+ <p align="center" style="margin-top:15px;">
25
+ <a href="https://www.npmjs.com/package/intlayer" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/npm/v/intlayer?style=for-the-badge&labelColor=FFFFFF&color=000000&logoColor=FFFFFF" alt="npm version" height="24"/></a>
26
+ <a href="https://github.com/aymericzip/intlayer/stargazers" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/github/stars/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logo=github&logoColor=FFD700" alt="GitHub Stars" height="24"/></a>
27
+ <a href="https://www.npmjs.org/package/intlayer" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/npm/dm/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000&cacheSeconds=86400" alt="monthly downloads" height="24"/></a>
28
+ <a href="https://github.com/aymericzip/intlayer/blob/main/LICENSE" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/github/license/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000&cacheSeconds=86400" alt="license"/></a>
29
+ <a href="https://github.com/aymericzip/intlayer/commits/main" target="_blank" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/github/last-commit/aymericzip/intlayer?style=for-the-badge&labelColor=000000&color=FFFFFF&logoColor=000000&cacheSeconds=86400" alt="last commit"/>
30
+ </a>
31
+ </p>
32
+
33
+ ![Watch the video](https://github.com/aymericzip/intlayer/blob/main/docs/assets/demo_video.gif)
34
+
35
+ <a href="https://intlayer.org/doc/concept/content" rel="">
36
+ <img src="https://img.shields.io/badge/Get_Started-FFFFFF?style=for-the-badge&logo=rocket&logoColor=black" />
37
+ </a>
38
+
39
+ ## What is Intlayer?
40
+
41
+ Most i18n libraries are either too complex, too rigid, or not built for modern frameworks.
42
+
43
+ Intlayer is a **modern i18n solution** for web and mobile apps.
44
+ It’s framework-agnostic, **AI-powered**, and includes a free **CMS & visual editor**.
45
+
46
+ With **per-locale content files**, **TypeScript autocompletion**, **tree-shakable dictionaries**, and **CI/CD integration**, Intlayer makes internationalization **faster, cleaner, and smarter**.
47
+
48
+ ## Keys benefits of Intlayer:
49
+
50
+ | Feature | Description |
51
+ | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
52
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/frameworks.png?raw=true" alt="Feature" width="700"> | **Cross-Frameworks Support**<br><br>Intlayer is compatible with all major frameworks and libraries, including Next.js, React, Vite, Vue.js, Nuxt, Preact, Express, and more. |
53
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.jpg?raw=true" alt="Feature" width="700"> | **JavaScript-Powered Content Management**<br><br>Harness the flexibility of JavaScript to define and manage your content efficiently. <br><br> - [Content declaration](https://intlayer.org/doc/concept/content) |
54
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/per_locale_content_declaration_file.png?raw=true" alt="Feature" width="700"> | **Per-Locale Content Declaration File**<br><br>Speed up your development by declaring your content once, before auto generation.<br><br> - [Per-Locale Content Declaration File](https://intlayer.org/doc/concept/per-locale-file) |
55
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/compiler.jpg?raw=true" alt="Feature" width="700"> | **Compiler**<br><br>The Intlayer Compiler extract automatically the content from the components and generate the dictionary files.<br><br> - [Compiler](https://intlayer.org/doc/compiler) |
56
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true" alt="Feature" width="700"> | **Type-Safe Environment**<br><br>Leverage TypeScript to ensure your content definitions and code are error-free, while also benefiting from IDE autocompletion.<br><br> - [TypeScript configuration](https://intlayer.org/doc/environment/vite-and-react#configure-typescript) |
57
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/config_file.png?raw=true" alt="Feature" width="700"> | **Simplified Setup**<br><br>Get up and running quickly with minimal configuration. Adjust settings for internationalization, routing, AI, build, and content handling with ease. <br><br> - [Explore Next.js integration](https://intlayer.org/doc/environment/nextjs) |
58
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/content_retrieval.png?raw=true" alt="Feature" width="700"> | **Simplified Content Retrieval**<br><br>No need to call your `t` function for each piece of content. Retrieve all your content directly using a single hook.<br><br> - [React integration](https://intlayer.org/doc/environment/create-react-app) |
59
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/server_component.png?raw=true" alt="Feature" width="700"> | **Consistent Server Component Implementation**<br><br>Perfectly suited for Next.js server components, use the same implementation for both client and server components, no need to pass your `t` function across each server component. <br><br> - [Server Components](https://intlayer.org/doc/environment/nextjs#step-7-utilize-content-in-your-code) |
60
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/file_tree.png?raw=true" alt="Feature" width="700"> | **Organized Codebase**<br><br>Keep your codebase more organized: 1 component = 1 dictionary in the same folder. Translations close to their respective components, enhance maintainability and clarity. <br><br> - [How Intlayer works](https://intlayer.org/doc/concept/how-works-intlayer) |
61
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/url_routing.png?raw=true" alt="Feature" width="700"> | **Enhanced Routing**<br><br>Full support of app routing, adapting seamlessly to complex application structures, for Next.js, React, Vite, Vue.js, etc.<br><br> - [Explore Next.js integration](https://intlayer.org/doc/environment/nextjs) |
62
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/markdown.png?raw=true" alt="Feature" width="700"> | **Markdown Support**<br><br>Import and interpret, locale files and remote Markdown for multilingual content like privacy policies, documentation, etc. Interpret and make Markdown metadata accessible in your code.<br><br> - [Content files](https://intlayer.org/doc/concept/content/file) |
63
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/visual_editor.png?raw=true" alt="Feature" width="700"> | **Free Visual Editor & CMS**<br><br>A free visual editor and CMS are available for content writers, removing the need for a localization platform. Keep your content synchronized using Git, or externalize it totally or partially with the CMS.<br><br> - [Intlayer Editor](https://intlayer.org/doc/concept/editor) <br> - [Intlayer CMS](https://intlayer.org/doc/concept/cms) |
64
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/bundle.png?raw=true" alt="Feature" width="700"> | **Tree-shakable Content**<br><br>Tree-shakable content, reducing the size of the final bundle. Loads content per component, excluding any unused content from your bundle. Supports lazy loading to enhance app loading efficiency. <br><br> - [App build optimization](https://intlayer.org/doc/concept/how-works-intlayer#app-build-optimization) |
65
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/static_rendering.png?raw=true" alt="Feature" width="700"> | **Static Rendering**<br><br>Doesn't block Static Rendering. <br><br> - [Next.js integration](https://intlayer.org/doc/environment/nextjs) |
66
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/AI_translation.png?raw=true" alt="Feature" width="700"> | **AI-Powered Translation**<br><br>Transform your website into 231 languages with just one click using Intlayer's advanced AI-powered translation tools using your own AI provider / API key. <br><br> - [CI/CD integration](https://intlayer.org/doc/concept/ci-cd) <br> - [Intlayer CLI](https://intlayer.org/doc/concept/cli) <br> - [Auto fill](https://intlayer.org/doc/concept/auto-fill) |
67
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/mcp.png?raw=true" alt="Feature" width="700"> | **MCP Server Integration**<br><br>Provides an MCP (Model Context Protocol) server for IDE automation, enabling seamless content management and i18n workflows directly within your development environment. <br><br> - [MCP Server](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md) |
68
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/vscode_extension.png?raw=true" alt="Feature" width="700"> | **VSCode Extension**<br><br>Intlayer provides a VSCode extension to help you manage your content and translations, building your dictionaries, translating your content, and more. <br><br> - [VSCode Extension](https://intlayer.org/doc/vs-code-extension) |
69
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/interoperability.png?raw=true" alt="Feature" width="700"> | **Interoperability**<br><br>Allow interoperability with react-i18next, next-i18next, next-intl, react-intl, vue-i18n. <br><br> - [Intlayer and react-intl](https://intlayer.org/blog/intlayer-with-react-intl) <br> - [Intlayer and next-intl](https://intlayer.org/blog/intlayer-with-next-intl) <br> - [Intlayer and next-i18next](https://intlayer.org/blog/intlayer-with-next-i18next) <br> - [Intlayer and vue-i18n](https://intlayer.org/blog/intlayer-with-vue-i18n) |
70
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/benchmark.png?raw=true" alt="Feature" width="700"> | **Performances & Benchmark**<br><br>Uses advanced tree-shaking and dynamic loading to boost performances and keep the solution as light as possible. <br><br> - [Performances & Benchmark](https://intlayer.org/doc/benchmark) |
71
+
72
+ ---
73
+
74
+ ## 📦 Installation
75
+
76
+ Start your journey with Intlayer today and experience a smoother, more powerful approach to internationalization.
77
+
78
+ <a href="https://intlayer.org/doc/concept/content" rel="">
79
+ <img src="https://img.shields.io/badge/Get_Started-FFFFFF?style=for-the-badge&logo=rocket&logoColor=black" />
80
+ </a>
81
+
82
+ ```bash
83
+ npm install intlayer react-intlayer
84
+ ```
85
+
86
+ ⚡ Quick Start (Next.js)
87
+
88
+ ```ts
89
+ // intlayer.config.ts
90
+ import { Locales, type IntlayerConfig } from "intlayer";
91
+
92
+ const config: IntlayerConfig = {
93
+ internationalization: {
94
+ locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH],
95
+ defaultLocale: Locales.ENGLISH,
96
+ },
97
+ };
98
+
99
+ export default config;
100
+ ```
101
+
102
+ ```ts
103
+ // app/home.content.ts
104
+ import { t, type Dictionary } from "intlayer";
105
+
106
+ const content = {
107
+ key: "home",
108
+ content: {
109
+ title: t({
110
+ en: "Home",
111
+ fr: "Accueil",
112
+ es: "Inicio",
113
+ }),
114
+ },
115
+ } satisfies Dictionary;
116
+
117
+ export default content;
118
+ ```
119
+
120
+ ```tsx
121
+ // app/page.tsx
122
+ import { useIntlayer } from "react-intlayer";
123
+
124
+ const HomePage = () => {
125
+ const { title } = useIntlayer("home");
126
+
127
+ return <h1>{title}</h1>;
128
+ };
129
+ ```
130
+
131
+ <a href="https://intlayer.org/doc/environment/nextjs"> Get the full guide → </a>
132
+
133
+ ## 🎥 Live tutorial on YouTube
134
+
135
+ [![How to Internationalize your application using Intlayer](https://i.ytimg.com/vi/e_PPG7PTqGU/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDtyJ4uYotEjl12nZ_gZKZ_kjEgOQ)](https://youtu.be/e_PPG7PTqGU?si=GyU_KpVhr61razRw)
136
+
137
+ <a href="https://intlayer.org/doc/concept/content" rel="">
138
+ <img src="https://img.shields.io/badge/Get_Started-FFFFFF?style=for-the-badge&logo=rocket&logoColor=black" />
139
+ </a>
140
+
141
+ ## Table of Contents
142
+
143
+ Explore our comprehensive documentation to get started with Intlayer and learn how to integrate it into your projects.
144
+
145
+ <details open>
146
+ <summary style="font-size:16px; font-weight:bold;">📘 Get Started</summary>
147
+ <ul>
148
+ <li><a href="https://intlayer.org/doc/why" rel=''>Why Intlayer?</a></li>
149
+ <li><a href="https://intlayer.org/doc" rel=''>Introduction</a></li>
150
+ </ul>
151
+ </details>
152
+
153
+ <details>
154
+ <summary style="font-size:16px; font-weight:bold;">⚙️ Concept</summary>
155
+ <ul>
156
+ <li><a href="https://intlayer.org/doc/concept/how-works-intlayer" rel=''>How Intlayer Works</a></li>
157
+ <li><a href="https://intlayer.org/doc/concept/configuration" rel=''>Configuration</a></li>
158
+ <li><a href="https://intlayer.org/doc/concept/cli" rel=''>Intlayer CLI</a></li>
159
+ <li><a href="https://intlayer.org/doc/compiler" rel=''>Compiler</a></li>
160
+
161
+ <li><a href="https://intlayer.org/doc/concept/editor" rel=''>Intlayer Editor</a></li>
162
+ <li><a href="https://intlayer.org/doc/concept/cms" rel=''>Intlayer CMS</a></li>
163
+ <li><a href="https://intlayer.org/doc/concept/content" rel=''>Dictionary</a>
164
+ <ul>
165
+ <li><a href="https://intlayer.org/doc/concept/content/per-locale-file" rel=''>Per-Locale Content Declaration File</a></li>
166
+ <li><a href="https://intlayer.org/doc/concept/content/translation" rel=''>Translation</a></li>
167
+ <li><a href="https://intlayer.org/doc/concept/content/enumeration" rel=''>Enumeration</a></li>
168
+ <li><a href="https://intlayer.org/doc/concept/content/condition" rel=''>Condition</a></li>
169
+ <li><a href="https://intlayer.org/doc/concept/content/nesting" rel=''>Nesting</a></li>
170
+ <li><a href="https://intlayer.org/doc/concept/content/markdown" rel=''>Markdown</a></li>
171
+ <li><a href="https://intlayer.org/doc/concept/content/function-fetching" rel=''>Function Fetching</a></li>
172
+ <li><a href="https://intlayer.org/doc/concept/content/insertion" rel=''>Insertion</a></li>
173
+ <li><a href="https://intlayer.org/doc/concept/content/file" rel=''>File</a></li>
174
+ </ul>
175
+ </li>
176
+ </ul>
177
+ </details>
178
+
179
+ <details open>
180
+ <summary style="font-size:16px; font-weight:bold;">🌐 Environment</summary>
181
+ <ul>
182
+ <li><a href="https://intlayer.org/doc/environment/nextjs" rel=''>Intlayer with Next.js 16</a>
183
+ <ul>
184
+ <li><a href="https://intlayer.org/doc/environment/nextjs/15" rel=''>Next.js 15</a></li>
185
+ <li><a href="https://intlayer.org/doc/environment/nextjs/14" rel=''>Next.js 14 (App Router)</a></li>
186
+ <li><a href="https://intlayer.org/doc/environment/nextjs/next-with-Page-Router" rel=''>Next.js Page Router</a></li>
187
+ <li><a href="https://intlayer.org/doc/environment/nextjs/compiler" rel=''>Next.js using Compiler</a></li>
188
+ </ul>
189
+ </li>
190
+ <li><a href="https://intlayer.org/doc/environment/create-react-app" rel=''>React CRA</a></li>
191
+ <li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React</a></li>
192
+ <li><a href="https://intlayer.org/doc/environment/vite-and-react" rel=''>Vite + React using Compiler</a></li>
193
+ <li><a href="https://intlayer.org/doc/environment/vite-and-react/compiler" rel=''>React-router-v7</a></li>
194
+ <li><a href="https://intlayer.org/doc/environment/tanstack-start" rel=''>Tanstack start</a>
195
+ <ul>
196
+ <li><a href="https://intlayer.org/doc/environment/tanstack-start/solid" rel=''>Solid</a></li>
197
+ </ul>
198
+ </li>
199
+ <li><a href="https://intlayer.org/doc/environment/astro" rel=''>Astro</a>
200
+ <ul>
201
+ <li><a href="https://intlayer.org/doc/environment/astro/react" rel=''>React</a></li>
202
+ <li><a href="https://intlayer.org/doc/environment/astro/vue" rel=''>Vue</a></li>
203
+ <li><a href="https://intlayer.org/doc/environment/astro/svelte" rel=''>Svelte</a></li>
204
+ <li><a href="https://intlayer.org/doc/environment/astro/solid" rel=''>Solid</a></li>
205
+ <li><a href="https://intlayer.org/doc/environment/astro/vanilla" rel=''>Vanilla JS</a></li>
206
+ <li><a href="https://intlayer.org/doc/environment/astro/lit" rel=''>Lit</a></li>
207
+ </ul>
208
+ </li>
209
+
210
+ <li><a href="https://intlayer.org/doc/environment/react-native-and-expo" rel=''>React Native</a></li>
211
+ <li><a href="https://intlayer.org/doc/environment/vite-and-svelte" rel=''>Vite + Svelte</a></li>
212
+ <li><a href="https://intlayer.org/doc/environment/sveltekit" rel=''>SvelteKit</a></li>
213
+ <li><a href="https://intlayer.org/doc/environment/vite-and-preact" rel=''>Vite + Preact</a></li>
214
+ <li><a href="https://intlayer.org/doc/environment/vite-and-vue" rel=''>Vite + Vue</a></li>
215
+ <li><a href="https://intlayer.org/doc/environment/vite-and-nuxt" rel=''>Vite + Nuxt</a></li>
216
+ <li><a href="https://intlayer.org/doc/environment/vite-and-solid" rel=''>Vite + Solid</a></li>
217
+ <li><a href="https://intlayer.org/doc/environment/angular" rel=''>Angular</a></li>
218
+ <li>
219
+ <a href="https://intlayer.org/doc/environment/express" rel=''>Backend</a>
220
+ <ul>
221
+ <li><a href="https://intlayer.org/doc/environment/express" rel=''>Express</a></li>
222
+ <li><a href="https://intlayer.org/doc/environment/nest" rel=''>NestJS</a></li>
223
+ <li><a href="https://intlayer.org/doc/environment/fastify" rel=''>Fastify</a></li>
224
+ <li><a href="https://intlayer.org/doc/environment/adonisjs" rel=''>AdonisJS</a></li>
225
+ <li><a href="https://intlayer.org/doc/environment/hono" rel=''>Hono</a></li>
226
+ </ul>
227
+ </li>
228
+ </ul>
229
+ </details>
230
+
231
+ <details>
232
+ <summary style="font-size:16px; font-weight:bold;">📊 Benchmark</summary>
233
+ <ul>
234
+ <li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/benchmark/nextjs.md" rel=''>Next.js</a></li>
235
+ <li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/benchmark/tanstack.md" rel=''>TanStack Start</a></li>
236
+ <li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/benchmark/vue.md" rel=''>Vue</a></li>
237
+ <li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/benchmark/solid.md" rel=''>Solid</a></li>
238
+ <li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/benchmark/svelte.md" rel=''>Svelte</a></li>
239
+ </ul>
240
+ </details>
241
+
242
+ <details>
243
+ <summary style="font-size:16px; font-weight:bold;">📰 Blog</summary>
244
+ <ul>
245
+ <li><a href="https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/what_is_internationalization.md" rel=''>What is i18n</a></li>
246
+ <li><a href="https://intlayer.org/blog/SEO-and-i18n" rel=''>i18n and SEO</a></li>
247
+ <li><a href="https://intlayer.org/blog/intlayer-with-next-i18next" rel=''>Intlayer and i18next</a></li>
248
+ <li><a href="https://intlayer.org/blog/intlayer-with-react-i18next" rel=''>Intlayer and react-intl</a></li>
249
+ <li><a href="https://intlayer.org/blog/intlayer-with-next-intl" rel=''>Intlayer and next-intl</a></li>
250
+ </ul>
251
+ </details>
252
+
253
+ ## Multilingual content management system
254
+
255
+ More than an i18n library, Intlayer is a complete **multilingual content management system**. A full CMS is available for free at [app.intlayer.org](https://app.intlayer.org).
256
+
257
+ Intlayer connects **developers**, **copywriters**, and **AI agents** in one workflow for creating and maintaining multilingual websites effortlessly.Intlayer replaces the following stack in a single solution:
258
+
259
+ - i18n solutions (e.g. `i18next`, `next-intl`, `vue-i18n`)
260
+ - TMSs (Translation Management Systems) (e.g. Crowdin, Phrase, Lokalise)
261
+ - Feature flags
262
+ - Headless CMSs (e.g. Contentful, Strapi, Sanity)
263
+
264
+ ![CMS Preview](https://github.com/aymericzip/intlayer/blob/main/docs/assets/CMS.png?raw=true)
265
+
266
+ ## 🌐 Readme in other languages
267
+
268
+ <p align="center">
269
+ <a href="https://github.com/aymericzip/intlayer/blob/main/readme.md">English</a> •
270
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/readme.md">简体中文</a> •
271
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/ru/readme.md">Русский</a> •
272
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/readme.md">日本語</a> •
273
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/fr/readme.md">Français</a> •
274
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/ko/readme.md">한국어</a> •
275
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/es/readme.md">Español</a> •
276
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/de/readme.md">Deutsch</a> •
277
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/readme.md">العربية</a> •
278
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/readme.md">Italiano</a> •
279
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/readme.md">English (UK)</a> •
280
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/readme.md">Português</a> •
281
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/hi/readme.md">हिन्दी</a> •
282
+ <a href="https://github.com/aymericzip/intlayer/blob/main/docs/docs/tr/readme.md">Türkçe</a>
283
+ </p>
284
+
285
+ ## 🤝 Community
286
+
287
+ Intlayer is built with and for the community and we’d love your input!
288
+
289
+ - Have a suggestion? [Open an issue](https://github.com/aymericzip/intlayer/issues)
290
+ - Found a bug or improvement? [Submit a PR](https://github.com/aymericzip/intlayer/pulls)
291
+ - Need help or want to connect? [Join our Discord](https://discord.gg/7uxamYVeCk)
292
+
293
+ You can also follow us on :
294
+
295
+ <div>
296
+ <br/>
297
+ <p align="center">
298
+ <a href="https://discord.gg/528mBV4N" target="blank" rel='noopener noreferrer nofollow'><img align="center"
299
+ src="https://img.shields.io/badge/discord-5865F2.svg?style=for-the-badge&logo=discord&logoColor=white"
300
+ alt="Intlayer Discord" height="30"/></a>
301
+ <a href="https://www.linkedin.com/company/intlayerorg" target="blank" rel='noopener noreferrer nofollow'><img align="center"
302
+ src="https://img.shields.io/badge/linkedin-%231DA1F2.svg?style=for-the-badge&logo=linkedin&logoColor=white"
303
+ alt="Intlayer LinkedIn" height="30"/></a>
304
+ <a href="https://www.instagram.com/intlayer/" target="blank" rel='noopener noreferrer nofollow'><img align="center"
305
+ src="https://img.shields.io/badge/instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white"
306
+ alt="Intlayer Instagram" height="30"/></a>
307
+ <a href="https://x.com/Intlayer183096" target="blank" rel='noopener noreferrer nofollow'><img align="center"
308
+ src="https://img.shields.io/badge/x-1DA1F2.svg?style=for-the-badge&logo=x&logoColor=white"
309
+ alt="Intlayer X" height="30"/></a>
310
+ <a href="https://www.youtube.com/@intlayer" target="blank" rel='noopener noreferrer nofollow'><img align="center"
311
+ src="https://img.shields.io/badge/youtube-FF0000.svg?style=for-the-badge&logo=youtube&logoColor=white"
312
+ alt="Intlayer YouTube" height="30"/></a>
313
+ <a href="https://www.tiktok.com/@intlayer" target="blank" rel='noopener noreferrer nofollow'><img align="center"
314
+ src="https://img.shields.io/badge/tiktok-000000.svg?style=for-the-badge&logo=tiktok&logoColor=white"
315
+ alt="Intlayer TikTok" height="30"/></a>
316
+ <br>
317
+ </p>
318
+ </div>
319
+
320
+ ### Contribution
321
+
322
+ For more detailed guidelines on contributing to this project, please refer to the [`CONTRIBUTING.md`](https://github.com/aymericzip/intlayer/blob/main/CONTRIBUTING.md) file. It contains essential information on our development process, commit message conventions, and release procedures. Your contributions are valuable to us, and we appreciate your efforts in making this project better!
323
+
324
+ Contribute on [GitHub](https://github.com/aymericzip/intlayer), [GitLab](https://gitlab.com/ay.pineau/intlayer), or [Bitbucket](https://bitbucket.org/intlayer/intlayer/).
325
+
326
+ ### Thank You for the Support
327
+
328
+ If you like Intlayer, give us a ⭐ on GitHub. It helps others discover the project! [See why GitHub Stars matter](https://github.com/aymericzip/intlayer/blob/main/CONTRIBUTING.md#why-github-stars-matter-).
329
+
330
+ [![Star History Chart](https://api.star-history.com/svg?repos=aymericzip/intlayer&type=Date)](https://star-history.com/#aymericzip/intlayer&Date)
@@ -0,0 +1,29 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
@@ -0,0 +1,28 @@
1
+ 'use client';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
5
+ let _intlayer_config_built = require("@intlayer/config/built");
6
+ let next_intlayer = require("next-intlayer");
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+ let _intlayer_config_colors = require("@intlayer/config/colors");
9
+ let _intlayer_config_logger = require("@intlayer/config/logger");
10
+
11
+ //#region src/client/NextIntlClientProvider.tsx
12
+ /**
13
+ * Drop-in for next-intl's `NextIntlClientProvider`.
14
+ * `messages`, `timeZone`, and `now` are accepted for API compatibility
15
+ * but have no effect — Intlayer uses its own compiled dictionaries.
16
+ */
17
+ const NextIntlClientProvider = ({ locale, children, messages: _messages, timeZone: _timeZone, now: _now, ...rest }) => {
18
+ if (process.env.NODE_ENV === "development" && typeof _messages !== "undefined") (0, _intlayer_config_logger.getAppLogger)({ log: _intlayer_config_built.log })(`${(0, _intlayer_config_logger.colorize)("NextIntlClientProvider", _intlayer_config_colors.CYAN)} do not pass the messages prop with intlayer. Messages are loaded automatically under the hood for bundle optimization reason`);
19
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(next_intlayer.IntlayerClientProvider, {
20
+ locale,
21
+ ...rest,
22
+ children
23
+ }, String(locale));
24
+ };
25
+
26
+ //#endregion
27
+ exports.NextIntlClientProvider = NextIntlClientProvider;
28
+ //# sourceMappingURL=NextIntlClientProvider.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NextIntlClientProvider.cjs","names":["CYAN","IntlayerClientProvider"],"sources":["../../../src/client/NextIntlClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport { log } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport type { NextIntlClientProvider as _NextIntlClientProvider } from 'next-intl';\nimport { IntlayerClientProvider } from 'next-intlayer';\nimport type { ComponentProps } from 'react';\n\n/**\n * Drop-in for next-intl's `NextIntlClientProvider`.\n * `messages`, `timeZone`, and `now` are accepted for API compatibility\n * but have no effect — Intlayer uses its own compiled dictionaries.\n */\nexport const NextIntlClientProvider: typeof _NextIntlClientProvider = ({\n locale,\n children,\n messages: _messages,\n timeZone: _timeZone,\n now: _now,\n ...rest\n}) => {\n if (\n process.env.NODE_ENV === 'development' &&\n typeof _messages !== 'undefined'\n ) {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('NextIntlClientProvider', CYAN)} do not pass the messages prop with intlayer. Messages are loaded automatically under the hood for bundle optimization reason`\n );\n }\n\n // `key={locale}` remounts the provider when the locale changes via navigation\n // (next-intl switches locale by routing to a locale-prefixed path). This\n // re-seeds the client locale context from the new `locale` prop so client\n // components re-render in the new language instead of keeping the previous one.\n return (\n <IntlayerClientProvider key={String(locale)} locale={locale} {...rest}>\n {children}\n </IntlayerClientProvider>\n );\n};\n\n/**\n *\n */\nexport type NextIntlClientProviderProps = Omit<\n ComponentProps<typeof _NextIntlClientProvider>,\n 'messages'\n> & {\n /**\n * @deprecated\n * has no use case with intlayer. Messages are loaded automatically under the hood for bundle optimization reason\n */\n messages?: never;\n /**\n * locale\n */\n locale: LocalesValues;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAa,0BAA0D,EACrE,QACA,UACA,UAAU,WACV,UAAU,WACV,KAAK,MACL,GAAG,WACC;AACJ,KACE,QAAQ,IAAI,aAAa,iBACzB,OAAO,cAAc,YAGrB,2CAD+B,EAAE,iCAAK,CAC7B,CACP,yCAAY,0BAA0BA,6BAAK,CAAC,+HAC7C;AAOH,QACE,2CAACC,sCAAD;EAAqD;EAAQ,GAAI;EAC9D;EACsB,EAFI,OAAO,OAAO,CAElB"}
@@ -0,0 +1,66 @@
1
+ 'use client';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
5
+ const require_createFormatter = require('../createFormatter.cjs');
6
+ let _intlayer_config_built = require("@intlayer/config/built");
7
+ let next_intlayer = require("next-intlayer");
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ let _intlayer_config_colors = require("@intlayer/config/colors");
10
+ let _intlayer_config_logger = require("@intlayer/config/logger");
11
+
12
+ //#region src/client/helpers.tsx
13
+ /**
14
+ * Drop-in for next-intl's `useNow`.
15
+ * Returns the current `Date`. The `updateInterval` option is ignored.
16
+ */
17
+ const useNow = () => /* @__PURE__ */ new Date();
18
+ /**
19
+ * Drop-in for next-intl's `useTimeZone`.
20
+ * Returns the system time zone resolved from `Intl.DateTimeFormat`.
21
+ */
22
+ const useTimeZone = () => Intl.DateTimeFormat().resolvedOptions().timeZone;
23
+ /**
24
+ * Drop-in for next-intl's `useMessages`.
25
+ *
26
+ * @deprecated useMessages has no use case with intlayer.
27
+ * Messages are loaded automatically under the hood.
28
+ * @returns An empty object.
29
+ */
30
+ const useMessages = () => {
31
+ if (process.env.NODE_ENV === "development") (0, _intlayer_config_logger.getAppLogger)({ log: _intlayer_config_built.log })(`${(0, _intlayer_config_logger.colorize)("useMessages", _intlayer_config_colors.CYAN)} has no use case with intlayer. Messages are loaded automatically under the hood for bundle optimization reason`);
32
+ return {};
33
+ };
34
+ /**
35
+ * Drop-in for next-intl's `useFormatter`.
36
+ * Returns locale-aware formatters backed by the native `Intl.*` APIs:
37
+ * `dateTime`, `number`, `dateTimeRange`, `relativeTime`, `list`, and
38
+ * `displayName`.
39
+ */
40
+ const useFormatter = () => {
41
+ const { locale } = (0, next_intlayer.useLocale)();
42
+ return require_createFormatter.createFormatter(locale ?? "en");
43
+ };
44
+ /**
45
+ * Drop-in for next-intl's `IntlProvider`.
46
+ * Renders children as-is — Intlayer provides its own context via
47
+ * `IntlayerClientProvider`.
48
+ *
49
+ * @deprecated IntlProvider has no use case with intlayer.
50
+ * Use `IntlayerClientProvider` or `NextIntlClientProvider` instead.
51
+ */
52
+ const IntlProvider = ({ children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
53
+ /**
54
+ * @internal Not part of the public next-intl API surface; provided for
55
+ * internal compatibility shims only.
56
+ */
57
+ const useExtracted = (..._args) => ({});
58
+
59
+ //#endregion
60
+ exports.IntlProvider = IntlProvider;
61
+ exports.useExtracted = useExtracted;
62
+ exports.useFormatter = useFormatter;
63
+ exports.useMessages = useMessages;
64
+ exports.useNow = useNow;
65
+ exports.useTimeZone = useTimeZone;
66
+ //# sourceMappingURL=helpers.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.cjs","names":["CYAN","createFormatter"],"sources":["../../../src/client/helpers.tsx"],"sourcesContent":["'use client';\n\nimport { log } from '@intlayer/config/built';\nimport { CYAN } from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport type {\n IntlProvider as _IntlProvider,\n useFormatter as _useFormatter,\n useMessages as _useMessages,\n useNow as _useNow,\n useTimeZone as _useTimeZone,\n} from 'next-intl';\nimport { useLocale } from 'next-intlayer';\nimport type * as React from 'react';\nimport { createFormatter } from '../createFormatter';\n\n/**\n * Drop-in for next-intl's `useNow`.\n * Returns the current `Date`. The `updateInterval` option is ignored.\n */\nexport const useNow: typeof _useNow = () => new Date();\n\n/**\n * Drop-in for next-intl's `useTimeZone`.\n * Returns the system time zone resolved from `Intl.DateTimeFormat`.\n */\nexport const useTimeZone: typeof _useTimeZone = () =>\n Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n/**\n * Drop-in for next-intl's `useMessages`.\n *\n * @deprecated useMessages has no use case with intlayer.\n * Messages are loaded automatically under the hood.\n * @returns An empty object.\n */\nexport const useMessages: typeof _useMessages = () => {\n if (process.env.NODE_ENV === 'development') {\n const appLogger = getAppLogger({ log });\n appLogger(\n `${colorize('useMessages', CYAN)} has no use case with intlayer. Messages are loaded automatically under the hood for bundle optimization reason`\n );\n }\n\n return {} as ReturnType<typeof _useMessages>;\n};\n\n/**\n * Drop-in for next-intl's `useFormatter`.\n * Returns locale-aware formatters backed by the native `Intl.*` APIs:\n * `dateTime`, `number`, `dateTimeRange`, `relativeTime`, `list`, and\n * `displayName`.\n */\nexport const useFormatter: typeof _useFormatter = () => {\n const { locale } = useLocale();\n return createFormatter((locale as string) ?? 'en');\n};\n\ninterface ProviderProps {\n children?: React.ReactNode;\n [key: string]: unknown;\n}\n\n/**\n * Drop-in for next-intl's `IntlProvider`.\n * Renders children as-is — Intlayer provides its own context via\n * `IntlayerClientProvider`.\n *\n * @deprecated IntlProvider has no use case with intlayer.\n * Use `IntlayerClientProvider` or `NextIntlClientProvider` instead.\n */\nexport const IntlProvider: typeof _IntlProvider = ({\n children,\n}: ProviderProps) => <>{children}</>;\n\n/**\n * @internal Not part of the public next-intl API surface; provided for\n * internal compatibility shims only.\n */\nexport const useExtracted = (..._args: unknown[]) => ({});\n"],"mappings":";;;;;;;;;;;;;;;;AAoBA,MAAa,+BAA+B,IAAI,MAAM;;;;;AAMtD,MAAa,oBACX,KAAK,gBAAgB,CAAC,iBAAiB,CAAC;;;;;;;;AAS1C,MAAa,oBAAyC;AACpD,KAAI,QAAQ,IAAI,aAAa,cAE3B,2CAD+B,EAAE,iCAAK,CAC7B,CACP,yCAAY,eAAeA,6BAAK,CAAC,iHAClC;AAGH,QAAO,EAAE;;;;;;;;AASX,MAAa,qBAA2C;CACtD,MAAM,EAAE,yCAAsB;AAC9B,QAAOC,wCAAiB,UAAqB,KAAK;;;;;;;;;;AAgBpD,MAAa,gBAAsC,EACjD,eACmB,yEAAG,UAAY;;;;;AAMpC,MAAa,gBAAgB,GAAG,WAAsB,EAAE"}
@@ -0,0 +1,19 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_useDictionaryDynamic = require('../useDictionaryDynamic.cjs');
3
+ const require_useDictionary = require('../useDictionary.cjs');
4
+ const require_client_helpers = require('./helpers.cjs');
5
+ const require_client_NextIntlClientProvider = require('./NextIntlClientProvider.cjs');
6
+ const require_client_useLocale = require('./useLocale.cjs');
7
+ const require_client_useTranslations = require('./useTranslations.cjs');
8
+
9
+ exports.IntlProvider = require_client_helpers.IntlProvider;
10
+ exports.NextIntlClientProvider = require_client_NextIntlClientProvider.NextIntlClientProvider;
11
+ exports.useDictionary = require_useDictionary.useDictionary;
12
+ exports.useDictionaryDynamic = require_useDictionaryDynamic.useDictionaryDynamic;
13
+ exports.useExtracted = require_client_helpers.useExtracted;
14
+ exports.useFormatter = require_client_helpers.useFormatter;
15
+ exports.useLocale = require_client_useLocale.useLocale;
16
+ exports.useMessages = require_client_helpers.useMessages;
17
+ exports.useNow = require_client_helpers.useNow;
18
+ exports.useTimeZone = require_client_helpers.useTimeZone;
19
+ exports.useTranslations = require_client_useTranslations.useTranslations;
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
5
+ let next_intlayer = require("next-intlayer");
6
+
7
+ //#region src/client/useLocale.ts
8
+ /**
9
+ * Drop-in for next-intl's `useLocale`.
10
+ */
11
+ const useLocale = () => {
12
+ const { locale } = (0, next_intlayer.useLocale)();
13
+ return locale;
14
+ };
15
+
16
+ //#endregion
17
+ exports.useLocale = useLocale;
18
+ //# sourceMappingURL=useLocale.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLocale.cjs","names":[],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["'use client';\n\nimport type { useLocale as _useLocale } from 'next-intl';\nimport { useLocale as useLocaleIntlayer } from 'next-intlayer';\n\n/**\n * Drop-in for next-intl's `useLocale`.\n */\nexport const useLocale: typeof _useLocale = (): string => {\n const { locale } = useLocaleIntlayer();\n return locale as string;\n};\n"],"mappings":";;;;;;;;;;AAQA,MAAa,kBAA6C;CACxD,MAAM,EAAE,yCAA8B;AACtC,QAAO"}
@@ -0,0 +1,39 @@
1
+ 'use client';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
5
+ const require_createTranslator = require('../createTranslator.cjs');
6
+ let next_intlayer = require("next-intlayer");
7
+ let react = require("react");
8
+
9
+ //#region src/client/useTranslations.ts
10
+ /**
11
+ * Drop-in for next-intl's `useTranslations`.
12
+ *
13
+ * Messages support ICU MessageFormat syntax: simple arguments (`{name}`),
14
+ * plural (`{count, plural, one {…} other {…}}`, `#`), select, and formatted
15
+ * arguments (`{value, number}`). Rich text is available through `t.rich()`
16
+ * and `t.markup()`.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * const t = useTranslations('about');
21
+ * t('counter.label'); // ✓ typed
22
+ * t('items', { count: 3 }); // ICU plural
23
+ *
24
+ * // Scoped to a nested object (next-intl idiom)
25
+ * const t = useTranslations('about.counter');
26
+ * t('label'); // resolves about → counter.label
27
+ *
28
+ * // Rich text
29
+ * t.rich('terms', { link: (chunks) => <a href="/terms">{chunks}</a> });
30
+ * ```
31
+ */
32
+ const useTranslations = ((namespace) => {
33
+ const { locale: currentLocale } = (0, react.useContext)(next_intlayer.IntlayerClientContext) ?? {};
34
+ return (0, react.useMemo)(() => require_createTranslator.createTranslator(currentLocale, namespace), [currentLocale, namespace]);
35
+ });
36
+
37
+ //#endregion
38
+ exports.useTranslations = useTranslations;
39
+ //# sourceMappingURL=useTranslations.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTranslations.cjs","names":["IntlayerClientContext","createTranslator"],"sources":["../../../src/client/useTranslations.ts"],"sourcesContent":["'use client';\n\nimport type { ValidDotPathsFor } from '@intlayer/core/transpiler';\nimport type {\n DictionaryKeys,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { IntlayerClientContext } from 'next-intlayer';\nimport { type ReactNode, useContext, useMemo } from 'react';\nimport {\n createTranslator,\n type MarkupChunkRenderer,\n type RichChunkRenderer,\n} from '../createTranslator';\n\n/**\n * The translation function returned by {@link useTranslations}.\n *\n * When the namespace is a bare dictionary key, `key` is validated against the\n * dictionary's dot-paths. When the namespace is a nested scope\n * (`'about.counter'`), `key` is a relative `string` path.\n *\n * Beyond the call signature, the function exposes:\n * - `has(key)` — returns `true` when the key exists in the namespace.\n * - `raw(key)` — returns the unprocessed content value.\n * - `rich(key, values)` — resolves `<tag>chunks</tag>` markup to React nodes.\n * - `markup(key, values)` — resolves `<tag>chunks</tag>` markup to a string.\n */\ntype TranslateFunction<N extends DictionaryKeys> = {\n /** Translate a key to a string, with optional ICU interpolation params. */\n <P extends ValidDotPathsFor<N>>(\n key: P,\n params?: Record<string, unknown>\n ): string;\n /** Returns `true` if the given key exists in the namespace. */\n has<P extends ValidDotPathsFor<N>>(key: P): boolean;\n /** Returns the raw unprocessed content for the given key. */\n raw<P extends ValidDotPathsFor<N>>(key: P): unknown;\n /** Resolves rich-text markup, mapping tags through React renderers. */\n rich<P extends ValidDotPathsFor<N>>(\n key: P,\n values?: Record<string, RichChunkRenderer | ReactNode>\n ): ReactNode;\n /** Resolves rich-text markup, mapping tags through string renderers. */\n markup<P extends ValidDotPathsFor<N>>(\n key: P,\n values?: Record<string, MarkupChunkRenderer | string | number>\n ): string;\n};\n\n/** Loosely-typed function returned for nested `'dict.scope'` namespaces. */\ntype LooseTranslateFunction = {\n (key: string, params?: Record<string, unknown>): string;\n has(key: string): boolean;\n raw(key: string): unknown;\n rich(\n key: string,\n values?: Record<string, RichChunkRenderer | ReactNode>\n ): ReactNode;\n markup(\n key: string,\n values?: Record<string, MarkupChunkRenderer | string | number>\n ): string;\n};\n\n/**\n * Overload set for {@link useTranslations}:\n *\n * 1. A bare dictionary key → fully-typed `t()` (autocompleted dot-paths).\n * 2. A nested namespace `'dictionary.sub.scope'` → `t()` accepts relative\n * `string` paths, matching next-intl's scoped-namespace behaviour.\n * 3. No namespace → root scope; the first segment of each key designates\n * the dictionary (`t('about.title')`).\n */\ntype UseTranslations = {\n <N extends DictionaryKeys>(namespace: N): TranslateFunction<N>;\n (namespace: `${string}.${string}`): LooseTranslateFunction;\n (): LooseTranslateFunction;\n};\n\n/**\n * Drop-in for next-intl's `useTranslations`.\n *\n * Messages support ICU MessageFormat syntax: simple arguments (`{name}`),\n * plural (`{count, plural, one {…} other {…}}`, `#`), select, and formatted\n * arguments (`{value, number}`). Rich text is available through `t.rich()`\n * and `t.markup()`.\n *\n * @example\n * ```tsx\n * const t = useTranslations('about');\n * t('counter.label'); // ✓ typed\n * t('items', { count: 3 }); // ICU plural\n *\n * // Scoped to a nested object (next-intl idiom)\n * const t = useTranslations('about.counter');\n * t('label'); // resolves about → counter.label\n *\n * // Rich text\n * t.rich('terms', { link: (chunks) => <a href=\"/terms\">{chunks}</a> });\n * ```\n */\nexport const useTranslations = ((namespace?: string) => {\n const { locale: currentLocale } = useContext(IntlayerClientContext) ?? {};\n\n return useMemo(\n () => createTranslator(currentLocale as LocalesValues, namespace),\n [currentLocale, namespace]\n );\n}) as UseTranslations;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsGA,MAAa,oBAAoB,cAAuB;CACtD,MAAM,EAAE,QAAQ,wCAA6BA,oCAAsB,IAAI,EAAE;AAEzE,iCACQC,0CAAiB,eAAgC,UAAU,EACjE,CAAC,eAAe,UAAU,CAC3B"}