@intlayer/docs 5.7.7 → 5.8.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/blog/ar/intlayer_with_next-i18next.md +3 -4
  2. package/blog/ar/intlayer_with_next-intl.md +3 -4
  3. package/blog/ar/intlayer_with_react-i18next.md +1 -1
  4. package/blog/ar/intlayer_with_react-intl.md +1 -1
  5. package/blog/de/intlayer_with_next-i18next.md +3 -4
  6. package/blog/de/intlayer_with_react-intl.md +1 -1
  7. package/blog/en/intlayer_with_next-i18next.md +3 -4
  8. package/blog/en/intlayer_with_next-intl.md +3 -4
  9. package/blog/en/intlayer_with_react-i18next.md +1 -1
  10. package/blog/en/intlayer_with_react-intl.md +1 -1
  11. package/blog/en-GB/intlayer_with_next-i18next.md +3 -4
  12. package/blog/en-GB/intlayer_with_next-intl.md +3 -4
  13. package/blog/en-GB/intlayer_with_react-i18next.md +1 -1
  14. package/blog/en-GB/intlayer_with_react-intl.md +1 -1
  15. package/blog/es/intlayer_with_next-i18next.md +3 -4
  16. package/blog/es/intlayer_with_next-intl.md +3 -4
  17. package/blog/es/intlayer_with_react-i18next.md +1 -1
  18. package/blog/es/intlayer_with_react-intl.md +1 -1
  19. package/blog/fr/intlayer_with_next-i18next.md +3 -4
  20. package/blog/fr/intlayer_with_next-intl.md +3 -4
  21. package/blog/fr/intlayer_with_react-i18next.md +1 -1
  22. package/blog/fr/intlayer_with_react-intl.md +1 -1
  23. package/blog/hi/intlayer_with_next-i18next.md +3 -4
  24. package/blog/hi/intlayer_with_next-intl.md +3 -4
  25. package/blog/hi/intlayer_with_react-i18next.md +1 -1
  26. package/blog/hi/intlayer_with_react-intl.md +1 -1
  27. package/blog/it/intlayer_with_next-i18next.md +3 -4
  28. package/blog/it/intlayer_with_next-intl.md +3 -4
  29. package/blog/it/intlayer_with_react-i18next.md +1 -1
  30. package/blog/it/intlayer_with_react-intl.md +1 -1
  31. package/blog/ja/intlayer_with_next-i18next.md +3 -4
  32. package/blog/ja/intlayer_with_next-intl.md +3 -4
  33. package/blog/ja/intlayer_with_react-intl.md +1 -1
  34. package/blog/ko/intlayer_with_next-i18next.md +3 -4
  35. package/blog/ko/intlayer_with_next-intl.md +3 -4
  36. package/blog/ko/intlayer_with_react-intl.md +1 -1
  37. package/blog/pt/intlayer_with_next-i18next.md +3 -4
  38. package/blog/pt/intlayer_with_next-intl.md +3 -4
  39. package/blog/pt/intlayer_with_react-intl.md +1 -1
  40. package/blog/ru/intlayer_with_next-i18next.md +3 -4
  41. package/blog/ru/intlayer_with_next-intl.md +3 -4
  42. package/blog/ru/intlayer_with_react-i18next.md +1 -1
  43. package/blog/ru/intlayer_with_react-intl.md +1 -1
  44. package/blog/zh/intlayer_with_next-i18next.md +3 -4
  45. package/blog/zh/intlayer_with_next-intl.md +3 -4
  46. package/blog/zh/intlayer_with_react-i18next.md +1 -1
  47. package/blog/zh/intlayer_with_react-intl.md +1 -1
  48. package/dist/cjs/generated/docs.entry.cjs +41 -0
  49. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  50. package/dist/esm/generated/docs.entry.mjs +41 -0
  51. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  52. package/dist/types/generated/docs.entry.d.ts +1 -0
  53. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  54. package/docs/ar/CI_CD.md +67 -41
  55. package/docs/ar/formatters.md +239 -0
  56. package/docs/ar/interest_of_intlayer.md +162 -49
  57. package/docs/ar/introduction.md +3 -3
  58. package/docs/ar/packages/intlayer/index.md +3 -3
  59. package/docs/ar/packages/next-intlayer/index.md +3 -3
  60. package/docs/de/CI_CD.md +63 -37
  61. package/docs/de/formatters.md +239 -0
  62. package/docs/de/interest_of_intlayer.md +161 -47
  63. package/docs/de/introduction.md +3 -3
  64. package/docs/de/packages/intlayer/index.md +3 -3
  65. package/docs/de/packages/next-intlayer/index.md +3 -3
  66. package/docs/de/packages/react-intlayer/index.md +3 -3
  67. package/docs/en/CI_CD.md +51 -27
  68. package/docs/en/formatters.md +250 -0
  69. package/docs/en/interest_of_intlayer.md +159 -46
  70. package/docs/en/introduction.md +3 -3
  71. package/docs/en/packages/intlayer/index.md +3 -3
  72. package/docs/en/packages/next-intlayer/index.md +3 -3
  73. package/docs/en/packages/react-intlayer/index.md +3 -3
  74. package/docs/en-GB/CI_CD.md +58 -32
  75. package/docs/en-GB/formatters.md +239 -0
  76. package/docs/en-GB/interest_of_intlayer.md +160 -53
  77. package/docs/en-GB/packages/intlayer/index.md +3 -3
  78. package/docs/en-GB/packages/next-intlayer/index.md +3 -3
  79. package/docs/en-GB/packages/react-intlayer/index.md +3 -3
  80. package/docs/es/CI_CD.md +68 -42
  81. package/docs/es/formatters.md +239 -0
  82. package/docs/es/interest_of_intlayer.md +159 -47
  83. package/docs/es/introduction.md +3 -3
  84. package/docs/es/packages/intlayer/index.md +3 -3
  85. package/docs/es/packages/next-intlayer/index.md +3 -3
  86. package/docs/fr/formatters.md +239 -0
  87. package/docs/fr/interest_of_intlayer.md +160 -46
  88. package/docs/fr/introduction.md +3 -3
  89. package/docs/fr/packages/intlayer/index.md +3 -3
  90. package/docs/fr/packages/next-intlayer/index.md +3 -3
  91. package/docs/fr/packages/react-intlayer/index.md +3 -3
  92. package/docs/hi/CI_CD.md +69 -44
  93. package/docs/hi/formatters.md +239 -0
  94. package/docs/hi/interest_of_intlayer.md +158 -42
  95. package/docs/hi/introduction.md +3 -3
  96. package/docs/hi/packages/intlayer/index.md +3 -3
  97. package/docs/hi/packages/next-intlayer/index.md +3 -3
  98. package/docs/hi/packages/react-intlayer/index.md +3 -3
  99. package/docs/it/CI_CD.md +67 -41
  100. package/docs/it/formatters.md +239 -0
  101. package/docs/it/interest_of_intlayer.md +160 -46
  102. package/docs/it/introduction.md +3 -3
  103. package/docs/it/packages/intlayer/index.md +3 -3
  104. package/docs/it/packages/next-intlayer/index.md +3 -3
  105. package/docs/it/packages/react-intlayer/index.md +3 -3
  106. package/docs/ja/CI_CD.md +67 -41
  107. package/docs/ja/formatters.md +261 -0
  108. package/docs/ja/interest_of_intlayer.md +157 -48
  109. package/docs/ja/introduction.md +3 -3
  110. package/docs/ja/packages/intlayer/index.md +3 -3
  111. package/docs/ja/packages/next-intlayer/index.md +3 -3
  112. package/docs/ja/packages/react-intlayer/index.md +3 -3
  113. package/docs/ko/CI_CD.md +63 -37
  114. package/docs/ko/formatters.md +258 -0
  115. package/docs/ko/interest_of_intlayer.md +160 -48
  116. package/docs/ko/introduction.md +3 -3
  117. package/docs/ko/packages/intlayer/index.md +3 -3
  118. package/docs/ko/packages/next-intlayer/index.md +3 -3
  119. package/docs/ko/packages/react-intlayer/index.md +3 -3
  120. package/docs/pt/CI_CD.md +67 -41
  121. package/docs/pt/formatters.md +239 -0
  122. package/docs/pt/interest_of_intlayer.md +162 -47
  123. package/docs/pt/introduction.md +3 -3
  124. package/docs/pt/packages/intlayer/index.md +3 -3
  125. package/docs/pt/packages/next-intlayer/index.md +3 -3
  126. package/docs/pt/packages/react-intlayer/index.md +3 -3
  127. package/docs/ru/CI_CD.md +70 -44
  128. package/docs/ru/formatters.md +239 -0
  129. package/docs/ru/interest_of_intlayer.md +168 -50
  130. package/docs/ru/introduction.md +3 -3
  131. package/docs/ru/packages/intlayer/index.md +3 -3
  132. package/docs/ru/packages/next-intlayer/index.md +3 -3
  133. package/docs/ru/packages/react-intlayer/index.md +3 -3
  134. package/docs/zh/CI_CD.md +62 -36
  135. package/docs/zh/formatters.md +239 -0
  136. package/docs/zh/interest_of_intlayer.md +158 -48
  137. package/docs/zh/introduction.md +3 -3
  138. package/docs/zh/packages/intlayer/index.md +3 -3
  139. package/docs/zh/packages/next-intlayer/index.md +3 -3
  140. package/docs/zh/packages/react-intlayer/index.md +3 -3
  141. package/package.json +12 -12
  142. package/src/generated/docs.entry.ts +41 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-08-14
3
- updatedAt: 2025-06-29
3
+ updatedAt: 2025-08-20
4
4
  title: Interest of Intlayer
5
5
  description: Discover the benefits and advantages of using Intlayer in your projects. Understand why Intlayer stands out among other frameworks.
6
6
  keywords:
@@ -11,41 +11,104 @@ keywords:
11
11
  - Comparison
12
12
  slugs:
13
13
  - doc
14
- - concept
15
- - interest
14
+ - why
16
15
  ---
17
16
 
18
- # Intlayer: A tailored way to translate your website
17
+ # Why you should consider Intlayer?
19
18
 
20
- **Intlayer** is an internationalization library designed specifically for JavaScript developers. It allow the declaration of your content everywhere in your code. It converts declaration of multilingual content into structured dictionaries to integrate easily in your code. Using TypeScript, **Intlayer** make your development stronger and more efficient.
19
+ ## What is Intlayer?
21
20
 
22
- ## Example of usage
21
+ **Intlayer** is an internationalization library designed specifically for JavaScript developers. It allows the declaration of your content everywhere in your code. It converts declarations of multilingual content into structured dictionaries to integrate easily in your code. Using TypeScript, **Intlayer** makes your development stronger and more efficient.
22
+
23
+ ## Why was Intlayer created?
24
+
25
+ Intlayer was created to solve a common problem that affects all common i18n libraries such as `next-intl`, `react-i18next`, `react-intl`, `next-i18next`, `react-intl`, and `vue-i18n`.
26
+
27
+ All these solutions adopt a centralized approach to list and manage your content. For example:
28
+
29
+ ```bash
30
+ .
31
+ ├── locales
32
+ │ ├── en.json
33
+ │ ├── es.json
34
+ │ └── fr.json
35
+ ├── i18n.ts
36
+ └── src
37
+ └── components
38
+ └── MyComponent
39
+ └── index.tsx
40
+ ```
41
+
42
+ Or here using namespaces:
43
+
44
+ ```bash
45
+ .
46
+ ├── locales
47
+ │ ├── en
48
+ │ │ ├── footer.json
49
+ │ │ └── navbar.json
50
+ │ ├── fr
51
+ │ │ ├── footer.json
52
+ │ │ └── navbar.json
53
+ │ └── es
54
+ │ ├── footer.json
55
+ │ └── navbar.json
56
+ ├── i18n.ts
57
+ └── src
58
+ └── components
59
+ └── MyComponent
60
+ └── index.tsx
61
+ ```
62
+
63
+ This type of architecture slows down the development process and makes the codebase more complex to maintain for several reasons:
64
+
65
+ 1. **For any new component created, you should:**
66
+ - Create the new resource/namespace in the `locales` folder
67
+ - Remember to import the new namespace in your page
68
+ - Translate your content (often done manually by copy/paste from AI providers)
69
+
70
+ 2. **For any change made on your components, you should:**
71
+ - Search for the related resource/namespace (far from the component)
72
+ - Translate your content
73
+ - Ensure your content is up to date for any locale
74
+ - Verify your namespace doesn't include unused keys/values
75
+ - Ensure the structure of your JSON files is the same for all locales
76
+
77
+ On professional projects using these solutions, localization platforms are often used to help manage the translation of your content. However, this can quickly become costly for large projects.
78
+
79
+ To solve this problem, Intlayer adopts an approach that scopes your content per-component and keeps your content close to your component, as we often do with CSS (`styled-components`), types, documentation (`storybook`), or unit tests (`jest`).
23
80
 
24
81
  ```bash codeFormat="typescript"
25
82
  .
26
- └── Components
83
+ └── components
27
84
  └── MyComponent
28
85
  ├── index.content.ts
86
+ ├── index.test.tsx
87
+ ├── index.stories.tsx
29
88
  └── index.tsx
30
89
  ```
31
90
 
32
91
  ```bash codeFormat="commonjs"
33
92
  .
34
- └── Components
93
+ └── components
35
94
  └── MyComponent
36
95
  ├── index.content.cjs
37
- └── index.mjs
96
+ ├── index.test.mjs
97
+ ├── index.stories.mjs
98
+ └── index.tsx
38
99
  ```
39
100
 
40
101
  ```bash codeFormat="esm"
41
102
  .
42
- └── Components
103
+ └── components
43
104
  └── MyComponent
44
105
  ├── index.content.mjs
45
- └── index.js
106
+ ├── index.test.mjs
107
+ ├── index.stories.mjs
108
+ └── index.tsx
46
109
  ```
47
110
 
48
- ```tsx fileName="./Components/MyComponent/index.content.ts" codeFormat="typescript"
111
+ ```tsx fileName="./components/MyComponent/index.content.ts" codeFormat="typescript"
49
112
  import { t, type Dictionary } from "intlayer";
50
113
 
51
114
  const componentExampleContent = {
@@ -53,8 +116,8 @@ const componentExampleContent = {
53
116
  content: {
54
117
  myTranslatedContent: t({
55
118
  en: "Hello World",
56
- fr: "Bonjour le monde",
57
119
  es: "Hola Mundo",
120
+ fr: "Bonjour le monde",
58
121
  }),
59
122
  },
60
123
  } satisfies Dictionary;
@@ -62,7 +125,7 @@ const componentExampleContent = {
62
125
  export default componentExampleContent;
63
126
  ```
64
127
 
65
- ```jsx fileName="./Components/MyComponent/index.mjx" codeFormat="esm"
128
+ ```jsx fileName="./components/MyComponent/index.mjx" codeFormat="esm"
66
129
  import { t } from "intlayer";
67
130
 
68
131
  /** @type {import('intlayer').Dictionary} */
@@ -71,8 +134,8 @@ const componentExampleContent = {
71
134
  content: {
72
135
  myTranslatedContent: t({
73
136
  en: "Hello World",
74
- fr: "Bonjour le monde",
75
137
  es: "Hola Mundo",
138
+ fr: "Bonjour le monde",
76
139
  }),
77
140
  },
78
141
  };
@@ -80,7 +143,7 @@ const componentExampleContent = {
80
143
  export default componentExampleContent;
81
144
  ```
82
145
 
83
- ```jsx fileName="./Components/MyComponent/index.csx" codeFormat="commonjs"
146
+ ```jsx fileName="./components/MyComponent/index.csx" codeFormat="commonjs"
84
147
  const { t } = require("intlayer");
85
148
 
86
149
  /** @type {import('intlayer').Dictionary} */
@@ -89,8 +152,8 @@ const componentExampleContent = {
89
152
  content: {
90
153
  myTranslatedContent: t({
91
154
  en: "Hello World",
92
- fr: "Bonjour le monde",
93
155
  es: "Hola Mundo",
156
+ fr: "Bonjour le monde",
94
157
  }),
95
158
  },
96
159
  };
@@ -98,7 +161,7 @@ const componentExampleContent = {
98
161
  module.exports = componentExampleContent;
99
162
  ```
100
163
 
101
- ```tsx fileName="./Components/MyComponent/index.tsx" codeFormat="typescript"
164
+ ```tsx fileName="./components/MyComponent/index.tsx" codeFormat="typescript"
102
165
  import { useIntlayer } from "react-intlayer";
103
166
 
104
167
  export const ComponentExample = () => {
@@ -108,7 +171,7 @@ export const ComponentExample = () => {
108
171
  };
109
172
  ```
110
173
 
111
- ```jsx fileName="./Components/MyComponent/index.mjx" codeFormat="esm"
174
+ ```jsx fileName="./components/MyComponent/index.mjx" codeFormat="esm"
112
175
  import { useIntlayer } from "react-intlayer";
113
176
 
114
177
  const ComponentExample = () => {
@@ -118,7 +181,7 @@ const ComponentExample = () => {
118
181
  };
119
182
  ```
120
183
 
121
- ```jsx fileName="./Components/MyComponent/index.csx" codeFormat="commonjs"
184
+ ```jsx fileName="./components/MyComponent/index.csx" codeFormat="commonjs"
122
185
  const { useIntlayer } = require("react-intlayer");
123
186
 
124
187
  const ComponentExample = () => {
@@ -128,29 +191,79 @@ const ComponentExample = () => {
128
191
  };
129
192
  ```
130
193
 
131
- ## Why Choose Intlayer?
132
-
133
- | Feature | Description |
134
- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
135
- | **JavaScript-Powered Content Management** | Harness the flexibility of JavaScript to define and manage your content efficiently. |
136
- | **Type-Safe Environment** | Leverage TypeScript to ensure all your content definitions are precise and error-free. |
137
- | **Integrated Content Files** | Keep your translations close to their respective components, enhancing maintainability and clarity. |
138
- | **Simplified Setup** | Get up and running quickly with minimal configuration, especially optimized for Next.js projects. |
139
- | **Server Component Support** | Perfectly suited for Next.js server components, ensuring smooth server-side rendering. |
140
- | **Enhanced Routing** | Full support for Next.js app routing, adapting seamlessly to complex application structures. |
141
- | **Organized Codebase** | Keep your codebase more organized: 1 component = 1 dictionary in the same folder. |
142
- | **CI Auto-translation** | Autofill your translations in your CI using your own OpenAI API key, eliminating the need for an L10n platform. |
143
- | **MCP Server Integration** | Provides an MCP (Model Context Protocol) server for IDE automation, enabling seamless content management and i18n workflows directly within your development environment. [Learn more](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md). |
144
- | **Markdown Support** | Import and interpret markdown files for multilingual content like privacy policies. |
145
- | **Free Visual Editor & CMS** | A free visual editor and CMS are available if you need to work with content writers for your translations, again removing the need for a localization platform and allowing content externalization from the codebase. |
146
- | **Simplified Content Retrieval** | No need to call your `t` function for each piece of content; retrieve all your content directly using a single hook. |
147
- | **Consistent Implementation** | The same implementation for both client and server components, no need to pass your `t` function across each server component. |
148
- | **Tree-shakable Content** | The content is tree-shakable, which lightens the final bundle. |
149
- | **Non-blocking Static Rendering** | Intlayer doesn't block Static Rendering as `next-intl` does. |
150
- | **Interoperability** | Allow interoperability with [react-i18next](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_react-i18next.md), [next-i18next](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_next-i18next.md), [next-intl](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_next-intl.md), and [react-intl](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_react-intl.md). |
151
-
152
- ## Doc History
153
-
154
- | Version | Date | Changes |
155
- | ------- | ---------- | ------------ |
156
- | 5.5.10 | 2025-06-29 | Init history |
194
+ This approach allows you to:
195
+
196
+ 1. **Increase the speed of development**
197
+ - `.content.{{ts|mjs|cjs|json}}` files can be created using a VSCode extension
198
+ - Autocompletion AI tools in your IDE (such as GitHub Copilot) can help you declare your content, reducing copy/paste
199
+
200
+ 2. **Reduce the complexity of your codebase**
201
+
202
+ 3. **Increase the maintainability of your codebase**
203
+
204
+ 4. **Duplicate your components and their related content more easily (Example: login/register components, etc.)**
205
+ - By limiting the risk of impacting other components' content
206
+ - By copy/pasting your content from one application to another without external dependencies
207
+
208
+ 5. **Avoid polluting your codebase with unused keys/values for unused components**
209
+ - If you don't use a component, you don't need to import its content
210
+ - If you delete a component, you'll more easily remember to remove its related content as it will be present in the same folder
211
+
212
+ 6. **Reduce reasoning cost for AI agents to declare your multilingual content**
213
+ - The AI agent won't have to scan your entire codebase to know where to implement your content
214
+ - Translations can easily be done by autocompletion AI tools in your IDE (such as GitHub Copilot)
215
+
216
+ 7. **Optimize loading performance**
217
+ - If a component is lazy-loaded, its related content will be loaded at the same time
218
+
219
+ ## Additional features of Intlayer
220
+
221
+ | Feature | Description |
222
+ | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
223
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/frameworks.png?raw=true) | **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. |
224
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.png?raw=true) | **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) |
225
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/per_locale_content_declaration_file.png?raw=true) | **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) |
226
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true) | **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) |
227
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/config_file.png?raw=true) | **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) |
228
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/content_retrieval.png?raw=true) | **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) |
229
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/server_component.png?raw=true) | **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) |
230
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/file_tree.png?raw=true) | **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) |
231
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/url_routing.png?raw=true) | **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) |
232
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/markdown.png?raw=true) | **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) |
233
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/visual_editor.png?raw=true) | **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) |
234
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/bundle.png?raw=true) | **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) |
235
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/static_rendering.png?raw=true) | **Static Rendering**<br><br>Doesn't block Static Rendering. <br><br> - [Next.js integration](https://intlayer.org/doc/environment/nextjs) |
236
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/AI_translation.png?raw=true) | **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) |
237
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/mcp.png?raw=true) | **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) |
238
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/vscode_extension.png?raw=true) | **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) |
239
+ | ![Feature](https://github.com/aymericzip/intlayer/blob/main/docs/assets/interoperability.png?raw=true) | **Interoperability**<br><br>Allows interoperability with react-i18next, next-i18next, next-intl, and react-intl. <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) |
240
+
241
+ ## Comparison of Intlayer with other solutions
242
+
243
+ | Feature | Intlayer | React-i18next / i18next | React-Intl (FormatJS) | LinguiJS | next-intl | next-i18next | vue-i18n |
244
+ | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------- |
245
+ | **Translations Near Components** | Yes, content collocated with each component | No | No | No | No | No | Yes - using `Single File Components` (SFCs) |
246
+ | **TypeScript Integration** | Advanced, auto-generated strict types | Basic; extra config for safety | Good, but less strict | Typings, needs config | Good | Basic | Good (types available; key-safety needs setup) |
247
+ | **Missing Translation Detection** | Build-time error/warning | Mostly fallback strings at runtime | Fallback strings | Needs extra config | Runtime fallback | Runtime fallback | Runtime fallback/warnings (configurable) |
248
+ | **Rich Content (JSX/Markdown/components)** | Direct support, even React nodes | Limited / interpolation only | ICU syntax, not real JSX | Limited | Not designed for rich nodes | Limited | Limited (components via `<i18n-t>`, Markdown via plugins) |
249
+ | **AI-powered Translation** | Yes, supports multiple AI providers. Usable using your own API keys. Considers the context of your application and content scope | No | No | No | No | No | No |
250
+ | **Visual Editor** | Yes, local Visual Editor + optional CMS; can externalize codebase content; embeddable | No / available via external localization platforms | No / available via external localization platforms | No / available via external localization platforms | No / available via external localization platforms | No / available via external localization platforms | No / available via external localization platforms |
251
+ | **Localized Routing** | Built-in, middleware support | Plugins or manual config | Not built-in | Plugin/manual config | Built-in | Built-in | Manual via Vue Router (Nuxt i18n handles it) |
252
+ | **Dynamic Route Generation** | Yes | Plugin/ecosystem or manual setup | Not provided | Plugin/manual | Yes | Yes | Not provided (Nuxt i18n provides) |
253
+ | **Pluralization** | Enumeration-based patterns; see docs | Configurable (plugins like i18next-icu) | Advanced (ICU) | Advanced (ICU/messageformat) | Good | Good | Advanced (built-in plural rules) |
254
+ | **Formatting (dates, numbers, currencies)** | Optimized formatters (Intl under the hood) | Via plugins or custom Intl usage | Advanced ICU formatters | ICU/CLI helpers | Good (Intl helpers) | Good (Intl helpers) | Built-in date/number formatters (Intl) |
255
+ | **Content Format** | .tsx, .ts, .js, .json, .md, .txt | .json | .json, .js | .po, .json | .json, .js, .ts | .json | .json, .js |
256
+ | **ICU support** | WIP (native ICU) | Via plugin (i18next-icu) | Yes | Yes | Yes | Via plugin (i18next-icu) | Via custom formatter/compiler |
257
+ | **SEO Helpers (hreflang, sitemap)** | Built-in tools: helpers for sitemap, **robots.txt**, metadata | Community plugins/manual | Not core | Not core | Good | Good | Not core (Nuxt i18n provides helpers) |
258
+ | **Ecosystem / Community** | Smaller but growing fast and reactive | Largest and most mature | Large, enterprise | Growing, smaller | Mid-size, Next.js-focused | Mid-size, Next.js-focused | Large in Vue ecosystem |
259
+ | **Server-side Rendering & Server Components** | Yes, streamlined for SSR / React Server Components | Supported, some config needed | Supported in Next.js | Supported | Full support | Full support | SSR via Nuxt/Vue SSR (no RSC) |
260
+ | **Tree-shaking (load only used content)** | Yes, per-component at build time via Babel/SWC plugins | Usually loads all (can be improved with namespaces/code-splitting) | Usually loads all | Not default | Partial | Partial | Partial (with code-splitting/manual setup) |
261
+ | **Lazy loading** | Yes, per-locale/per-component | Yes (e.g., backends/namespaces on demand) | Yes (split locale bundles) | Yes (dynamic catalog imports) | Yes (per-route/per-locale) | Yes (per-route/per-locale) | Yes (async locale messages) |
262
+ | **Management of Large Projects** | Encourages modular, suited for design-system | Needs good file discipline | Central catalogs can get large | May get complex | Modular with setup | Modular with setup | Modular with Vue Router/Nuxt i18n setup |
263
+
264
+ ## Document History
265
+
266
+ | Version | Date | Changes |
267
+ | ------- | ---------- | ------------------------ |
268
+ | 5.8.0 | 2025-08-19 | Update comparative table |
269
+ | 5.5.10 | 2025-06-29 | Init history |
@@ -44,8 +44,8 @@ const componentContent = {
44
44
  content: {
45
45
  myTranslatedContent: t({
46
46
  en: "Hello World",
47
- fr: "Bonjour le monde",
48
47
  es: "Hola Mundo",
48
+ fr: "Bonjour le monde",
49
49
  }),
50
50
  },
51
51
  } satisfies Dictionary;
@@ -62,8 +62,8 @@ const componentContent = {
62
62
  content: {
63
63
  myTranslatedContent: t({
64
64
  en: "Hello World",
65
- fr: "Bonjour le monde",
66
65
  es: "Hola Mundo",
66
+ fr: "Bonjour le monde",
67
67
  }),
68
68
  },
69
69
  };
@@ -80,8 +80,8 @@ const componentContent = {
80
80
  content: {
81
81
  myTranslatedContent: t({
82
82
  en: "Hello World",
83
- fr: "Bonjour le monde",
84
83
  es: "Hola Mundo",
84
+ fr: "Bonjour le monde",
85
85
  }),
86
86
  },
87
87
  };
@@ -148,8 +148,8 @@ const clientComponentContent = {
148
148
  content: {
149
149
  myTranslatedContent: t({
150
150
  en: "Hello World",
151
- fr: "Bonjour le monde",
152
151
  es: "Hola Mundo",
152
+ fr: "Bonjour le monde",
153
153
  }),
154
154
  numberOfCar: enu({
155
155
  "<-1": "Less than minus one car",
@@ -174,8 +174,8 @@ const clientComponentContent = {
174
174
  content: {
175
175
  myTranslatedContent: t({
176
176
  en: "Hello World",
177
- fr: "Bonjour le monde",
178
177
  es: "Hola Mundo",
178
+ fr: "Bonjour le monde",
179
179
  }),
180
180
  numberOfCar: enu({
181
181
  "<-1": "Less than minus one car",
@@ -200,8 +200,8 @@ const clientComponentContent = {
200
200
  content: {
201
201
  myTranslatedContent: t({
202
202
  en: "Hello World",
203
- fr: "Bonjour le monde",
204
203
  es: "Hola Mundo",
204
+ fr: "Bonjour le monde",
205
205
  }),
206
206
  numberOfCar: enu({
207
207
  "<-1": "Less than minus one car",
@@ -110,8 +110,8 @@ const clientComponentContent = {
110
110
  content: {
111
111
  myTranslatedContent: t({
112
112
  en: "Hello World",
113
- fr: "Bonjour le monde",
114
113
  es: "Hola Mundo",
114
+ fr: "Bonjour le monde",
115
115
  }),
116
116
  numberOfCar: enu({
117
117
  "<-1": "Less than minus one car",
@@ -136,8 +136,8 @@ const clientComponentContent = {
136
136
  content: {
137
137
  myTranslatedContent: t({
138
138
  en: "Hello World",
139
- fr: "Bonjour le monde",
140
139
  es: "Hola Mundo",
140
+ fr: "Bonjour le monde",
141
141
  }),
142
142
  numberOfCar: enu({
143
143
  "<-1": "Less than minus one car",
@@ -162,8 +162,8 @@ const clientComponentContent = {
162
162
  content: {
163
163
  myTranslatedContent: t({
164
164
  en: "Hello World",
165
- fr: "Bonjour le monde",
166
165
  es: "Hola Mundo",
166
+ fr: "Bonjour le monde",
167
167
  }),
168
168
  numberOfCar: enu({
169
169
  "<-1": "Less than minus one car",
@@ -110,8 +110,8 @@ const component1Content = {
110
110
  content: {
111
111
  myTranslatedContent: t({
112
112
  en: "Hello World",
113
- fr: "Bonjour le monde",
114
113
  es: "Hola Mundo",
114
+ fr: "Bonjour le monde",
115
115
  }),
116
116
  numberOfCar: enu({
117
117
  "<-1": "Less than minus one car",
@@ -136,8 +136,8 @@ const component1Content = {
136
136
  content: {
137
137
  myTranslatedContent: t({
138
138
  en: "Hello World",
139
- fr: "Bonjour le monde",
140
139
  es: "Hola Mundo",
140
+ fr: "Bonjour le monde",
141
141
  }),
142
142
  numberOfCar: enu({
143
143
  "<-1": "Less than minus one car",
@@ -162,8 +162,8 @@ const component1Content = {
162
162
  content: {
163
163
  myTranslatedContent: t({
164
164
  en: "Hello World",
165
- fr: "Bonjour le monde",
166
165
  es: "Hola Mundo",
166
+ fr: "Bonjour le monde",
167
167
  }),
168
168
  numberOfCar: enu({
169
169
  "<-1": "Less than minus one car",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-05-20
3
- updatedAt: 2025-06-29
3
+ updatedAt: 2025-08-13
4
4
  title: CI/CD Integration
5
5
  description: Learn how to integrate Intlayer into your CI/CD pipeline for automated content management and deployment.
6
6
  keywords:
@@ -8,7 +8,7 @@ keywords:
8
8
  - Continuous Integration
9
9
  - Continuous Deployment
10
10
  - Automation
11
- - Internationalization
11
+ - Internationalisation
12
12
  - Documentation
13
13
  - Intlayer
14
14
  slugs:
@@ -64,7 +64,7 @@ You can integrate translation generation into your local Git workflow using [Hus
64
64
  import { Locales, type IntlayerConfig } from "intlayer";
65
65
 
66
66
  const config: IntlayerConfig = {
67
- internationalization: {
67
+ internationalisation: {
68
68
  locales: [Locales.ENGLISH, Locales.SPANISH, Locales.FRENCH],
69
69
  requiredLocales: [Locales.ENGLISH], // Optional locales are handled remotely
70
70
  defaultLocale: Locales.ENGLISH,
@@ -109,64 +109,90 @@ Intlayer provides a CLI command to autofill and review dictionary content. This
109
109
 
110
110
  ```yaml fileName=".github/workflows/intlayer-translate.yml"
111
111
  name: Intlayer Auto-Fill
112
+ # Trigger conditions for this workflow
112
113
  on:
113
- push:
114
- branches: [ main ]
115
- paths:
116
- - 'src/**'
117
114
  pull_request:
118
- branches: [ main ]
119
- paths:
120
- - 'src/**'
121
- workflow_dispatch: {}
115
+ branches:
116
+ - "main"
117
+
118
+ permissions:
119
+ contents: write
120
+ pull-requests: write
122
121
 
123
122
  concurrency:
124
- group: 'autofill-${{ github.ref }}'
123
+ group: "autofill-${{ github.ref }}"
125
124
  cancel-in-progress: true
126
125
 
127
126
  jobs:
128
127
  autofill:
129
128
  runs-on: ubuntu-latest
130
129
  env:
131
- INTLAYER_CLIENT_ID: ${{ secrets.INTLAYER_CLIENT_ID }}
132
- INTLAYER_CLIENT_SECRET: ${{ secrets.INTLAYER_CLIENT_SECRET }}
133
- OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
130
+ # OpenAI
131
+ AI_MODEL: openai
132
+ AI_PROVIDER: gpt-5-mini
133
+ AI_API_KEY: ${{ secrets.AI_API_KEY }}
134
134
 
135
135
  steps:
136
+ # Step 1: Get the latest code from the repository
136
137
  - name: ⬇️ Checkout repository
137
- uses: actions/checkout@v3
138
+ uses: actions/checkout@v4
138
139
  with:
139
- persist-credentials: true
140
+ persist-credentials: true # Keep credentials for creating PRs
141
+ fetch-depth: 0 # Get full git history for diff analysis
140
142
 
143
+ # Step 2: Set up Node.js environment
141
144
  - name: 🟢 Set up Node.js
142
- uses: actions/setup-node@v3
145
+ uses: actions/setup-node@v4
143
146
  with:
144
- node-version: 20
147
+ node-version: 20 # Use Node.js 20 LTS for stability
145
148
 
149
+ # Step 3: Install project dependencies
146
150
  - name: 📦 Install dependencies
147
- run: npm ci
151
+ run: npm install
152
+
153
+ # Step 4: Install Intlayer CLI globally for translation management
154
+ - name: 📦 Install Intlayer
155
+ run: npm install -g intlayer-cli
148
156
 
157
+ # Step 5: Build the Intlayer project to generate translation files
149
158
  - name: ⚙️ Build Intlayer project
150
159
  run: npx intlayer build
151
160
 
161
+ # Step 6: Use AI to automatically fill missing translations
152
162
  - name: 🤖 Auto-fill missing translations
153
- run: npx intlayer fill --git-diff --mode fill
154
-
155
- - name: 📤 Create or update translation PR
156
- uses: peter-evans/create-pull-request@v4
157
- with:
158
- commit-message: chore: auto-fill missing translations [skip ci]
159
- branch: auto-translations
160
- title: chore: update missing translations
161
- labels: translation, automated
163
+ run: npx intlayer fill --git-diff --mode fill --provider $AI_PROVIDER --model $AI_MODEL --api-key $AI_API_KEY
164
+
165
+ # Step 7: Check if there are changes and commit them
166
+ - name: � Check for changes
167
+ id: check-changes
168
+ run: |
169
+ if [ -n "$(git status --porcelain)" ]; then
170
+ echo "has-changes=true" >> $GITHUB_OUTPUT
171
+ else
172
+ echo "has-changes=false" >> $GITHUB_OUTPUT
173
+ fi
174
+
175
+ # Step 8: Commit and push changes if any exist
176
+ - name: 📤 Commit and push changes
177
+ if: steps.check-changes.outputs.has-changes == 'true'
178
+ run: |
179
+ git config --local user.email "action@github.com"
180
+ git config --local user.name "GitHub Action"
181
+ git add .
182
+ git commit -m "chore: auto-fill missing translations [skip ci]"
183
+ git push origin HEAD:${{ github.head_ref }}
162
184
  ```
163
185
 
164
- > Same as for Husky, in the case of a monorepo, you can use the `--base-dir` argument to sequentially treat each app.
186
+ To set up the environment variables, go to GitHub Settings Secrets and variables Actions and add the secret .
187
+
188
+ > Same as for Husky, in the case of a monorepo, you can use the `--base-dir` argument to sequentially process each app.
165
189
 
166
- > By default, the `--git-diff` argument filters dictionaries that include changes from base (default `origin/main`) to current branch (default: `HEAD`).
190
+ > By default, the `--git-diff` argument filters dictionaries that include changes from the base (default `origin/main`) to the current branch (default: `HEAD`).
167
191
 
168
192
  > For more information about Intlayer CLI commands and their usage, refer to the [CLI documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/intlayer_cli.md).
169
193
 
170
194
  ## Doc History
171
195
 
172
- - 5.5.10 - 2025-06-29: Init history
196
+ | Version | Date | Changes |
197
+ | ------- | ---------- | --------------- |
198
+ | 5.5.10 | 2025-06-29 | Initial history |