@intlayer/docs 5.7.8 → 5.8.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.
- package/blog/ar/intlayer_with_next-i18next.md +5 -6
- package/blog/ar/intlayer_with_next-intl.md +3 -4
- package/blog/ar/intlayer_with_react-i18next.md +1 -1
- package/blog/ar/intlayer_with_react-intl.md +1 -1
- package/blog/ar/next-i18next_vs_next-intl_vs_intlayer.md +96 -219
- package/blog/ar/react-i18next_vs_react-intl_vs_intlayer.md +88 -129
- package/blog/ar/vue-i18n_vs_intlayer.md +268 -0
- package/blog/de/intlayer_with_next-i18next.md +5 -6
- package/blog/de/intlayer_with_react-intl.md +1 -1
- package/blog/de/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
- package/blog/de/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
- package/blog/de/vue-i18n_vs_intlayer.md +268 -0
- package/blog/en/intlayer_with_next-i18next.md +5 -6
- package/blog/en/intlayer_with_next-intl.md +3 -4
- package/blog/en/intlayer_with_react-i18next.md +1 -1
- package/blog/en/intlayer_with_react-intl.md +1 -1
- package/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +89 -220
- package/blog/en/react-i18next_vs_react-intl_vs_intlayer.md +85 -123
- package/blog/en/vue-i18n_vs_intlayer.md +268 -0
- package/blog/en-GB/intlayer_with_next-i18next.md +5 -6
- package/blog/en-GB/intlayer_with_next-intl.md +3 -4
- package/blog/en-GB/intlayer_with_react-i18next.md +1 -1
- package/blog/en-GB/intlayer_with_react-intl.md +1 -1
- package/blog/en-GB/next-i18next_vs_next-intl_vs_intlayer.md +85 -218
- package/blog/en-GB/react-i18next_vs_react-intl_vs_intlayer.md +80 -130
- package/blog/en-GB/vue-i18n_vs_intlayer.md +258 -0
- package/blog/es/intlayer_with_next-i18next.md +5 -6
- package/blog/es/intlayer_with_next-intl.md +3 -4
- package/blog/es/intlayer_with_react-i18next.md +1 -1
- package/blog/es/intlayer_with_react-intl.md +1 -1
- package/blog/es/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
- package/blog/es/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
- package/blog/es/vue-i18n_vs_intlayer.md +268 -0
- package/blog/fr/intlayer_with_next-i18next.md +5 -6
- package/blog/fr/intlayer_with_next-intl.md +3 -4
- package/blog/fr/intlayer_with_react-i18next.md +1 -1
- package/blog/fr/intlayer_with_react-intl.md +1 -1
- package/blog/fr/next-i18next_vs_next-intl_vs_intlayer.md +91 -214
- package/blog/fr/react-i18next_vs_react-intl_vs_intlayer.md +86 -127
- package/blog/fr/vue-i18n_vs_intlayer.md +269 -0
- package/blog/hi/intlayer_with_next-i18next.md +5 -6
- package/blog/hi/intlayer_with_next-intl.md +3 -4
- package/blog/hi/intlayer_with_react-i18next.md +1 -1
- package/blog/hi/intlayer_with_react-intl.md +1 -1
- package/blog/hi/next-i18next_vs_next-intl_vs_intlayer.md +97 -220
- package/blog/hi/react-i18next_vs_react-intl_vs_intlayer.md +89 -130
- package/blog/hi/vue-i18n_vs_intlayer.md +268 -0
- package/blog/it/intlayer_with_next-i18next.md +5 -6
- package/blog/it/intlayer_with_next-intl.md +3 -4
- package/blog/it/intlayer_with_react-i18next.md +1 -1
- package/blog/it/intlayer_with_react-intl.md +1 -1
- package/blog/it/next-i18next_vs_next-intl_vs_intlayer.md +91 -214
- package/blog/it/react-i18next_vs_react-intl_vs_intlayer.md +86 -127
- package/blog/it/vue-i18n_vs_intlayer.md +268 -0
- package/blog/ja/intlayer_with_next-i18next.md +5 -6
- package/blog/ja/intlayer_with_next-intl.md +3 -4
- package/blog/ja/intlayer_with_react-intl.md +1 -1
- package/blog/ja/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
- package/blog/ja/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
- package/blog/ja/vue-i18n_vs_intlayer.md +268 -0
- package/blog/ko/intlayer_with_next-i18next.md +5 -6
- package/blog/ko/intlayer_with_next-intl.md +3 -4
- package/blog/ko/intlayer_with_react-intl.md +1 -1
- package/blog/ko/next-i18next_vs_next-intl_vs_intlayer.md +95 -217
- package/blog/ko/react-i18next_vs_react-intl_vs_intlayer.md +89 -130
- package/blog/ko/vue-i18n_vs_intlayer.md +268 -0
- package/blog/pt/intlayer_with_next-i18next.md +5 -6
- package/blog/pt/intlayer_with_next-intl.md +3 -4
- package/blog/pt/intlayer_with_react-intl.md +1 -1
- package/blog/pt/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
- package/blog/pt/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
- package/blog/pt/vue-i18n_vs_intlayer.md +268 -0
- package/blog/ru/intlayer_with_next-i18next.md +5 -6
- package/blog/ru/intlayer_with_next-intl.md +3 -4
- package/blog/ru/intlayer_with_react-i18next.md +1 -1
- package/blog/ru/intlayer_with_react-intl.md +1 -1
- package/blog/ru/next-i18next_vs_next-intl_vs_intlayer.md +94 -217
- package/blog/ru/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
- package/blog/ru/vue-i18n_vs_intlayer.md +268 -0
- package/blog/zh/intlayer_with_next-i18next.md +5 -6
- package/blog/zh/intlayer_with_next-intl.md +3 -4
- package/blog/zh/intlayer_with_react-i18next.md +1 -1
- package/blog/zh/intlayer_with_react-intl.md +1 -1
- package/blog/zh/next-i18next_vs_next-intl_vs_intlayer.md +93 -216
- package/blog/zh/react-i18next_vs_react-intl_vs_intlayer.md +87 -128
- package/blog/zh/vue-i18n_vs_intlayer.md +269 -0
- package/dist/cjs/generated/blog.entry.cjs +41 -0
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +41 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +41 -0
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +41 -0
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/types/generated/blog.entry.d.ts +1 -0
- package/dist/types/generated/blog.entry.d.ts.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +1 -0
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/docs/ar/formatters.md +625 -0
- package/docs/ar/how_works_intlayer.md +2 -4
- package/docs/ar/interest_of_intlayer.md +159 -49
- package/docs/ar/intlayer_CMS.md +2 -3
- package/docs/ar/intlayer_visual_editor.md +2 -3
- package/docs/ar/intlayer_with_tanstack.md +1 -1
- package/docs/ar/introduction.md +7 -7
- package/docs/ar/packages/intlayer/index.md +3 -3
- package/docs/ar/packages/next-intlayer/index.md +3 -3
- package/docs/de/formatters.md +649 -0
- package/docs/de/interest_of_intlayer.md +161 -47
- package/docs/de/introduction.md +5 -5
- package/docs/de/packages/intlayer/index.md +3 -3
- package/docs/de/packages/next-intlayer/index.md +3 -3
- package/docs/de/packages/react-intlayer/index.md +3 -3
- package/docs/en/dictionary/enumeration.md +2 -2
- package/docs/en/dictionary/function_fetching.md +2 -2
- package/docs/en/dictionary/get_started.md +2 -2
- package/docs/en/dictionary/translation.md +2 -2
- package/docs/en/formatters.md +618 -0
- package/docs/en/how_works_intlayer.md +2 -4
- package/docs/en/interest_of_intlayer.md +170 -46
- package/docs/en/intlayer_CMS.md +2 -3
- package/docs/en/intlayer_visual_editor.md +2 -3
- package/docs/en/intlayer_with_create_react_app.md +2 -2
- package/docs/en/intlayer_with_express.md +2 -2
- package/docs/en/intlayer_with_tanstack.md +1 -1
- package/docs/en/introduction.md +7 -7
- package/docs/en/packages/express-intlayer/index.md +2 -2
- package/docs/en/packages/intlayer/getConfiguration.md +2 -3
- package/docs/en/packages/intlayer/getEnumeration.md +2 -7
- package/docs/en/packages/intlayer/getHTMLTextDir.md +2 -4
- package/docs/en/packages/intlayer/getLocaleLang.md +2 -4
- package/docs/en/packages/intlayer/getLocaleName.md +2 -3
- package/docs/en/packages/intlayer/getLocalizedUrl.md +2 -8
- package/docs/en/packages/intlayer/getMultilingualUrls.md +2 -7
- package/docs/en/packages/intlayer/getPathWithoutLocale.md +2 -3
- package/docs/en/packages/intlayer/getTranslation.md +2 -4
- package/docs/en/packages/intlayer/index.md +5 -5
- package/docs/en/packages/next-intlayer/index.md +5 -5
- package/docs/en/packages/next-intlayer/t.md +2 -2
- package/docs/en/packages/next-intlayer/useDictionary.md +2 -2
- package/docs/en/packages/next-intlayer/useIntlayer.md +2 -2
- package/docs/en/packages/next-intlayer/useLocale.md +2 -2
- package/docs/en/packages/react-intlayer/index.md +5 -5
- package/docs/en/packages/react-intlayer/t.md +2 -2
- package/docs/en/packages/react-intlayer/useI18n.md +2 -2
- package/docs/en/packages/react-intlayer/useIntlayer.md +2 -2
- package/docs/en/packages/react-intlayer/useLocale.md +2 -2
- package/docs/en/packages/react-scripts-intlayer/index.md +2 -2
- package/docs/en/packages/solid-intlayer/index.md +2 -2
- package/docs/en/packages/vite-intlayer/index.md +2 -2
- package/docs/en-GB/formatters.md +625 -0
- package/docs/en-GB/how_works_intlayer.md +2 -4
- package/docs/en-GB/interest_of_intlayer.md +157 -53
- package/docs/en-GB/intlayer_with_tanstack.md +1 -1
- package/docs/en-GB/introduction.md +2 -2
- package/docs/en-GB/packages/intlayer/index.md +3 -3
- package/docs/en-GB/packages/next-intlayer/index.md +3 -3
- package/docs/en-GB/packages/react-intlayer/index.md +3 -3
- package/docs/es/formatters.md +649 -0
- package/docs/es/how_works_intlayer.md +2 -4
- package/docs/es/interest_of_intlayer.md +156 -47
- package/docs/es/intlayer_with_tanstack.md +1 -1
- package/docs/es/introduction.md +5 -5
- package/docs/es/packages/intlayer/index.md +3 -3
- package/docs/es/packages/next-intlayer/index.md +3 -3
- package/docs/fr/formatters.md +649 -0
- package/docs/fr/how_works_intlayer.md +2 -4
- package/docs/fr/interest_of_intlayer.md +157 -46
- package/docs/fr/intlayer_with_tanstack.md +1 -1
- package/docs/fr/introduction.md +5 -5
- package/docs/fr/packages/intlayer/index.md +3 -3
- package/docs/fr/packages/next-intlayer/index.md +3 -3
- package/docs/fr/packages/react-intlayer/index.md +3 -3
- package/docs/hi/formatters.md +630 -0
- package/docs/hi/how_works_intlayer.md +2 -4
- package/docs/hi/interest_of_intlayer.md +155 -42
- package/docs/hi/intlayer_with_tanstack.md +1 -1
- package/docs/hi/introduction.md +5 -5
- package/docs/hi/packages/intlayer/index.md +3 -3
- package/docs/hi/packages/next-intlayer/index.md +3 -3
- package/docs/hi/packages/react-intlayer/index.md +3 -3
- package/docs/it/formatters.md +647 -0
- package/docs/it/how_works_intlayer.md +2 -4
- package/docs/it/interest_of_intlayer.md +157 -46
- package/docs/it/intlayer_with_tanstack.md +1 -1
- package/docs/it/introduction.md +5 -5
- package/docs/it/packages/intlayer/index.md +3 -3
- package/docs/it/packages/next-intlayer/index.md +3 -3
- package/docs/it/packages/react-intlayer/index.md +3 -3
- package/docs/ja/formatters.md +649 -0
- package/docs/ja/how_works_intlayer.md +2 -4
- package/docs/ja/interest_of_intlayer.md +154 -48
- package/docs/ja/intlayer_with_tanstack.md +1 -1
- package/docs/ja/introduction.md +5 -5
- package/docs/ja/packages/intlayer/index.md +3 -3
- package/docs/ja/packages/next-intlayer/index.md +3 -3
- package/docs/ja/packages/react-intlayer/index.md +3 -3
- package/docs/ko/formatters.md +649 -0
- package/docs/ko/how_works_intlayer.md +2 -4
- package/docs/ko/interest_of_intlayer.md +157 -48
- package/docs/ko/intlayer_with_tanstack.md +1 -1
- package/docs/ko/introduction.md +5 -5
- package/docs/ko/packages/intlayer/index.md +3 -3
- package/docs/ko/packages/next-intlayer/index.md +3 -3
- package/docs/ko/packages/react-intlayer/index.md +3 -3
- package/docs/pt/formatters.md +625 -0
- package/docs/pt/how_works_intlayer.md +2 -4
- package/docs/pt/interest_of_intlayer.md +162 -47
- package/docs/pt/intlayer_with_tanstack.md +1 -1
- package/docs/pt/introduction.md +5 -5
- package/docs/pt/packages/intlayer/index.md +3 -3
- package/docs/pt/packages/next-intlayer/index.md +3 -3
- package/docs/pt/packages/react-intlayer/index.md +3 -3
- package/docs/ru/autoFill.md +2 -2
- package/docs/ru/configuration.md +1 -40
- package/docs/ru/formatters.md +649 -0
- package/docs/ru/how_works_intlayer.md +5 -7
- package/docs/ru/index.md +1 -1
- package/docs/ru/interest_of_intlayer.md +165 -50
- package/docs/ru/intlayer_CMS.md +7 -8
- package/docs/ru/intlayer_cli.md +4 -7
- package/docs/ru/intlayer_visual_editor.md +5 -6
- package/docs/ru/intlayer_with_angular.md +1 -1
- package/docs/ru/intlayer_with_create_react_app.md +5 -5
- package/docs/ru/intlayer_with_lynx+react.md +1 -1
- package/docs/ru/intlayer_with_nextjs_15.md +3 -3
- package/docs/ru/intlayer_with_nextjs_page_router.md +2 -2
- package/docs/ru/intlayer_with_nuxt.md +1 -1
- package/docs/ru/intlayer_with_react_native+expo.md +2 -2
- package/docs/ru/intlayer_with_tanstack.md +3 -3
- package/docs/ru/intlayer_with_vite+preact.md +3 -3
- package/docs/ru/intlayer_with_vite+react.md +3 -3
- package/docs/ru/intlayer_with_vite+solid.md +1 -1
- package/docs/ru/intlayer_with_vite+svelte.md +1 -1
- package/docs/ru/intlayer_with_vite+vue.md +2 -2
- package/docs/ru/introduction.md +8 -8
- package/docs/ru/locale_mapper.md +1 -1
- package/docs/ru/packages/@intlayer/api/index.md +2 -2
- package/docs/ru/packages/@intlayer/chokidar/index.md +1 -1
- package/docs/ru/packages/@intlayer/cli/index.md +2 -2
- package/docs/ru/packages/@intlayer/config/index.md +2 -2
- package/docs/ru/packages/@intlayer/core/index.md +2 -2
- package/docs/ru/packages/@intlayer/design-system/index.md +2 -2
- package/docs/ru/packages/@intlayer/dictionary-entry/index.md +2 -2
- package/docs/ru/packages/@intlayer/editor/index.md +1 -1
- package/docs/ru/packages/@intlayer/editor-react/index.md +1 -1
- package/docs/ru/packages/@intlayer/webpack/index.md +1 -1
- package/docs/ru/packages/angular-intlayer/index.md +1 -1
- package/docs/ru/packages/express-intlayer/index.md +3 -3
- package/docs/ru/packages/express-intlayer/t.md +1 -1
- package/docs/ru/packages/intlayer/getEnumeration.md +3 -8
- package/docs/ru/packages/intlayer/getTranslation.md +3 -5
- package/docs/ru/packages/intlayer/getTranslationContent.md +1 -3
- package/docs/ru/packages/intlayer/index.md +6 -6
- package/docs/ru/packages/intlayer-cli/index.md +1 -1
- package/docs/ru/packages/intlayer-editor/index.md +2 -2
- package/docs/ru/packages/lynx-intlayer/index.md +1 -1
- package/docs/ru/packages/next-intlayer/index.md +7 -7
- package/docs/ru/packages/next-intlayer/t.md +4 -4
- package/docs/ru/packages/next-intlayer/useLocale.md +3 -3
- package/docs/ru/packages/nuxt-intlayer/index.md +1 -1
- package/docs/ru/packages/preact-intlayer/index.md +1 -1
- package/docs/ru/packages/react-intlayer/index.md +7 -7
- package/docs/ru/packages/react-intlayer/t.md +4 -4
- package/docs/ru/packages/react-native-intlayer/index.md +1 -1
- package/docs/ru/packages/react-scripts-intlayer/index.md +3 -3
- package/docs/ru/packages/solid-intlayer/index.md +3 -3
- package/docs/ru/packages/svelte-intlayer/index.md +1 -1
- package/docs/ru/packages/vite-intlayer/index.md +3 -3
- package/docs/ru/packages/vue-intlayer/index.md +1 -1
- package/docs/ru/per_locale_file.md +1 -1
- package/docs/ru/roadmap.md +3 -5
- package/docs/ru/vs_code_extension.md +1 -1
- package/docs/zh/formatters.md +647 -0
- package/docs/zh/how_works_intlayer.md +2 -4
- package/docs/zh/interest_of_intlayer.md +155 -48
- package/docs/zh/intlayer_with_tanstack.md +1 -1
- package/docs/zh/introduction.md +5 -5
- package/docs/zh/packages/intlayer/index.md +3 -3
- package/docs/zh/packages/next-intlayer/index.md +3 -3
- package/docs/zh/packages/react-intlayer/index.md +3 -3
- package/frequent_questions/ar/domain_routing.md +1 -1
- package/frequent_questions/en/domain_routing.md +1 -1
- package/frequent_questions/en-GB/domain_routing.md +1 -1
- package/frequent_questions/es/domain_routing.md +1 -1
- package/frequent_questions/fr/domain_routing.md +1 -1
- package/frequent_questions/hi/domain_routing.md +1 -1
- package/frequent_questions/it/domain_routing.md +1 -1
- package/frequent_questions/ko/domain_routing.md +1 -1
- package/frequent_questions/pt/domain_routing.md +1 -1
- package/frequent_questions/ru/domain_routing.md +1 -1
- package/frequent_questions/ru/get_locale_cookie.md +4 -4
- package/frequent_questions/ru/static_rendering.md +1 -2
- package/frequent_questions/zh/domain_routing.md +1 -1
- package/package.json +11 -11
- package/src/generated/blog.entry.ts +41 -0
- package/src/generated/docs.entry.ts +41 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-08-14
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-08-23
|
|
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
|
-
-
|
|
15
|
-
- interest
|
|
14
|
+
- why
|
|
16
15
|
---
|
|
17
16
|
|
|
18
|
-
#
|
|
17
|
+
# Why you should consider Intlayer?
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
## What is Intlayer?
|
|
21
20
|
|
|
22
|
-
|
|
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
|
-
└──
|
|
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
|
-
└──
|
|
93
|
+
└── components
|
|
35
94
|
└── MyComponent
|
|
36
95
|
├── index.content.cjs
|
|
37
|
-
|
|
96
|
+
├── index.test.mjs
|
|
97
|
+
├── index.stories.mjs
|
|
98
|
+
└── index.tsx
|
|
38
99
|
```
|
|
39
100
|
|
|
40
101
|
```bash codeFormat="esm"
|
|
41
102
|
.
|
|
42
|
-
└──
|
|
103
|
+
└── components
|
|
43
104
|
└── MyComponent
|
|
44
105
|
├── index.content.mjs
|
|
45
|
-
|
|
106
|
+
├── index.test.mjs
|
|
107
|
+
├── index.stories.mjs
|
|
108
|
+
└── index.tsx
|
|
46
109
|
```
|
|
47
110
|
|
|
48
|
-
```tsx fileName="./
|
|
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="./
|
|
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="./
|
|
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="./
|
|
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="./
|
|
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="./
|
|
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,90 @@ const ComponentExample = () => {
|
|
|
128
191
|
};
|
|
129
192
|
```
|
|
130
193
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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. **Clean your codebase**
|
|
201
|
+
- Reduce the complexity
|
|
202
|
+
- Increase the maintainability
|
|
203
|
+
|
|
204
|
+
3. **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
|
+
4. **Avoid polluting your codebase with unused keys/values for unused components**
|
|
209
|
+
- If you don't use a component, Intlayer will not import its related 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
|
+
5. **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
|
+
6. **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
|
+
|  | **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
|
+
|  | **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
|
+
|  | **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
|
+
|  | **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
|
+
|  | **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
|
+
|  | **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
|
+
|  | **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
|
+
|  | **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
|
+
|  | **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
|
+
|  | **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
|
+
|  | **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
|
+
|  | **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
|
+
|  | **Static Rendering**<br><br>Doesn't block Static Rendering. <br><br> - [Next.js integration](https://intlayer.org/doc/environment/nextjs) |
|
|
236
|
+
|  | **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
|
+
|  | **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
|
+
|  | **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
|
+
|  | **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` | `react-intl` (FormatJS) | `lingui` | `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** | ✅ TypeScript error hightlight and 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 | ⚠️ 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** | ✅ Yes, supports localized paths out of the box (works with Next.js & Vite) | ⚠️ No built-in, requires plugins (e.g. `next-i18next`) or custom router config | ❌ No, only message formatting, routing must be manual | ⚠️ No built-in, requires plugins or manual config | ✅ Built-in, App Router supports `[locale]` segment | ✅ Built-in | ✅ Built-in |
|
|
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 | ✅ Configurable (plugins like i18next-icu) | ✅ (ICU) | ✅ (ICU/messageformat) | ✅ Good | ✅ Good | ✅ Built-in plural rules |
|
|
254
|
+
| **Formatting (dates, numbers, currencies)** | ✅ Optimized formatters (Intl under the hood) | ⚠️ Via plugins or custom Intl usage | ✅ 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, (.yaml WIP) | ⚠️ .json | ✅ .json, .js | ⚠️ .po, .json | ✅ .json, .js, .ts | ⚠️ .json | ✅ .json, .js |
|
|
256
|
+
| **ICU support** | ⚠️ WIP | ⚠️ 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 mature | ✅ Large | ⚠️ 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 at page level but need to pass t-functions on component tree for children server components | ⚠️ Supported at page level with additional set up, but need to pass t-functions on component tree for children server components | ✅ Supported, set up needed | ⚠️ Supported at page level but need to pass t-functions on component tree for children server components | ⚠️ Supported at page level but need to pass t-functions on component tree for children server components | ✅ 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-dictionary | ✅ Yes (e.g., backends/namespaces on demand) | ✅ Yes (split locale bundles) | ✅ Yes (dynamic catalog imports) | ✅ Yes (per-route/per-locale), need mamespace management | ✅ Yes (per-route/per-locale), need mamespace management | ✅ Yes (async locale messages) |
|
|
262
|
+
| **Purge unused content** | ✅ Yes, per-dictionary at build time | ❌ No, only via manual namespace segmentation | ❌ No, all declared messages are bundled | ✅ Yes, unused keys detected & dropped at build | ❌ No, can be managed manually with namespace management | ❌ No, can be managed manually with namespace management | ❌ No, only possible via manual lazy-loading |
|
|
263
|
+
| **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 |
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Interoperability
|
|
268
|
+
|
|
269
|
+
`intlayer` can also help to manage your `react-intl`, `react-i18next`, `next-intl`, `next-i18next`, and `vue-i18n` namespaces.
|
|
270
|
+
|
|
271
|
+
Using `intlayer`, you can declare your content in the format of your favorite i18n library, and intlayer will generate your namespaces in the location of your choice (example: `/messages/{{locale}}/{{namespace}}.json`).
|
|
272
|
+
|
|
273
|
+
Refer to [`dictionaryOutput` and `i18nextResourcesDir` options](https://intlayer.org/doc/concept/configuration#content-configuration) for more details.
|
|
274
|
+
|
|
275
|
+
## Document History
|
|
276
|
+
|
|
277
|
+
| Version | Date | Changes |
|
|
278
|
+
| ------- | ---------- | ------------------------ |
|
|
279
|
+
| 5.8.0 | 2025-08-19 | Update comparative table |
|
|
280
|
+
| 5.5.10 | 2025-06-29 | Init history |
|
package/docs/en/intlayer_CMS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt:
|
|
3
|
-
updatedAt: 2025-
|
|
2
|
+
createdAt: 2025-08-23
|
|
3
|
+
updatedAt: 2025-08-23
|
|
4
4
|
title: Intlayer CMS | Externalize your content into the Intlayer CMS
|
|
5
5
|
description: Externalize your content into the Intlayer CMS to delegate the management of your content to your team.
|
|
6
6
|
keywords:
|
|
@@ -345,7 +345,6 @@ If you encounter any issues with the CMS, check the following:
|
|
|
345
345
|
- The application is running.
|
|
346
346
|
|
|
347
347
|
- The [`editor`](https://intlayer.org/doc/concept/configuration#editor-configuration) configuration are correctly set in your Intlayer configuration file.
|
|
348
|
-
|
|
349
348
|
- Required fields:
|
|
350
349
|
- The application URL should match the one you set in the editor configuration (`applicationURL`).
|
|
351
350
|
- The CMS URL
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt:
|
|
3
|
-
updatedAt: 2025-
|
|
2
|
+
createdAt: 2025-08-23
|
|
3
|
+
updatedAt: 2025-08-23
|
|
4
4
|
title: Intlayer Visual Editor | Edit your content using a visual editor
|
|
5
5
|
description: Discover how to use the Intlayer Editor to manage your multilingual website. Follow the steps in this online documentation to set up your project in a few minutes.
|
|
6
6
|
keywords:
|
|
@@ -257,7 +257,6 @@ If you encounter any issues with the visual editor, check the following:
|
|
|
257
257
|
- The visual editor and the application are running.
|
|
258
258
|
|
|
259
259
|
- The [`editor`](https://intlayer.org/doc/concept/configuration#editor-configuration) configuration are correctly set in your Intlayer configuration file.
|
|
260
|
-
|
|
261
260
|
- Required fields:
|
|
262
261
|
- The application URL should match the one you set in the editor configuration (`applicationURL`).
|
|
263
262
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt:
|
|
3
|
-
updatedAt: 2025-
|
|
2
|
+
createdAt: 2025-08-23
|
|
3
|
+
updatedAt: 2025-08-23
|
|
4
4
|
title: Translate your Create React App (CRA) website (i18n)
|
|
5
5
|
description: Discover how to make your Create React App (CRA) website multilingual. Follow the documentation to internationalize (i18n) and translate it.
|
|
6
6
|
keywords:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt:
|
|
3
|
-
updatedAt: 2025-
|
|
2
|
+
createdAt: 2025-08-23
|
|
3
|
+
updatedAt: 2025-08-23
|
|
4
4
|
title: Translate your Express backend (i18n)
|
|
5
5
|
description: Discover how to make your vite backend multilingual. Follow the documentation to internationalize (i18n) and translate it.
|
|
6
6
|
keywords:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2025-08-11
|
|
3
3
|
updatedAt: 2025-08-11
|
|
4
4
|
title: Getting Started with Intlayer in TanStack Start (React)
|
|
5
|
-
description: Add i18n to your TanStack Start app using Intlayer
|
|
5
|
+
description: Add i18n to your TanStack Start app using Intlayer-component-level dictionaries, localized URLs, and SEO-friendly metadata.
|
|
6
6
|
keywords:
|
|
7
7
|
- Internationalization
|
|
8
8
|
- Documentation
|
package/docs/en/introduction.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt:
|
|
3
|
-
updatedAt: 2025-
|
|
2
|
+
createdAt: 2025-08-23
|
|
3
|
+
updatedAt: 2025-08-23
|
|
4
4
|
title: Introduction
|
|
5
5
|
description: Discover how Intlayer works. See the steps used by Intlayer in your application. See what does the different packages do.
|
|
6
6
|
keywords:
|
|
@@ -32,8 +32,8 @@ Intlayer also provides an optional visual editor that allows you to easily edit
|
|
|
32
32
|
.
|
|
33
33
|
└── Components
|
|
34
34
|
└── MyComponent
|
|
35
|
-
├── index.content.
|
|
36
|
-
└── index.
|
|
35
|
+
├── index.content.ts
|
|
36
|
+
└── index.tsx
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
```tsx fileName="src/components/MyComponent/index.content.ts" contentDeclarationFormat="typescript"
|
|
@@ -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
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt:
|
|
3
|
-
updatedAt: 2025-
|
|
2
|
+
createdAt: 2025-08-23
|
|
3
|
+
updatedAt: 2025-08-23
|
|
4
4
|
title: getConfiguration Function Documentation | intlayer
|
|
5
5
|
description: See how to use the getConfiguration function for intlayer package
|
|
6
6
|
keywords:
|
|
@@ -36,7 +36,6 @@ The function does not take any parameters. Instead, it uses environment variable
|
|
|
36
36
|
|
|
37
37
|
- **Type**: `IntlayerConfig`
|
|
38
38
|
- **Description**: An object containing the complete configuration for `intlayer`. The configuration includes the following sections:
|
|
39
|
-
|
|
40
39
|
- `internationalization`: Settings related to locales and strict mode.
|
|
41
40
|
- `middleware`: Settings related to URL and cookie management.
|
|
42
41
|
- `content`: Settings related to content files, directories, and patterns.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt:
|
|
3
|
-
updatedAt: 2025-
|
|
2
|
+
createdAt: 2025-08-23
|
|
3
|
+
updatedAt: 2025-08-23
|
|
4
4
|
title: getEnumeration Function Documentation | intlayer
|
|
5
5
|
description: See how to use the getEnumeration function for intlayer package
|
|
6
6
|
keywords:
|
|
@@ -29,13 +29,11 @@ The `getEnumeration` function retrieves content corresponding to a specific quan
|
|
|
29
29
|
## Parameters
|
|
30
30
|
|
|
31
31
|
- `enumerationContent: QuantityContent<Content>`
|
|
32
|
-
|
|
33
32
|
- **Description**: An object where keys represent conditions (e.g., `<=`, `<`, `>=`, `=`) and values represent the corresponding content. The order of keys defines their matching priority.
|
|
34
33
|
- **Type**: `QuantityContent<Content>`
|
|
35
34
|
- `Content` can be any type.
|
|
36
35
|
|
|
37
36
|
- `quantity: number`
|
|
38
|
-
|
|
39
37
|
- **Description**: The numeric value used to match against the conditions in `enumerationContent`.
|
|
40
38
|
- **Type**: `number`
|
|
41
39
|
|
|
@@ -141,15 +139,12 @@ console.log(content); // Output: "You have less than four"
|
|
|
141
139
|
## Edge Cases
|
|
142
140
|
|
|
143
141
|
- **No Matching Condition:**
|
|
144
|
-
|
|
145
142
|
- If no condition matches the provided quantity, the function will either return `undefined` or handle the default/fallback scenario explicitly.
|
|
146
143
|
|
|
147
144
|
- **Ambiguous Conditions:**
|
|
148
|
-
|
|
149
145
|
- If conditions overlap, the first matching condition (based on object order) takes precedence.
|
|
150
146
|
|
|
151
147
|
- **Invalid Keys:**
|
|
152
|
-
|
|
153
148
|
- The function assumes that all keys in `enumerationContent` are valid and parsable as conditions. Invalid or improperly formatted keys may lead to unexpected behavior.
|
|
154
149
|
|
|
155
150
|
- **TypeScript Enforcement:**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt:
|
|
3
|
-
updatedAt: 2025-
|
|
2
|
+
createdAt: 2025-08-23
|
|
3
|
+
updatedAt: 2025-08-23
|
|
4
4
|
title: getHTMLTextDir Function Documentation | intlayer
|
|
5
5
|
description: See how to use the getHTMLTextDir function for intlayer package
|
|
6
6
|
keywords:
|
|
@@ -29,7 +29,6 @@ The `getHTMLTextDir` function determines the text direction (`ltr`, `rtl`, or `a
|
|
|
29
29
|
## Parameters
|
|
30
30
|
|
|
31
31
|
- `locale?: Locales`
|
|
32
|
-
|
|
33
32
|
- **Description**: The locale string (e.g., `Locales.ENGLISH`, `Locales.ARABIC`) used to determine the text direction.
|
|
34
33
|
- **Type**: `Locales` (optional)
|
|
35
34
|
|
|
@@ -72,7 +71,6 @@ getHTMLTextDir(Locales.ARABIC); // Output: "rtl"
|
|
|
72
71
|
## Edge Cases
|
|
73
72
|
|
|
74
73
|
- **No Locale Provided:**
|
|
75
|
-
|
|
76
74
|
- The function returns `'auto'` when `locale` is `undefined`.
|
|
77
75
|
|
|
78
76
|
- **Unrecognized Locale:**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt:
|
|
3
|
-
updatedAt: 2025-
|
|
2
|
+
createdAt: 2025-08-23
|
|
3
|
+
updatedAt: 2025-08-23
|
|
4
4
|
title: getLocaleLang Function Documentation | intlayer
|
|
5
5
|
description: See how to use the getLocaleLang function for intlayer package
|
|
6
6
|
keywords:
|
|
@@ -29,7 +29,6 @@ The `getLocaleLang` function extracts the language code from a locale string. It
|
|
|
29
29
|
## Parameters
|
|
30
30
|
|
|
31
31
|
- `locale?: Locales`
|
|
32
|
-
|
|
33
32
|
- **Description**: The locale string (e.g., `Locales.ENGLISH_UNITED_STATES`, `Locales.FRENCH_CANADA`) from which the language code is extracted.
|
|
34
33
|
- **Type**: `Locales` (optional)
|
|
35
34
|
|
|
@@ -72,7 +71,6 @@ getLocaleLang(Locales.FRENCH); // Output: "fr"
|
|
|
72
71
|
## Edge Cases
|
|
73
72
|
|
|
74
73
|
- **No Locale Provided:**
|
|
75
|
-
|
|
76
74
|
- The function returns an empty string when `locale` is `undefined`.
|
|
77
75
|
|
|
78
76
|
- **Malformed Locale Strings:**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
createdAt:
|
|
3
|
-
updatedAt: 2025-
|
|
2
|
+
createdAt: 2025-08-23
|
|
3
|
+
updatedAt: 2025-08-23
|
|
4
4
|
title: getLocaleName Function Documentation | intlayer
|
|
5
5
|
description: See how to use the getLocaleName function for intlayer package
|
|
6
6
|
keywords:
|
|
@@ -29,7 +29,6 @@ The `getLocaleName` function returns the localized name of a given locale (`targ
|
|
|
29
29
|
## Parameters
|
|
30
30
|
|
|
31
31
|
- `displayLocale: Locales`
|
|
32
|
-
|
|
33
32
|
- **Description**: The locale in which the name of the target locale will be displayed.
|
|
34
33
|
- **Type**: Enum or string representing valid locales.
|
|
35
34
|
|