@intlayer/docs 7.4.0 → 7.5.0-canary.1
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_i18next.md +2 -0
- package/blog/ar/intlayer_with_next-i18next.md +2 -0
- package/blog/ar/intlayer_with_next-intl.md +2 -0
- package/blog/ar/intlayer_with_react-i18next.md +2 -0
- package/blog/ar/intlayer_with_react-intl.md +2 -0
- package/blog/ar/intlayer_with_vue-i18n.md +2 -0
- package/blog/de/intlayer_with_i18next.md +2 -0
- package/blog/de/intlayer_with_next-i18next.md +1 -0
- package/blog/de/intlayer_with_next-intl.md +2 -0
- package/blog/de/intlayer_with_react-i18next.md +2 -0
- package/blog/de/intlayer_with_react-intl.md +2 -0
- package/blog/de/intlayer_with_vue-i18n.md +2 -0
- package/blog/en/intlayer_with_i18next.md +6 -0
- package/blog/en/intlayer_with_next-i18next.md +3 -0
- package/blog/en/intlayer_with_next-intl.md +3 -0
- package/blog/en/intlayer_with_react-i18next.md +3 -0
- package/blog/en/intlayer_with_react-intl.md +3 -0
- package/blog/en/intlayer_with_vue-i18n.md +3 -0
- package/blog/en-GB/intlayer_with_i18next.md +2 -0
- package/blog/en-GB/intlayer_with_next-i18next.md +2 -0
- package/blog/en-GB/intlayer_with_next-intl.md +2 -0
- package/blog/en-GB/intlayer_with_react-i18next.md +2 -0
- package/blog/en-GB/intlayer_with_react-intl.md +2 -0
- package/blog/en-GB/intlayer_with_vue-i18n.md +2 -0
- package/blog/es/intlayer_with_i18next.md +2 -0
- package/blog/es/intlayer_with_next-i18next.md +2 -0
- package/blog/es/intlayer_with_next-intl.md +2 -0
- package/blog/es/intlayer_with_react-i18next.md +2 -0
- package/blog/es/intlayer_with_react-intl.md +2 -0
- package/blog/es/intlayer_with_vue-i18n.md +2 -0
- package/blog/fr/intlayer_with_i18next.md +2 -0
- package/blog/fr/intlayer_with_next-i18next.md +2 -0
- package/blog/fr/intlayer_with_next-intl.md +2 -0
- package/blog/fr/intlayer_with_react-i18next.md +2 -0
- package/blog/fr/intlayer_with_react-intl.md +2 -0
- package/blog/fr/intlayer_with_vue-i18n.md +2 -0
- package/blog/hi/intlayer_with_i18next.md +2 -0
- package/blog/hi/intlayer_with_next-i18next.md +2 -0
- package/blog/hi/intlayer_with_next-intl.md +2 -0
- package/blog/hi/intlayer_with_react-i18next.md +2 -0
- package/blog/hi/intlayer_with_react-intl.md +2 -0
- package/blog/hi/intlayer_with_vue-i18n.md +2 -0
- package/blog/id/intlayer_with_i18next.md +2 -0
- package/blog/id/intlayer_with_next-i18next.md +2 -0
- package/blog/id/intlayer_with_next-intl.md +2 -0
- package/blog/id/intlayer_with_react-i18next.md +2 -0
- package/blog/id/intlayer_with_react-intl.md +2 -0
- package/blog/id/intlayer_with_vue-i18n.md +2 -0
- package/blog/it/intlayer_with_i18next.md +2 -0
- package/blog/it/intlayer_with_next-i18next.md +2 -0
- package/blog/it/intlayer_with_next-intl.md +2 -0
- package/blog/it/intlayer_with_react-i18next.md +2 -0
- package/blog/it/intlayer_with_react-intl.md +2 -0
- package/blog/it/intlayer_with_vue-i18n.md +2 -0
- package/blog/ja/intlayer_with_i18next.md +2 -0
- package/blog/ja/intlayer_with_next-i18next.md +1 -0
- package/blog/ja/intlayer_with_next-intl.md +2 -0
- package/blog/ja/intlayer_with_react-i18next.md +2 -0
- package/blog/ja/intlayer_with_react-intl.md +2 -0
- package/blog/ja/intlayer_with_vue-i18n.md +2 -0
- package/blog/ko/intlayer_with_i18next.md +2 -0
- package/blog/ko/intlayer_with_next-i18next.md +2 -0
- package/blog/ko/intlayer_with_next-intl.md +2 -0
- package/blog/ko/intlayer_with_react-i18next.md +2 -0
- package/blog/ko/intlayer_with_react-intl.md +2 -0
- package/blog/ko/intlayer_with_vue-i18n.md +2 -0
- package/blog/pl/intlayer_with_i18next.md +2 -0
- package/blog/pl/intlayer_with_next-i18next.md +2 -0
- package/blog/pl/intlayer_with_next-intl.md +2 -0
- package/blog/pl/intlayer_with_react-i18next.md +2 -0
- package/blog/pl/intlayer_with_react-intl.md +2 -0
- package/blog/pl/intlayer_with_vue-i18n.md +2 -0
- package/blog/pt/intlayer_with_i18next.md +2 -0
- package/blog/pt/intlayer_with_next-i18next.md +2 -0
- package/blog/pt/intlayer_with_next-intl.md +2 -0
- package/blog/pt/intlayer_with_react-i18next.md +2 -0
- package/blog/pt/intlayer_with_react-intl.md +2 -0
- package/blog/pt/intlayer_with_vue-i18n.md +2 -0
- package/blog/ru/intlayer_with_i18next.md +2 -0
- package/blog/ru/intlayer_with_next-i18next.md +2 -0
- package/blog/ru/intlayer_with_next-intl.md +2 -0
- package/blog/ru/intlayer_with_react-i18next.md +2 -0
- package/blog/ru/intlayer_with_react-intl.md +2 -0
- package/blog/ru/intlayer_with_vue-i18n.md +2 -0
- package/blog/tr/intlayer_with_i18next.md +2 -0
- package/blog/tr/intlayer_with_next-i18next.md +2 -0
- package/blog/tr/intlayer_with_next-intl.md +2 -0
- package/blog/tr/intlayer_with_react-i18next.md +2 -0
- package/blog/tr/intlayer_with_react-intl.md +2 -0
- package/blog/tr/intlayer_with_vue-i18n.md +2 -0
- package/blog/vi/intlayer_with_i18next.md +2 -0
- package/blog/vi/intlayer_with_next-i18next.md +2 -0
- package/blog/vi/intlayer_with_next-intl.md +2 -0
- package/blog/vi/intlayer_with_react-i18next.md +2 -0
- package/blog/vi/intlayer_with_react-intl.md +2 -0
- package/blog/vi/intlayer_with_vue-i18n.md +2 -0
- package/blog/zh/intlayer_with_i18next.md +2 -0
- package/blog/zh/intlayer_with_next-i18next.md +2 -0
- package/blog/zh/intlayer_with_next-intl.md +2 -0
- package/blog/zh/intlayer_with_react-i18next.md +2 -0
- package/blog/zh/intlayer_with_react-intl.md +2 -0
- package/blog/zh/intlayer_with_vue-i18n.md +2 -0
- package/dist/cjs/generated/docs.entry.cjs +19 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +19 -0
- package/dist/esm/generated/docs.entry.mjs.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/cli/index.md +5 -0
- package/docs/ar/cli/login.md +157 -0
- package/docs/ar/configuration.md +12 -0
- package/docs/ar/dictionary/content_file.md +24 -1
- package/docs/ar/intlayer_with_astro.md +1 -1
- package/docs/ar/intlayer_with_express.md +1 -1
- package/docs/ar/intlayer_with_nestjs.md +1 -1
- package/docs/ar/intlayer_with_next-i18next.md +1 -0
- package/docs/ar/intlayer_with_next-intl.md +1 -0
- package/docs/ar/intlayer_with_tanstack.md +1 -12
- package/docs/ar/plugins/sync-json.md +27 -2
- package/docs/de/cli/index.md +5 -0
- package/docs/de/cli/login.md +160 -0
- package/docs/de/configuration.md +12 -0
- package/docs/de/dictionary/content_file.md +24 -1
- package/docs/de/intlayer_with_astro.md +1 -1
- package/docs/de/intlayer_with_express.md +1 -1
- package/docs/de/intlayer_with_nestjs.md +1 -1
- package/docs/de/intlayer_with_next-i18next.md +1 -0
- package/docs/de/intlayer_with_next-intl.md +1 -0
- package/docs/de/intlayer_with_tanstack.md +1 -12
- package/docs/de/plugins/sync-json.md +27 -2
- package/docs/en/cli/index.md +5 -0
- package/docs/en/cli/login.md +157 -0
- package/docs/en/configuration.md +13 -0
- package/docs/en/dictionary/content_file.md +24 -1
- package/docs/en/index.md +1 -0
- package/docs/en/intlayer_with_astro.md +1 -1
- package/docs/en/intlayer_with_express.md +1 -1
- package/docs/en/intlayer_with_nestjs.md +1 -2
- package/docs/en/intlayer_with_next-i18next.md +1 -0
- package/docs/en/intlayer_with_next-intl.md +1 -0
- package/docs/en/intlayer_with_tanstack.md +7 -17
- package/docs/en/plugins/sync-json.md +53 -2
- package/docs/en-GB/cli/index.md +5 -0
- package/docs/en-GB/cli/login.md +181 -0
- package/docs/en-GB/configuration.md +12 -0
- package/docs/en-GB/dictionary/content_file.md +24 -1
- package/docs/en-GB/intlayer_with_astro.md +1 -1
- package/docs/en-GB/intlayer_with_express.md +1 -1
- package/docs/en-GB/intlayer_with_nestjs.md +1 -1
- package/docs/en-GB/intlayer_with_next-i18next.md +1 -0
- package/docs/en-GB/intlayer_with_next-intl.md +1 -0
- package/docs/en-GB/intlayer_with_tanstack.md +1 -12
- package/docs/en-GB/plugins/sync-json.md +26 -1
- package/docs/es/cli/index.md +5 -0
- package/docs/es/cli/login.md +182 -0
- package/docs/es/configuration.md +12 -0
- package/docs/es/dictionary/content_file.md +24 -1
- package/docs/es/intlayer_with_astro.md +1 -1
- package/docs/es/intlayer_with_express.md +1 -1
- package/docs/es/intlayer_with_nestjs.md +1 -1
- package/docs/es/intlayer_with_next-i18next.md +1 -0
- package/docs/es/intlayer_with_next-intl.md +1 -0
- package/docs/es/intlayer_with_tanstack.md +1 -12
- package/docs/es/plugins/sync-json.md +27 -2
- package/docs/fr/cli/index.md +5 -0
- package/docs/fr/cli/login.md +185 -0
- package/docs/fr/configuration.md +12 -0
- package/docs/fr/dictionary/content_file.md +24 -1
- package/docs/fr/intlayer_with_astro.md +1 -1
- package/docs/fr/intlayer_with_express.md +1 -1
- package/docs/fr/intlayer_with_nestjs.md +1 -1
- package/docs/fr/intlayer_with_next-i18next.md +1 -0
- package/docs/fr/intlayer_with_next-intl.md +1 -0
- package/docs/fr/intlayer_with_tanstack.md +1 -12
- package/docs/fr/plugins/sync-json.md +27 -2
- package/docs/hi/cli/index.md +5 -0
- package/docs/hi/cli/login.md +181 -0
- package/docs/hi/configuration.md +12 -0
- package/docs/hi/dictionary/content_file.md +24 -1
- package/docs/hi/intlayer_with_astro.md +1 -1
- package/docs/hi/intlayer_with_express.md +1 -1
- package/docs/hi/intlayer_with_nestjs.md +1 -1
- package/docs/hi/intlayer_with_next-i18next.md +1 -0
- package/docs/hi/intlayer_with_next-intl.md +1 -0
- package/docs/hi/intlayer_with_tanstack.md +1 -12
- package/docs/hi/plugins/sync-json.md +27 -2
- package/docs/id/cli/index.md +5 -0
- package/docs/id/cli/login.md +157 -0
- package/docs/id/configuration.md +12 -0
- package/docs/id/dictionary/content_file.md +24 -1
- package/docs/id/intlayer_with_astro.md +1 -1
- package/docs/id/intlayer_with_express.md +1 -1
- package/docs/id/intlayer_with_nestjs.md +1 -1
- package/docs/id/intlayer_with_next-i18next.md +1 -0
- package/docs/id/intlayer_with_next-intl.md +1 -0
- package/docs/id/intlayer_with_tanstack.md +1 -12
- package/docs/id/plugins/sync-json.md +27 -2
- package/docs/it/cli/index.md +5 -0
- package/docs/it/cli/login.md +157 -0
- package/docs/it/configuration.md +12 -0
- package/docs/it/dictionary/content_file.md +24 -1
- package/docs/it/intlayer_with_astro.md +1 -1
- package/docs/it/intlayer_with_express.md +1 -1
- package/docs/it/intlayer_with_nestjs.md +1 -1
- package/docs/it/intlayer_with_next-i18next.md +1 -0
- package/docs/it/intlayer_with_next-intl.md +1 -0
- package/docs/it/intlayer_with_tanstack.md +1 -12
- package/docs/it/plugins/sync-json.md +27 -2
- package/docs/ja/cli/index.md +5 -0
- package/docs/ja/cli/login.md +159 -0
- package/docs/ja/configuration.md +12 -0
- package/docs/ja/dictionary/content_file.md +24 -1
- package/docs/ja/intlayer_with_astro.md +1 -1
- package/docs/ja/intlayer_with_express.md +1 -1
- package/docs/ja/intlayer_with_nestjs.md +1 -1
- package/docs/ja/intlayer_with_next-i18next.md +1 -0
- package/docs/ja/intlayer_with_next-intl.md +1 -0
- package/docs/ja/intlayer_with_tanstack.md +1 -12
- package/docs/ja/plugins/sync-json.md +27 -2
- package/docs/ko/cli/index.md +5 -0
- package/docs/ko/cli/login.md +188 -0
- package/docs/ko/configuration.md +12 -0
- package/docs/ko/dictionary/content_file.md +44 -1
- package/docs/ko/intlayer_with_astro.md +1 -1
- package/docs/ko/intlayer_with_express.md +1 -1
- package/docs/ko/intlayer_with_nestjs.md +1 -1
- package/docs/ko/intlayer_with_next-i18next.md +1 -0
- package/docs/ko/intlayer_with_next-intl.md +1 -0
- package/docs/ko/intlayer_with_tanstack.md +1 -12
- package/docs/ko/plugins/sync-json.md +27 -2
- package/docs/pl/cli/index.md +5 -0
- package/docs/pl/cli/login.md +187 -0
- package/docs/pl/configuration.md +12 -0
- package/docs/pl/dictionary/content_file.md +24 -1
- package/docs/pl/intlayer_with_astro.md +2 -2
- package/docs/pl/intlayer_with_express.md +1 -1
- package/docs/pl/intlayer_with_nestjs.md +1 -1
- package/docs/pl/intlayer_with_next-i18next.md +1 -0
- package/docs/pl/intlayer_with_next-intl.md +1 -0
- package/docs/pl/intlayer_with_tanstack.md +1 -12
- package/docs/pl/plugins/sync-json.md +24 -2
- package/docs/pt/cli/index.md +5 -0
- package/docs/pt/cli/login.md +186 -0
- package/docs/pt/configuration.md +12 -0
- package/docs/pt/dictionary/content_file.md +24 -1
- package/docs/pt/intlayer_with_astro.md +1 -1
- package/docs/pt/intlayer_with_express.md +1 -1
- package/docs/pt/intlayer_with_nestjs.md +1 -1
- package/docs/pt/intlayer_with_next-i18next.md +1 -0
- package/docs/pt/intlayer_with_next-intl.md +1 -0
- package/docs/pt/intlayer_with_react_router_v7_fs_routes.md +570 -0
- package/docs/pt/intlayer_with_tanstack.md +1 -12
- package/docs/pt/plugins/sync-json.md +27 -2
- package/docs/ru/cli/index.md +5 -0
- package/docs/ru/cli/login.md +181 -0
- package/docs/ru/configuration.md +12 -0
- package/docs/ru/dictionary/content_file.md +44 -1
- package/docs/ru/intlayer_with_astro.md +1 -1
- package/docs/ru/intlayer_with_express.md +1 -1
- package/docs/ru/intlayer_with_nestjs.md +1 -1
- package/docs/ru/intlayer_with_next-i18next.md +1 -0
- package/docs/ru/intlayer_with_next-intl.md +1 -0
- package/docs/ru/intlayer_with_tanstack.md +1 -12
- package/docs/ru/plugins/sync-json.md +27 -2
- package/docs/tr/cli/index.md +5 -0
- package/docs/tr/cli/login.md +171 -0
- package/docs/tr/configuration.md +12 -0
- package/docs/tr/dictionary/content_file.md +44 -1
- package/docs/tr/intlayer_with_astro.md +1 -1
- package/docs/tr/intlayer_with_express.md +1 -1
- package/docs/tr/intlayer_with_next-i18next.md +1 -0
- package/docs/tr/intlayer_with_next-intl.md +1 -0
- package/docs/tr/intlayer_with_tanstack.md +1 -12
- package/docs/tr/plugins/sync-json.md +27 -2
- package/docs/vi/cli/index.md +5 -0
- package/docs/vi/cli/login.md +186 -0
- package/docs/vi/configuration.md +12 -0
- package/docs/vi/dictionary/content_file.md +24 -1
- package/docs/vi/intlayer_with_astro.md +1 -1
- package/docs/vi/intlayer_with_express.md +1 -1
- package/docs/vi/intlayer_with_nestjs.md +1 -1
- package/docs/vi/intlayer_with_next-i18next.md +1 -0
- package/docs/vi/intlayer_with_next-intl.md +1 -0
- package/docs/vi/intlayer_with_tanstack.md +1 -12
- package/docs/vi/plugins/sync-json.md +27 -2
- package/docs/zh/cli/index.md +5 -0
- package/docs/zh/cli/login.md +182 -0
- package/docs/zh/configuration.md +12 -0
- package/docs/zh/dictionary/content_file.md +44 -1
- package/docs/zh/intlayer_with_astro.md +1 -1
- package/docs/zh/intlayer_with_express.md +1 -1
- package/docs/zh/intlayer_with_nestjs.md +1 -1
- package/docs/zh/intlayer_with_next-i18next.md +1 -0
- package/docs/zh/intlayer_with_next-intl.md +1 -0
- package/docs/zh/intlayer_with_tanstack.md +1 -12
- package/docs/zh/plugins/sync-json.md +27 -2
- package/package.json +9 -9
- package/src/generated/docs.entry.ts +19 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-02-07
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-12-13
|
|
4
4
|
title: Inhaltsdatei
|
|
5
5
|
description: Erfahren Sie, wie Sie die Erweiterungen für Ihre Inhaltsdeklarationsdateien anpassen können. Folgen Sie dieser Dokumentation, um Bedingungen effizient in Ihrem Projekt umzusetzen.
|
|
6
6
|
keywords:
|
|
@@ -12,6 +12,9 @@ slugs:
|
|
|
12
12
|
- concept
|
|
13
13
|
- content
|
|
14
14
|
history:
|
|
15
|
+
- version: 7.5.0
|
|
16
|
+
date: 2025-12-13
|
|
17
|
+
changes: Unterstützung für ICU- und i18next-Formate hinzugefügt
|
|
15
18
|
- version: 6.0.0
|
|
16
19
|
date: 2025-09-20
|
|
17
20
|
changes: Felddokumentation hinzugefügt
|
|
@@ -386,6 +389,26 @@ Array von Zeichenketten zur Kategorisierung und Organisation von Wörterbüchern
|
|
|
386
389
|
}
|
|
387
390
|
```
|
|
388
391
|
|
|
392
|
+
#### `format` ('intlayer' | 'icu' | 'i18next')
|
|
393
|
+
|
|
394
|
+
Gibt den Formatierer an, der für den Wörterbuchinhalt verwendet werden soll. Dies ermöglicht die Verwendung verschiedener Nachrichtenformatierungssyntaxen.
|
|
395
|
+
|
|
396
|
+
- `'intlayer'`: Der Standard-Intlayer-Formatierer.
|
|
397
|
+
- `'icu'`: Verwendet ICU-Nachrichtenformatierung.
|
|
398
|
+
- `'i18next'`: Verwendet i18next-Nachrichtenformatierung.
|
|
399
|
+
|
|
400
|
+
**Beispiel:**
|
|
401
|
+
|
|
402
|
+
```typescript
|
|
403
|
+
{
|
|
404
|
+
key: "my-dictionary",
|
|
405
|
+
format: "icu",
|
|
406
|
+
content: {
|
|
407
|
+
message: "Hello {name}, you have {count, plural, one {# message} other {# messages}}"
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
```
|
|
411
|
+
|
|
389
412
|
#### `locale` (LocalesValues)
|
|
390
413
|
|
|
391
414
|
Wandelt das Wörterbuch in ein pro-Locale-Wörterbuch um, bei dem jedes im Inhalt deklarierte Feld automatisch in einen Übersetzungsknoten umgewandelt wird. Wenn diese Eigenschaft gesetzt ist:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2024-03-07
|
|
3
3
|
updatedAt: 2025-10-03
|
|
4
4
|
title: Wie Sie Ihre Astro übersetzen – i18n-Leitfaden 2025
|
|
5
|
-
description: Erfahren Sie, wie Sie Internationalisierung (i18n) zu Ihrer
|
|
5
|
+
description: Erfahren Sie, wie Sie Internationalisierung (i18n) zu Ihrer Astro-Website mit Intlayer hinzufügen. Folgen Sie dieser Anleitung, um Ihre Website mehrsprachig zu machen.
|
|
6
6
|
keywords:
|
|
7
7
|
- Internationalisierung
|
|
8
8
|
- Dokumentation
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2024-08-11
|
|
3
3
|
updatedAt: 2025-06-29
|
|
4
4
|
title: Wie Sie Ihre Express backend übersetzen – i18n-Leitfaden 2025
|
|
5
|
-
description: Entdecken Sie, wie Sie Ihre
|
|
5
|
+
description: Entdecken Sie, wie Sie Ihre Express-Backend mehrsprachig gestalten können. Befolgen Sie die Dokumentation, um sie zu internationalisieren (i18n) und zu übersetzen.
|
|
6
6
|
keywords:
|
|
7
7
|
- Internationalisierung
|
|
8
8
|
- Dokumentation
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2025-09-09
|
|
3
3
|
updatedAt: 2025-09-09
|
|
4
4
|
title: Wie Sie Ihre Nest backend übersetzen – i18n-Leitfaden 2025
|
|
5
|
-
description: Entdecken Sie, wie Sie Ihr
|
|
5
|
+
description: Entdecken Sie, wie Sie Ihr NestJS-Backend mehrsprachig machen. Folgen Sie der Dokumentation, um es zu internationalisieren (i18n) und zu übersetzen.
|
|
6
6
|
keywords:
|
|
7
7
|
- Internationalisierung
|
|
8
8
|
- Dokumentation
|
|
@@ -419,6 +419,7 @@ const config: IntlayerConfig = {
|
|
|
419
419
|
plugins: [
|
|
420
420
|
// Synchronisieren Sie Ihre Ordnerstruktur pro Namespace mit Intlayer
|
|
421
421
|
syncJSON({
|
|
422
|
+
format: "icu",
|
|
422
423
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`, // Pfad zu den JSON-Übersetzungsdateien
|
|
423
424
|
}),
|
|
424
425
|
],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-09-09
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-12-11
|
|
4
4
|
title: Wie Sie Ihre Tanstack Start übersetzen – i18n-Leitfaden 2025
|
|
5
5
|
description: Erfahren Sie, wie Sie Internationalisierung (i18n) zu Ihrer Tanstack Start-Anwendung mit Intlayer hinzufügen. Folgen Sie dieser umfassenden Anleitung, um Ihre App mehrsprachig mit lokalisierungsbewusstem Routing zu machen.
|
|
6
6
|
keywords:
|
|
@@ -648,17 +648,6 @@ export function NotFoundComponent() {
|
|
|
648
648
|
}
|
|
649
649
|
```
|
|
650
650
|
|
|
651
|
-
```tsx fileName="src/routes/__root.tsx"
|
|
652
|
-
import { createRootRoute } from "@tanstack/react-router";
|
|
653
|
-
|
|
654
|
-
// Die Root-Route dient als Layout auf oberster Ebene
|
|
655
|
-
// Sie behandelt 404s nicht direkt - das wird an untergeordnete Routen delegiert
|
|
656
|
-
// Dies hält die Root einfach und ermöglicht es locale-bewussten Routen, ihre eigene 404-Logik zu verwalten
|
|
657
|
-
export const Route = createRootRoute({
|
|
658
|
-
component: Outlet,
|
|
659
|
-
});
|
|
660
|
-
```
|
|
661
|
-
|
|
662
651
|
```tsx fileName="src/routes/{-$locale}/route.tsx"
|
|
663
652
|
import { createFileRoute, Outlet, redirect } from "@tanstack/react-router";
|
|
664
653
|
import { validatePrefix } from "intlayer";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-03-13
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-12-13
|
|
4
4
|
title: Sync JSON Plugin
|
|
5
5
|
description: Synchronisieren Sie Intlayer-Wörterbücher mit Drittanbieter-i18n-JSON-Dateien (i18next, next-intl, react-intl, vue-i18n und mehr). Behalten Sie Ihr bestehendes i18n bei und verwenden Sie Intlayer, um Ihre Nachrichten zu verwalten, zu übersetzen und zu testen.
|
|
6
6
|
keywords:
|
|
@@ -24,12 +24,15 @@ slugs:
|
|
|
24
24
|
- sync-json
|
|
25
25
|
youtubeVideo: https://www.youtube.com/watch?v=MpGMxniDHNg
|
|
26
26
|
history:
|
|
27
|
+
- version: 7.5.0
|
|
28
|
+
date: 2025-12-13
|
|
29
|
+
changes: Unterstützung für ICU- und i18next-Formate hinzugefügt
|
|
27
30
|
- version: 6.1.6
|
|
28
31
|
date: 2025-10-05
|
|
29
32
|
changes: Erste Dokumentation des Sync JSON Plugins
|
|
30
33
|
---
|
|
31
34
|
|
|
32
|
-
# Sync JSON (i18n-Brücken)
|
|
35
|
+
# Sync JSON (i18n-Brücken) - Sync JSON mit ICU / i18next-Unterstützung
|
|
33
36
|
|
|
34
37
|
<iframe title="Wie Sie Ihre JSON-Übersetzungen mit Intlayer synchronisiert halten" class="m-auto aspect-[16/9] w-full overflow-hidden rounded-lg border-0" allow="autoplay; gyroscope;" loading="lazy" width="1080" height="auto" src="https://www.youtube.com/embed/MpGMxniDHNg?autoplay=0&origin=http://intlayer.org&controls=0&rel=1"/>
|
|
35
38
|
|
|
@@ -105,9 +108,27 @@ syncJSON({
|
|
|
105
108
|
source: ({ key, locale }) => string, // erforderlich
|
|
106
109
|
location?: string, // optionales Label, Standard: "plugin"
|
|
107
110
|
priority?: number, // optionale Priorität zur Konfliktlösung, Standard: 0
|
|
111
|
+
format?: 'intlayer' | 'icu' | 'i18next', // optionaler Formatierer, Standard: 'intlayer'
|
|
108
112
|
});
|
|
109
113
|
```
|
|
110
114
|
|
|
115
|
+
#### `format` ('intlayer' | 'icu' | 'i18next')
|
|
116
|
+
|
|
117
|
+
Gibt den Formatierer an, der für den Wörterbuchinhalt bei der Synchronisierung von JSON-Dateien verwendet werden soll. Dies ermöglicht die Verwendung verschiedener Nachrichtenformatierungssyntaxen, die mit verschiedenen i18n-Bibliotheken kompatibel sind.
|
|
118
|
+
|
|
119
|
+
- `'intlayer'`: Der Standard-Intlayer-Formatierer (Standard).
|
|
120
|
+
- `'icu'`: Verwendet ICU-Nachrichtenformatierung (kompatibel mit Bibliotheken wie react-intl, vue-i18n).
|
|
121
|
+
- `'i18next'`: Verwendet i18next-Nachrichtenformatierung (kompatibel mit i18next, next-i18next, Solid-i18next).
|
|
122
|
+
|
|
123
|
+
**Beispiel:**
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
syncJSON({
|
|
127
|
+
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
128
|
+
format: "i18next", // i18next-Formatierung für Kompatibilität verwenden
|
|
129
|
+
}),
|
|
130
|
+
```
|
|
131
|
+
|
|
111
132
|
## Mehrere JSON-Quellen und Priorität
|
|
112
133
|
|
|
113
134
|
Sie können mehrere `syncJSON`-Plugins hinzufügen, um verschiedene JSON-Quellen zu synchronisieren. Dies ist nützlich, wenn Sie mehrere i18n-Bibliotheken oder unterschiedliche JSON-Strukturen in Ihrem Projekt haben.
|
|
@@ -134,6 +155,7 @@ export default defineConfig({
|
|
|
134
155
|
plugins: [
|
|
135
156
|
// Primäre JSON-Quelle (höchste Priorität)
|
|
136
157
|
syncJSON({
|
|
158
|
+
format: "i18next",
|
|
137
159
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
138
160
|
location: "main-translations",
|
|
139
161
|
priority: 10,
|
|
@@ -141,6 +163,7 @@ export default defineConfig({
|
|
|
141
163
|
|
|
142
164
|
// Fallback-JSON-Quelle (niedrigere Priorität)
|
|
143
165
|
syncJSON({
|
|
166
|
+
format: "i18next",
|
|
144
167
|
source: ({ locale }) => `./fallback-locales/${locale}.json`,
|
|
145
168
|
location: "fallback-translations",
|
|
146
169
|
priority: 5,
|
|
@@ -148,6 +171,7 @@ export default defineConfig({
|
|
|
148
171
|
|
|
149
172
|
// Legacy-JSON-Quelle (niedrigste Priorität)
|
|
150
173
|
syncJSON({
|
|
174
|
+
format: "i18next",
|
|
151
175
|
source: ({ locale }) => `/my/other/app/legacy/${locale}/messages.json`,
|
|
152
176
|
location: "legacy-translations",
|
|
153
177
|
priority: 1,
|
|
@@ -178,6 +202,7 @@ import { syncJSON } from "@intlayer/sync-json-plugin";
|
|
|
178
202
|
export default {
|
|
179
203
|
plugins: [
|
|
180
204
|
syncJSON({
|
|
205
|
+
format: "i18next",
|
|
181
206
|
source: ({ key, locale }) => `./locales/${locale}/${key}.json`,
|
|
182
207
|
}),
|
|
183
208
|
],
|
package/docs/en/cli/index.md
CHANGED
|
@@ -103,6 +103,10 @@ To see how to configure available locales, or other parameters, refer to the [co
|
|
|
103
103
|
|
|
104
104
|
## Run intlayer commands
|
|
105
105
|
|
|
106
|
+
### Authentication
|
|
107
|
+
|
|
108
|
+
- **[Login](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/login.md)** - Authenticate with the Intlayer CMS and get access credentials
|
|
109
|
+
|
|
106
110
|
### Core Commands
|
|
107
111
|
|
|
108
112
|
- **[Build Dictionaries](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/build.md)** - Build your dictionaries from content declaration files
|
|
@@ -144,6 +148,7 @@ To see how to configure available locales, or other parameters, refer to the [co
|
|
|
144
148
|
|
|
145
149
|
```json fileName="package.json"
|
|
146
150
|
"scripts": {
|
|
151
|
+
"intlayer:login": "npx intlayer login",
|
|
147
152
|
"intlayer:build": "npx intlayer build",
|
|
148
153
|
"intlayer:watch": "npx intlayer build --watch",
|
|
149
154
|
"intlayer:push": "npx intlayer push",
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-12-16
|
|
3
|
+
updatedAt: 2025-12-16
|
|
4
|
+
title: CLI - Login
|
|
5
|
+
description: Learn how to use the Intlayer CLI login command to authenticate with the Intlayer CMS and obtain access credentials.
|
|
6
|
+
keywords:
|
|
7
|
+
- CLI
|
|
8
|
+
- Login
|
|
9
|
+
- Authentication
|
|
10
|
+
- CMS
|
|
11
|
+
- Intlayer
|
|
12
|
+
- Credentials
|
|
13
|
+
slugs:
|
|
14
|
+
- doc
|
|
15
|
+
- concept
|
|
16
|
+
- cli
|
|
17
|
+
- login
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Intlayer CLI Login Command
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Description
|
|
25
|
+
|
|
26
|
+
The `login` command of the Intlayer CLI allows you to authenticate with the Intlayer CMS. This command automatically opens your default browser to complete the authentication process and receive the necessary credentials (Client ID and Client Secret) to use Intlayer services.
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx intlayer login [options]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
or
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
intlayer login [options]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Options
|
|
41
|
+
|
|
42
|
+
### `--cms-url <url>`
|
|
43
|
+
|
|
44
|
+
Specify the URL of the Intlayer CMS to connect to for authentication.
|
|
45
|
+
|
|
46
|
+
- **Type**: `string`
|
|
47
|
+
- **Default**: The value configured in `intlayer.config.*` or `https://intlayer.org`
|
|
48
|
+
- **Example**:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx intlayer login --cms-url https://intlayer.org
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Configuration Options
|
|
55
|
+
|
|
56
|
+
You can also use common configuration options:
|
|
57
|
+
|
|
58
|
+
- `--env-file <path>`: Path to the environment file
|
|
59
|
+
- `-e, --env <env>`: Execution environment
|
|
60
|
+
- `--base-dir <dir>`: Base directory of the project
|
|
61
|
+
- `--verbose`: Enable detailed output (default: true)
|
|
62
|
+
- `--prefix <prefix>`: Prefix for logs
|
|
63
|
+
|
|
64
|
+
## How It Works
|
|
65
|
+
|
|
66
|
+
1. **Local Server Start**: The command starts a local HTTP server on a random port to receive credentials from the CMS
|
|
67
|
+
2. **Browser Opening**: The command automatically opens your default browser to the CMS login URL
|
|
68
|
+
3. **Authentication**: Complete authentication in the browser using your Intlayer account
|
|
69
|
+
4. **Credentials Reception**: The local server receives the Client ID and Client Secret from the CMS
|
|
70
|
+
5. **Instructions**: The command displays instructions for configuring credentials in your project
|
|
71
|
+
|
|
72
|
+
## Output
|
|
73
|
+
|
|
74
|
+
After a successful login, the command will display:
|
|
75
|
+
|
|
76
|
+
1. **The received credentials** (Client ID and Client Secret)
|
|
77
|
+
2. **Instructions for the `.env` file**:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
INTLAYER_CLIENT_ID=your_client_id
|
|
81
|
+
INTLAYER_CLIENT_SECRET=your_client_secret
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
3. **Instructions for the Intlayer configuration file**:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
{
|
|
88
|
+
editor: {
|
|
89
|
+
cmsURL: 'https://intlayer.org',
|
|
90
|
+
clientId: process.env.INTLAYER_CLIENT_ID,
|
|
91
|
+
clientSecret: process.env.INTLAYER_CLIENT_SECRET,
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Manual Configuration
|
|
97
|
+
|
|
98
|
+
If the browser doesn't open automatically, you can manually visit the URL displayed in the terminal.
|
|
99
|
+
|
|
100
|
+
## Examples
|
|
101
|
+
|
|
102
|
+
### Login with Custom CMS URL
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npx intlayer login --cms-url https://custom-cms.example.com
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Login with Specific Environment File
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npx intlayer login --env-file .env.production
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Login in Verbose Mode
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npx intlayer login --verbose
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Troubleshooting
|
|
121
|
+
|
|
122
|
+
### Browser Doesn't Open
|
|
123
|
+
|
|
124
|
+
If the browser doesn't open automatically, copy the URL displayed in the terminal and open it manually in your browser.
|
|
125
|
+
|
|
126
|
+
### Connection Issues
|
|
127
|
+
|
|
128
|
+
If you encounter connection issues, verify:
|
|
129
|
+
|
|
130
|
+
1. That the CMS URL is correct
|
|
131
|
+
2. That your internet connection is working properly
|
|
132
|
+
3. That there are no firewalls blocking the connection
|
|
133
|
+
|
|
134
|
+
### Credentials Not Received
|
|
135
|
+
|
|
136
|
+
If credentials are not received:
|
|
137
|
+
|
|
138
|
+
1. Make sure you completed the authentication process in the browser
|
|
139
|
+
2. Verify that the local port is not blocked
|
|
140
|
+
3. Try the command again
|
|
141
|
+
|
|
142
|
+
## Next Steps
|
|
143
|
+
|
|
144
|
+
After completing the login:
|
|
145
|
+
|
|
146
|
+
1. Add the credentials to your `.env` file
|
|
147
|
+
2. Configure your `intlayer.config.*` file with the credentials
|
|
148
|
+
3. Use CLI commands to manage your dictionaries:
|
|
149
|
+
- [`npx intlayer push`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/push.md) - Push dictionaries to the CMS
|
|
150
|
+
- [`npx intlayer pull`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/pull.md) - Pull dictionaries from the CMS
|
|
151
|
+
- [`npx intlayer fill`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/fill.md) - Fill missing translations
|
|
152
|
+
|
|
153
|
+
## See Also
|
|
154
|
+
|
|
155
|
+
- [CLI Documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/index.md)
|
|
156
|
+
- [Intlayer Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md)
|
|
157
|
+
- [Intlayer CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md)
|
package/docs/en/configuration.md
CHANGED
|
@@ -14,6 +14,9 @@ slugs:
|
|
|
14
14
|
- concept
|
|
15
15
|
- configuration
|
|
16
16
|
history:
|
|
17
|
+
- version: 7.5.0
|
|
18
|
+
date: 2025-12-17
|
|
19
|
+
changes: Add `buildMode` option
|
|
17
20
|
- version: 7.0.0
|
|
18
21
|
date: 2025-10-25
|
|
19
22
|
changes: Add `dictionary` configuration
|
|
@@ -103,6 +106,7 @@ const config: IntlayerConfig = {
|
|
|
103
106
|
applicationContext: "This is a test application",
|
|
104
107
|
},
|
|
105
108
|
build: {
|
|
109
|
+
mode: "auto",
|
|
106
110
|
importMode: "dynamic",
|
|
107
111
|
},
|
|
108
112
|
};
|
|
@@ -668,6 +672,15 @@ Build options apply to the `@intlayer/babel` and `@intlayer/swc` plugins.
|
|
|
668
672
|
|
|
669
673
|
#### Properties
|
|
670
674
|
|
|
675
|
+
- **mode**:
|
|
676
|
+
- _Type_: `'auto' | 'manual'`
|
|
677
|
+
- _Default_: `'auto'`
|
|
678
|
+
- _Description_: Controls the mode of the build.
|
|
679
|
+
- _Example_: `'manual'`
|
|
680
|
+
- _Note_: If 'auto', the build will be enabled automatically when the application is built.
|
|
681
|
+
- _Note_: If 'manual', the build will be set only when the build command is executed.
|
|
682
|
+
- _Note_: Can be used to disable dictionaries build, for instance when execution on Node.js environment should be avoided.
|
|
683
|
+
|
|
671
684
|
- **optimize**:
|
|
672
685
|
- _Type_: `boolean`
|
|
673
686
|
- _Default_: `undefined`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-02-07
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-12-13
|
|
4
4
|
title: Content File
|
|
5
5
|
description: Learn how to customize the extensions for your content declaration files. Follow this documentation to implement conditions efficiently in your project.
|
|
6
6
|
keywords:
|
|
@@ -12,6 +12,9 @@ slugs:
|
|
|
12
12
|
- concept
|
|
13
13
|
- content
|
|
14
14
|
history:
|
|
15
|
+
- version: 7.5.0
|
|
16
|
+
date: 2025-12-13
|
|
17
|
+
changes: Add ICU and i18next format support
|
|
15
18
|
- version: 7.0.0
|
|
16
19
|
date: 2025-10-23
|
|
17
20
|
changes: Rename `autoFill` to `fill`
|
|
@@ -387,6 +390,26 @@ Array of strings for categorizing and organizing dictionaries. Tags provide addi
|
|
|
387
390
|
}
|
|
388
391
|
```
|
|
389
392
|
|
|
393
|
+
#### `format` ('intlayer' | 'icu' | 'i18next')
|
|
394
|
+
|
|
395
|
+
Specifies the formatter to use for the dictionary content. This allows using different message formatting syntaxes.
|
|
396
|
+
|
|
397
|
+
- `'intlayer'`: The default Intlayer formatter.
|
|
398
|
+
- `'icu'`: Uses ICU message formatting.
|
|
399
|
+
- `'i18next'`: Uses i18next message formatting.
|
|
400
|
+
|
|
401
|
+
**Example:**
|
|
402
|
+
|
|
403
|
+
```typescript
|
|
404
|
+
{
|
|
405
|
+
key: "my-dictionary",
|
|
406
|
+
format: "icu",
|
|
407
|
+
content: {
|
|
408
|
+
message: "Hello {name}, you have {count, plural, one {# message} other {# messages}}"
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
```
|
|
412
|
+
|
|
390
413
|
#### `locale` (LocalesValues)
|
|
391
414
|
|
|
392
415
|
Transforms the dictionary into a per-locale dictionary where each field declared in the content will be automatically transformed into a translation node. When this property is set:
|
package/docs/en/index.md
CHANGED
|
@@ -98,6 +98,7 @@ We’ve built Intlayer with flexibility in mind, offering seamless integration a
|
|
|
98
98
|
- **[Intlayer with React CRA](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_create_react_app.md)**
|
|
99
99
|
- **[Intlayer with Vite + React](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_vite+react.md)**
|
|
100
100
|
- **[Intlayer with React Router v7](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_react_router_v7.md)**
|
|
101
|
+
- **[Intlayer with React Router v7 (fs routes)](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_react_router_v7_fs_routes.md)**
|
|
101
102
|
- **[Intlayer with Tanstack Start](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_tanstack.md)**
|
|
102
103
|
- **[Intlayer with React Native and Expo](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_react_native+expo.md)**
|
|
103
104
|
- **[Intlayer with Lynx and React](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_with_lynx+react.md)**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2024-03-07
|
|
3
3
|
updatedAt: 2025-10-03
|
|
4
4
|
title: How to translate your Astro app – i18n guide 2025
|
|
5
|
-
description: Learn how to add internationalization (i18n) to your
|
|
5
|
+
description: Learn how to add internationalization (i18n) to your Astro website using Intlayer. Follow this guide to make your site multilingual.
|
|
6
6
|
keywords:
|
|
7
7
|
- Internationalization
|
|
8
8
|
- Documentation
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2025-08-23
|
|
3
3
|
updatedAt: 2025-08-23
|
|
4
4
|
title: How to translate your Express backend – i18n guide 2025
|
|
5
|
-
description: Discover how to make your
|
|
5
|
+
description: Discover how to make your Express backend multilingual. Follow the documentation to internationalize (i18n) and translate it.
|
|
6
6
|
keywords:
|
|
7
7
|
- Internationalization
|
|
8
8
|
- Documentation
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2025-09-09
|
|
3
3
|
updatedAt: 2025-09-09
|
|
4
4
|
title: How to translate your Nest backend – i18n guide 2025
|
|
5
|
-
description: Discover how to make your
|
|
5
|
+
description: Discover how to make your NestJS backend multilingual. Follow the documentation to internationalize (i18n) and translate it.
|
|
6
6
|
keywords:
|
|
7
7
|
- Internationalization
|
|
8
8
|
- Documentation
|
|
@@ -15,7 +15,6 @@ slugs:
|
|
|
15
15
|
- environment
|
|
16
16
|
- nest
|
|
17
17
|
applicationTemplate: https://github.com/AydinTheFirst/nestjs-intlayer
|
|
18
|
-
author: AydinTheFirst
|
|
19
18
|
history:
|
|
20
19
|
- version: 5.8.0
|
|
21
20
|
date: 2025-09-09
|
|
@@ -220,17 +220,17 @@ const appContent = {
|
|
|
220
220
|
}),
|
|
221
221
|
},
|
|
222
222
|
meta: {
|
|
223
|
+
title: t({
|
|
224
|
+
en: "Welcome to Intlayer + TanStack Router",
|
|
225
|
+
es: "Bienvenido a Intlayer + TanStack Router",
|
|
226
|
+
fr: "Bienvenue à Intlayer + TanStack Router",
|
|
227
|
+
}),
|
|
223
228
|
description: t({
|
|
224
229
|
en: "This is an example of using Intlayer with TanStack Router",
|
|
225
230
|
es: "Este es un ejemplo de uso de Intlayer con TanStack Router",
|
|
226
231
|
fr: "Ceci est un exemple d'utilisation d'Intlayer avec TanStack Router",
|
|
227
232
|
}),
|
|
228
233
|
},
|
|
229
|
-
title: t({
|
|
230
|
-
en: "Welcome to Intlayer + TanStack Router",
|
|
231
|
-
es: "Bienvenido a Intlayer + TanStack Router",
|
|
232
|
-
fr: "Bienvenue à Intlayer + TanStack Router",
|
|
233
|
-
}),
|
|
234
234
|
},
|
|
235
235
|
key: "app",
|
|
236
236
|
} satisfies Dictionary;
|
|
@@ -512,10 +512,11 @@ function LayoutComponent() {
|
|
|
512
512
|
useI18nHTMLAttributes(); // add this line
|
|
513
513
|
|
|
514
514
|
const { locale } = Route.useParams();
|
|
515
|
+
const { defaultLocale } = useLocale();
|
|
515
516
|
|
|
516
517
|
return (
|
|
517
518
|
<IntlayerProvider
|
|
518
|
-
locale={locale} // If no locale included as a parameter, the default locale will be used
|
|
519
|
+
locale={locale ?? defaultLocale} // If no locale included as a parameter, the default locale will be used
|
|
519
520
|
>
|
|
520
521
|
<Outlet />
|
|
521
522
|
</IntlayerProvider>
|
|
@@ -645,17 +646,6 @@ export function NotFoundComponent() {
|
|
|
645
646
|
}
|
|
646
647
|
```
|
|
647
648
|
|
|
648
|
-
```tsx fileName="src/routes/__root.tsx"
|
|
649
|
-
import { createRootRoute } from "@tanstack/react-router";
|
|
650
|
-
|
|
651
|
-
// The root route serves as the top-level layout
|
|
652
|
-
// It doesn't handle 404s directly - that's delegated to child routes
|
|
653
|
-
// This keeps the root simple and lets locale-aware routes manage their own 404 logic
|
|
654
|
-
export const Route = createRootRoute({
|
|
655
|
-
component: Outlet,
|
|
656
|
-
});
|
|
657
|
-
```
|
|
658
|
-
|
|
659
649
|
```tsx fileName="src/routes/{-$locale}/route.tsx"
|
|
660
650
|
import { createFileRoute, Outlet, redirect } from "@tanstack/react-router";
|
|
661
651
|
import { validatePrefix } from "intlayer";
|