@intlayer/docs 8.7.8 → 8.7.10

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 (65) hide show
  1. package/docs/ar/dictionary/insertion.md +0 -52
  2. package/docs/ar/intlayer_with_astro.md +55 -6
  3. package/docs/ar/per_locale_file.md +0 -46
  4. package/docs/de/dictionary/insertion.md +0 -92
  5. package/docs/de/intlayer_with_astro.md +55 -6
  6. package/docs/de/intlayer_with_nextjs_16.md +0 -23
  7. package/docs/de/per_locale_file.md +0 -44
  8. package/docs/en/dictionary/insertion.md +0 -55
  9. package/docs/en/intlayer_with_astro.md +2 -1
  10. package/docs/en/per_locale_file.md +0 -43
  11. package/docs/en-GB/dictionary/insertion.md +0 -56
  12. package/docs/en-GB/intlayer_with_astro.md +55 -6
  13. package/docs/en-GB/per_locale_file.md +0 -43
  14. package/docs/es/dictionary/insertion.md +0 -52
  15. package/docs/es/intlayer_with_astro.md +55 -7
  16. package/docs/es/intlayer_with_nextjs_14.md +0 -23
  17. package/docs/es/intlayer_with_nextjs_16.md +0 -23
  18. package/docs/es/packages/next-intlayer/index.md +0 -52
  19. package/docs/es/packages/react-intlayer/index.md +0 -52
  20. package/docs/es/per_locale_file.md +0 -43
  21. package/docs/fr/dictionary/insertion.md +0 -52
  22. package/docs/fr/intlayer_with_astro.md +55 -7
  23. package/docs/fr/packages/react-intlayer/index.md +0 -52
  24. package/docs/fr/per_locale_file.md +0 -46
  25. package/docs/hi/dictionary/insertion.md +0 -91
  26. package/docs/hi/intlayer_with_astro.md +55 -6
  27. package/docs/hi/packages/intlayer/index.md +0 -52
  28. package/docs/hi/per_locale_file.md +0 -43
  29. package/docs/id/dictionary/insertion.md +0 -91
  30. package/docs/id/intlayer_with_astro.md +55 -6
  31. package/docs/id/intlayer_with_nextjs_14.md +0 -24
  32. package/docs/id/per_locale_file.md +0 -44
  33. package/docs/it/dictionary/insertion.md +0 -52
  34. package/docs/it/intlayer_with_astro.md +55 -6
  35. package/docs/it/per_locale_file.md +0 -44
  36. package/docs/ja/dictionary/insertion.md +0 -56
  37. package/docs/ja/intlayer_with_astro.md +55 -7
  38. package/docs/ja/intlayer_with_nextjs_14.md +0 -23
  39. package/docs/ja/per_locale_file.md +0 -43
  40. package/docs/ko/dictionary/insertion.md +0 -56
  41. package/docs/ko/intlayer_with_astro.md +55 -7
  42. package/docs/ko/per_locale_file.md +0 -43
  43. package/docs/pl/dictionary/insertion.md +0 -85
  44. package/docs/pl/intlayer_with_astro.md +55 -6
  45. package/docs/pl/per_locale_file.md +0 -44
  46. package/docs/pt/dictionary/insertion.md +0 -93
  47. package/docs/pt/intlayer_with_astro.md +55 -6
  48. package/docs/pt/intlayer_with_nextjs_page_router.md +0 -23
  49. package/docs/pt/per_locale_file.md +0 -44
  50. package/docs/ru/dictionary/insertion.md +0 -52
  51. package/docs/ru/intlayer_with_astro.md +55 -7
  52. package/docs/ru/per_locale_file.md +0 -44
  53. package/docs/tr/dictionary/insertion.md +0 -52
  54. package/docs/tr/intlayer_with_astro.md +55 -6
  55. package/docs/tr/per_locale_file.md +0 -43
  56. package/docs/uk/dictionary/insertion.md +0 -52
  57. package/docs/uk/intlayer_with_astro.md +55 -6
  58. package/docs/uk/per_locale_file.md +0 -43
  59. package/docs/vi/dictionary/insertion.md +0 -85
  60. package/docs/vi/intlayer_with_astro.md +55 -6
  61. package/docs/vi/per_locale_file.md +0 -46
  62. package/docs/zh/dictionary/insertion.md +0 -54
  63. package/docs/zh/intlayer_with_astro.md +55 -7
  64. package/docs/zh/per_locale_file.md +0 -44
  65. package/package.json +6 -6
@@ -54,34 +54,6 @@ history:
54
54
  export default myInsertionContent;
55
55
  ```
56
56
 
57
- ```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
58
- import { insert } from "intlayer";
59
-
60
- /** @type {import('intlayer').Dictionary} */
61
- const myInsertionContent = {
62
- key: "my_key",
63
- content: {
64
- myInsertion: insert("مرحبًا، اسمي {{name}} وعمري {{age}} سنة!"),
65
- },
66
- };
67
-
68
- export default myInsertionContent;
69
- ```
70
-
71
- ```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
72
- const { insert } = require("intlayer");
73
-
74
- /** @type {import('intlayer').Dictionary} */
75
- const myInsertionContent = {
76
- key: "my_key",
77
- content: {
78
- myInsertion: insert("مرحبًا، اسمي {{name}} وعمري {{age}} سنة!"),
79
- },
80
- };
81
-
82
- module.exports = myInsertionContent;
83
- ```
84
-
85
57
  ```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
86
58
  {
87
59
  "$schema": "https://intlayer.org/schema.json",
@@ -112,30 +84,6 @@ history:
112
84
  export default myInsertionContent;
113
85
  ```
114
86
 
115
- ```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
116
- /** @type {import('intlayer').Dictionary} */
117
- const myInsertionContent = {
118
- key: "my_key",
119
- content: {
120
- myInsertion: "مرحبًا، اسمي {{name}} وعمري {{age}} سنة!",
121
- },
122
- };
123
-
124
- export default myInsertionContent;
125
- ```
126
-
127
- ```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
128
- /** @type {import('intlayer').Dictionary} */
129
- const myInsertionContent = {
130
- key: "my_key",
131
- content: {
132
- myInsertion: "مرحبًا، اسمي {{name}} وعمري {{age}} سنة!",
133
- },
134
- };
135
-
136
- module.exports = myInsertionContent;
137
- ```
138
-
139
87
  ```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
140
88
  {
141
89
  "$schema": "https://intlayer.org/schema.json",
@@ -177,20 +177,69 @@ export default appContent;
177
177
 
178
178
  ```astro fileName="src/pages/index.astro"
179
179
  ---
180
- import { getIntlayer } from "intlayer";
181
- import appContent from "../app.content";
182
-
183
- const { title } = getIntlayer('app');
180
+ import {
181
+ getIntlayer,
182
+ getLocaleFromPath,
183
+ getLocalizedUrl,
184
+ defaultLocale,
185
+ localeMap,
186
+ getHTMLTextDir,
187
+ type LocalesValues,
188
+ } from "intlayer";
189
+ import LocaleSwitcher from "../components/LocaleSwitcher.astro";
190
+
191
+ // Get the current locale from the URL (e.g. /es/about -> 'es')
192
+ const locale = getLocaleFromPath(Astro.url.pathname) as LocalesValues;
193
+
194
+ // Get the content for the 'app' dictionary
195
+ const { title } = getIntlayer("app", locale);
184
196
  ---
185
197
 
186
- <html lang="ar" dir="rtl">
198
+ <!doctype html>
199
+ <html lang={locale} dir={getHTMLTextDir(locale)}>
187
200
  <head>
188
201
  <meta charset="utf-8" />
189
202
  <meta name="viewport" content="width=device-width" />
203
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
190
204
  <title>{title}</title>
205
+
206
+ <!-- Canonical link: Tells search engines which is the primary version of this page -->
207
+ <link
208
+ rel="canonical"
209
+ href={new URL(getLocalizedUrl(Astro.url.pathname, locale), Astro.site)}
210
+ />
211
+
212
+ <!-- Hreflang: Tell Google about all localized versions -->
213
+ {
214
+ localeMap(({ locale: mapLocale }) => (
215
+ <link
216
+ rel="alternate"
217
+ hreflang={mapLocale}
218
+ href={new URL(
219
+ getLocalizedUrl(Astro.url.pathname, mapLocale),
220
+ Astro.site
221
+ )}
222
+ />
223
+ ))
224
+ }
225
+
226
+ <!-- x-default: Fallback for users in unmatched languages -->
227
+ <link
228
+ rel="alternate"
229
+ hreflang="x-default"
230
+ href={new URL(
231
+ getLocalizedUrl(Astro.url.pathname, defaultLocale),
232
+ Astro.site
233
+ )}
234
+ />
191
235
  </head>
192
236
  <body>
193
- <h1>{title}</h1>
237
+ <header>
238
+ <LocaleSwitcher />
239
+ </header>
240
+ <main>
241
+ <h1>{title}</h1>
242
+ </main>
194
243
  </body>
195
244
  </html>
196
245
  ```
@@ -145,52 +145,6 @@ const helloWorldContent = {
145
145
  export default helloWorldContent;
146
146
  ```
147
147
 
148
- ```tsx fileName="hello-world.es.content.mjs" contentDeclarationFormat="esm"
149
- import { t, Locales } from "intlayer";
150
-
151
- /** @type {import('intlayer').Dictionary} */
152
- // محتوى "مرحبا بالعالم" للغة الإسبانية
153
- const helloWorldContent = {
154
- key: "hello-world",
155
- locale: Locales.SPANISH, // مهم
156
- content: { multilingualContent: "Título de mi componente" },
157
- };
158
-
159
- export default helloWorldContent;
160
- ```
161
-
162
- ```js fileName="hello-world.en.content.cjs" contentDeclarationFormat="commonjs"
163
- const { t, Locales } = require("intlayer");
164
-
165
- /** @type {import('intlayer').Dictionary} */
166
- // محتوى "مرحبا بالعالم" للغة الإنجليزية
167
- const helloWorldContent = {
168
- key: "hello-world",
169
- locale: Locales.ENGLISH, // مهم
170
- content: {
171
- multilingualContent: "عنوان المكون الخاص بي",
172
- },
173
- };
174
-
175
- module.exports = helloWorldContent;
176
- ```
177
-
178
- ```tsx fileName="hello-world.es.content.cjs" contentDeclarationFormat="commonjs"
179
- const { t, Locales } = require("intlayer");
180
-
181
- /** @type {import('intlayer').Dictionary} */
182
- // محتوى "مرحبا بالعالم" للغة الإسبانية
183
- const helloWorldContent = {
184
- key: "hello-world",
185
- locale: Locales.SPANISH, // مهم
186
- content: {
187
- multilingualContent: "Título de mi componente",
188
- },
189
- };
190
-
191
- module.exports = helloWorldContent;
192
- ```
193
-
194
148
  ```json5 fileName="hello-world.en.content.json" contentDeclarationFormat="json"
195
149
  {
196
150
  "$schema": "https://intlayer.org/schema.json",
@@ -56,38 +56,6 @@ Um Einfügeinhalt in Ihrem Intlayer-Projekt einzurichten, erstellen Sie ein Inha
56
56
  export default myInsertionContent;
57
57
  ```
58
58
 
59
- ```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
60
- import { insert } from "intlayer";
61
-
62
- /** @type {import('intlayer').Dictionary} */
63
- const myInsertionContent = {
64
- key: "my_key",
65
- content: {
66
- myInsertion: insert(
67
- "Hallo, mein Name ist {{name}} und ich bin {{age}} Jahre alt!"
68
- ),
69
- },
70
- };
71
-
72
- export default myInsertionContent;
73
- ```
74
-
75
- ```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
76
- const { insert } = require("intlayer");
77
-
78
- /** @type {import('intlayer').Dictionary} */
79
- const myInsertionContent = {
80
- key: "my_key",
81
- content: {
82
- myInsertion: insert(
83
- "Hallo, mein Name ist {{name}} und ich bin {{age}} Jahre alt!"
84
- ),
85
- },
86
- };
87
-
88
- module.exports = myInsertionContent;
89
- ```
90
-
91
59
  ```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
92
60
  {
93
61
  "$schema": "https://intlayer.org/schema.json",
@@ -118,30 +86,6 @@ Um Einfügeinhalt in Ihrem Intlayer-Projekt einzurichten, erstellen Sie ein Inha
118
86
  export default myInsertionContent;
119
87
  ```
120
88
 
121
- ```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
122
- /** @type {import('intlayer').Dictionary} */
123
- const myInsertionContent = {
124
- key: "my_key",
125
- content: {
126
- myInsertion: "Hallo, mein Name ist {{name}} und ich bin {{age}} Jahre alt!",
127
- },
128
- };
129
-
130
- export default myInsertionContent;
131
- ```
132
-
133
- ```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
134
- /** @type {import('intlayer').Dictionary} */
135
- const myInsertionContent = {
136
- key: "my_key",
137
- content: {
138
- myInsertion: "Hallo, mein Name ist {{name}} und ich bin {{age}} Jahre alt!",
139
- },
140
- };
141
-
142
- module.exports = myInsertionContent;
143
- ```
144
-
145
89
  ```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
146
90
  {
147
91
  "$schema": "https://intlayer.org/schema.json",
@@ -155,42 +99,6 @@ Um Einfügeinhalt in Ihrem Intlayer-Projekt einzurichten, erstellen Sie ein Inha
155
99
  </Tab>
156
100
  </Tabs>
157
101
 
158
- ```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
159
- import { insert } from "intlayer";
160
-
161
- /** @type {import('intlayer').Dictionary} */
162
- const myInsertionContent = {
163
- key: "my_key",
164
- content: {
165
- myInsertion: insert(
166
- "Hallo, mein Name ist {{name}} und ich bin {{age}} Jahre alt!"
167
- ),
168
- myInsertion2:
169
- "Hallo, mein Name ist {{name}} und ich bin {{age}} Jahre alt!", // Since intlayer v8, insertion function is not required anymore. The content will be automatically decorated.
170
- },
171
- };
172
-
173
- export default myInsertionContent;
174
- ```
175
-
176
- ```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
177
- javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
178
- const { insert } = require("intlayer");
179
-
180
- /** @type {import('intlayer').Dictionary} */
181
- const myInsertionContent = {
182
- key: "my_key",
183
- content: {
184
- myInsertion: insert(
185
- "Hallo, mein Name ist {{name}} und ich bin {{age}} Jahre alt!"
186
- ),
187
- myInsertion2: "Hallo, mein Name ist {{name}} und ich bin {{age}} Jahre alt!", // Since intlayer v8, insertion function is not required anymore. The content will be automatically decorated.
188
- },
189
- };
190
-
191
- module.exports = myInsertionContent;
192
- ```
193
-
194
102
  ```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
195
103
  {
196
104
  "$schema": "https://intlayer.org/schema.json",
@@ -177,20 +177,69 @@ Sie können die Wörterbücher direkt in Ihren `.astro`-Dateien verwenden, indem
177
177
 
178
178
  ```astro fileName="src/pages/index.astro"
179
179
  ---
180
- import { getIntlayer } from "intlayer";
181
- import appContent from "../app.content";
182
-
183
- const { title } = getIntlayer('app');
180
+ import {
181
+ getIntlayer,
182
+ getLocaleFromPath,
183
+ getLocalizedUrl,
184
+ defaultLocale,
185
+ localeMap,
186
+ getHTMLTextDir,
187
+ type LocalesValues,
188
+ } from "intlayer";
189
+ import LocaleSwitcher from "../components/LocaleSwitcher.astro";
190
+
191
+ // Get the current locale from the URL (e.g. /es/about -> 'es')
192
+ const locale = getLocaleFromPath(Astro.url.pathname) as LocalesValues;
193
+
194
+ // Get the content for the 'app' dictionary
195
+ const { title } = getIntlayer("app", locale);
184
196
  ---
185
197
 
186
- <html lang="de">
198
+ <!doctype html>
199
+ <html lang={locale} dir={getHTMLTextDir(locale)}>
187
200
  <head>
188
201
  <meta charset="utf-8" />
189
202
  <meta name="viewport" content="width=device-width" />
203
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
190
204
  <title>{title}</title>
205
+
206
+ <!-- Canonical link: Tells search engines which is the primary version of this page -->
207
+ <link
208
+ rel="canonical"
209
+ href={new URL(getLocalizedUrl(Astro.url.pathname, locale), Astro.site)}
210
+ />
211
+
212
+ <!-- Hreflang: Tell Google about all localized versions -->
213
+ {
214
+ localeMap(({ locale: mapLocale }) => (
215
+ <link
216
+ rel="alternate"
217
+ hreflang={mapLocale}
218
+ href={new URL(
219
+ getLocalizedUrl(Astro.url.pathname, mapLocale),
220
+ Astro.site
221
+ )}
222
+ />
223
+ ))
224
+ }
225
+
226
+ <!-- x-default: Fallback for users in unmatched languages -->
227
+ <link
228
+ rel="alternate"
229
+ hreflang="x-default"
230
+ href={new URL(
231
+ getLocalizedUrl(Astro.url.pathname, defaultLocale),
232
+ Astro.site
233
+ )}
234
+ />
191
235
  </head>
192
236
  <body>
193
- <h1>{title}</h1>
237
+ <header>
238
+ <LocaleSwitcher />
239
+ </header>
240
+ <main>
241
+ <h1>{title}</h1>
242
+ </main>
194
243
  </body>
195
244
  </html>
196
245
  ```
@@ -518,29 +518,6 @@ const metadataContent = {
518
518
  export default metadataContent;
519
519
  ```
520
520
 
521
- ```javascript fileName="src/app/[locale]/metadata.content.cjs" contentDeclarationFormat="commonjs"
522
- const { t } = require("intlayer");
523
-
524
- /** @type {import('intlayer').Dictionary<import('next').Metadata>} */
525
- const metadataContent = {
526
- key: "page-metadata",
527
- content: {
528
- title: t({
529
- en: "Create Next App",
530
- fr: "Créer une application Next.js",
531
- es: "Crear una aplicación Next.js",
532
- }),
533
- description: t({
534
- en: "Generated by create next app",
535
- fr: "Généré par create next app",
536
- es: "Generado por create next app",
537
- }),
538
- },
539
- };
540
-
541
- module.exports = metadataContent;
542
- ```
543
-
544
521
  ```json fileName="src/app/[locale]/metadata.content.json" contentDeclarationFormat="json"
545
522
  {
546
523
  "key": "page-metadata",
@@ -145,50 +145,6 @@ const helloWorldContent = {
145
145
  export default helloWorldContent;
146
146
  ```
147
147
 
148
- ```tsx fileName="hello-world.es.content.mjs" contentDeclarationFormat="esm"
149
- import { t, Locales } from "intlayer";
150
-
151
- /** @type {import('intlayer').Dictionary} */
152
- // Wörterbuch für spanische Lokalisierung
153
- const helloWorldContent = {
154
- key: "hello-world",
155
- locale: Locales.SPANISH, // Wichtig
156
- content: { multilingualContent: "Título de mi componente" },
157
- };
158
-
159
- export default helloWorldContent;
160
- ```
161
-
162
- ```js fileName="hello-world.en.content.cjs" contentDeclarationFormat="commonjs"
163
- const { t, Locales } = require("intlayer");
164
-
165
- /** @type {import('intlayer').Dictionary} */
166
- const helloWorldContent = {
167
- key: "hello-world",
168
- locale: Locales.ENGLISH, // Wichtig
169
- content: {
170
- multilingualContent: "Titel meiner Komponente",
171
- },
172
- };
173
-
174
- module.exports = helloWorldContent;
175
- ```
176
-
177
- ```tsx fileName="hello-world.es.content.cjs" contentDeclarationFormat="commonjs"
178
- const { t, Locales } = require("intlayer");
179
-
180
- /** @type {import('intlayer').Dictionary} */
181
- const helloWorldContent = {
182
- key: "hello-world",
183
- locale: Locales.SPANISH, // Wichtig
184
- content: {
185
- multilingualContent: "Título de mi componente",
186
- },
187
- };
188
-
189
- module.exports = helloWorldContent;
190
- ```
191
-
192
148
  ```json5 fileName="hello-world.en.content.json" contentDeclarationFormat="json"
193
149
  {
194
150
  "$schema": "https://intlayer.org/schema.json",
@@ -56,37 +56,6 @@ To set up insertion content in your Intlayer project, create a content module th
56
56
  export default myInsertionContent;
57
57
  ```
58
58
 
59
- ```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
60
- import { insert } from "intlayer";
61
-
62
- /** @type {import('intlayer').Dictionary} */
63
- const myInsertionContent = {
64
- key: "my_key",
65
- content: {
66
- myInsertion: insert(
67
- "Hello, my name is {{name}} and I am {{age}} years old!"
68
- ),
69
- },
70
- };
71
-
72
- export default myInsertionContent;
73
- ```
74
-
75
- ```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
76
- const { insert } = require("intlayer");
77
-
78
- /** @type {import('intlayer').Dictionary} */
79
- const myInsertionContent = {
80
- key: "my_key",
81
- content: {
82
- myInsertion: insert(
83
- "Hello, my name is {{name}} and I am {{age}} years old!"
84
- ),
85
- },
86
- };
87
-
88
- module.exports = myInsertionContent;
89
- ```
90
59
 
91
60
  ```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
92
61
  {
@@ -118,30 +87,6 @@ To set up insertion content in your Intlayer project, create a content module th
118
87
  export default myInsertionContent;
119
88
  ```
120
89
 
121
- ```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
122
- /** @type {import('intlayer').Dictionary} */
123
- const myInsertionContent = {
124
- key: "my_key",
125
- content: {
126
- myInsertion: "Hello, my name is {{name}} and I am {{age}} years old!",
127
- },
128
- };
129
-
130
- export default myInsertionContent;
131
- ```
132
-
133
- ```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
134
- /** @type {import('intlayer').Dictionary} */
135
- const myInsertionContent = {
136
- key: "my_key",
137
- content: {
138
- myInsertion: "Hello, my name is {{name}} and I am {{age}} years old!",
139
- },
140
- };
141
-
142
- module.exports = myInsertionContent;
143
- ```
144
-
145
90
  ```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
146
91
  {
147
92
  "$schema": "https://intlayer.org/schema.json",
@@ -188,6 +188,7 @@ import {
188
188
  getLocalizedUrl,
189
189
  defaultLocale,
190
190
  localeMap,
191
+ getHTMLTextDir,
191
192
  type LocalesValues,
192
193
  } from "intlayer";
193
194
  import LocaleSwitcher from "../components/LocaleSwitcher.astro";
@@ -200,7 +201,7 @@ const { title } = getIntlayer("app", locale);
200
201
  ---
201
202
 
202
203
  <!doctype html>
203
- <html lang={locale}>
204
+ <html lang={locale} dir={getHTMLTextDir(locale)}>
204
205
  <head>
205
206
  <meta charset="utf-8" />
206
207
  <meta name="viewport" content="width=device-width" />
@@ -69,49 +69,6 @@ const helloWorldContent = {
69
69
  export default helloWorldContent;
70
70
  ```
71
71
 
72
- ```tsx fileName="hello-world.es.content.mjs" contentDeclarationFormat="esm"
73
- import { t, Locales } from "intlayer";
74
-
75
- /** @type {import('intlayer').Dictionary} */
76
- const helloWorldContent = {
77
- key: "hello-world",
78
- locale: Locales.SPANISH, // Important
79
- content: { multilingualContent: "Título de mi componente" },
80
- };
81
-
82
- export default helloWorldContent;
83
- ```
84
-
85
- ```js fileName="hello-world.en.content.cjs" contentDeclarationFormat="commonjs"
86
- const { t, Locales } = require("intlayer");
87
-
88
- /** @type {import('intlayer').Dictionary} */
89
- const helloWorldContent = {
90
- key: "hello-world",
91
- locale: Locales.ENGLISH, // Important
92
- content: {
93
- multilingualContent: "Title of my component",
94
- },
95
- };
96
-
97
- module.exports = helloWorldContent;
98
- ```
99
-
100
- ```tsx fileName="hello-world.es.content.cjs" contentDeclarationFormat="commonjs"
101
- const { t, Locales } = require("intlayer");
102
-
103
- /** @type {import('intlayer').Dictionary} */
104
- const helloWorldContent = {
105
- key: "hello-world",
106
- locale: Locales.SPANISH, // Important
107
- content: {
108
- multilingualContent: "Título de mi componente",
109
- },
110
- };
111
-
112
- module.exports = helloWorldContent;
113
- ```
114
-
115
72
  ```json5 fileName="hello-world.en.content.json" contentDeclarationFormat="json"
116
73
  {
117
74
  "$schema": "https://intlayer.org/schema.json",
@@ -60,38 +60,6 @@ To set up insertion content in your Intlayer project, create a content module th
60
60
  export default myInsertionContent;
61
61
  ```
62
62
 
63
- ```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
64
- import { insert } from "intlayer";
65
-
66
- /** @type {import('intlayer').Dictionary} */
67
- const myInsertionContent = {
68
- key: "my_key",
69
- content: {
70
- myInsertion: insert(
71
- "Hello, my name is {{name}} and I am {{age}} years old!"
72
- ),
73
- },
74
- };
75
-
76
- export default myInsertionContent;
77
- ```
78
-
79
- ```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
80
- const { insert } = require("intlayer");
81
-
82
- /** @type {import('intlayer').Dictionary} */
83
- const myInsertionContent = {
84
- key: "my_key",
85
- content: {
86
- myInsertion: insert(
87
- "Hello, my name is {{name}} and I am {{age}} years old!"
88
- ),
89
- },
90
- };
91
-
92
- module.exports = myInsertionContent;
93
- ```
94
-
95
63
  ```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
96
64
  {
97
65
  "$schema": "https://intlayer.org/schema.json",
@@ -122,30 +90,6 @@ To set up insertion content in your Intlayer project, create a content module th
122
90
  export default myInsertionContent;
123
91
  ```
124
92
 
125
- ```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
126
- /** @type {import('intlayer').Dictionary} */
127
- const myInsertionContent = {
128
- key: "my_key",
129
- content: {
130
- myInsertion: "Hello, my name is {{name}} and I am {{age}} years old!",
131
- },
132
- };
133
-
134
- export default myInsertionContent;
135
- ```
136
-
137
- ```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
138
- /** @type {import('intlayer').Dictionary} */
139
- const myInsertionContent = {
140
- key: "my_key",
141
- content: {
142
- myInsertion: "Hello, my name is {{name}} and I am {{age}} years old!",
143
- },
144
- };
145
-
146
- module.exports = myInsertionContent;
147
- ```
148
-
149
93
  ```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
150
94
  {
151
95
  "$schema": "https://intlayer.org/schema.json",