@intlayer/docs 5.5.8 → 5.5.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.
- package/ar/autoFill.md +1 -2
- package/ar/intlayer_with_create_react_app.md +1 -14
- package/ar/intlayer_with_nextjs_14.md +1 -14
- package/ar/intlayer_with_nextjs_15.md +1 -14
- package/ar/intlayer_with_nextjs_page_router.md +1 -13
- package/ar/intlayer_with_nuxt.md +792 -0
- package/ar/intlayer_with_react_native+expo.md +6 -3
- package/ar/intlayer_with_vite+preact.md +7 -18
- package/ar/intlayer_with_vite+react.md +7 -17
- package/ar/intlayer_with_vite+vue.md +25 -5
- package/ar/packages/nuxt-intlayer/index.md +29 -0
- package/ar/roadmap.md +11 -11
- package/de/autoFill.md +1 -2
- package/de/how_works_intlayer.md +1 -1
- package/de/intlayer_with_create_react_app.md +1 -14
- package/de/intlayer_with_nextjs_14.md +1 -14
- package/de/intlayer_with_nextjs_15.md +1 -14
- package/de/intlayer_with_nextjs_page_router.md +1 -13
- package/de/intlayer_with_nuxt.md +791 -0
- package/de/intlayer_with_react_native+expo.md +6 -3
- package/de/intlayer_with_vite+preact.md +7 -18
- package/de/intlayer_with_vite+react.md +7 -17
- package/de/intlayer_with_vite+vue.md +84 -62
- package/de/packages/nuxt-intlayer/index.md +29 -0
- package/de/roadmap.md +11 -11
- package/en/autoFill.md +1 -2
- package/en/how_works_intlayer.md +17 -3
- package/en/intlayer_with_angular.md +535 -6
- package/en/intlayer_with_create_react_app.md +1 -14
- package/en/intlayer_with_nextjs_14.md +193 -59
- package/en/intlayer_with_nextjs_15.md +192 -61
- package/en/intlayer_with_nextjs_page_router.md +396 -61
- package/en/intlayer_with_nuxt.md +737 -0
- package/en/intlayer_with_react_native+expo.md +6 -3
- package/en/intlayer_with_vite+preact.md +8 -27
- package/en/intlayer_with_vite+react.md +7 -17
- package/en/intlayer_with_vite+solid.md +6 -3
- package/en/intlayer_with_vite+svelte.md +6 -3
- package/en/intlayer_with_vite+vue.md +17 -6
- package/en/packages/nuxt-intlayer/index.md +31 -0
- package/en/roadmap.md +13 -13
- package/en/t.md +5 -5
- package/en-GB/how_works_intlayer.md +16 -4
- package/en-GB/intlayer_with_create_react_app.md +1 -14
- package/en-GB/intlayer_with_nextjs_14.md +1 -14
- package/en-GB/intlayer_with_nextjs_15.md +1 -14
- package/en-GB/intlayer_with_nextjs_page_router.md +1 -13
- package/en-GB/intlayer_with_nuxt.md +795 -0
- package/en-GB/intlayer_with_react_native+expo.md +6 -3
- package/en-GB/intlayer_with_vite+preact.md +7 -18
- package/en-GB/intlayer_with_vite+react.md +6 -9
- package/en-GB/intlayer_with_vite+vue.md +65 -59
- package/en-GB/packages/nuxt-intlayer/index.md +31 -0
- package/en-GB/roadmap.md +11 -11
- package/es/autoFill.md +1 -2
- package/es/how_works_intlayer.md +1 -1
- package/es/intlayer_with_create_react_app.md +1 -14
- package/es/intlayer_with_nextjs_14.md +1 -14
- package/es/intlayer_with_nextjs_15.md +1 -14
- package/es/intlayer_with_nextjs_page_router.md +1 -13
- package/es/intlayer_with_nuxt.md +731 -0
- package/es/intlayer_with_react_native+expo.md +6 -3
- package/es/intlayer_with_vite+preact.md +7 -18
- package/es/intlayer_with_vite+react.md +7 -17
- package/es/intlayer_with_vite+vue.md +64 -51
- package/es/packages/nuxt-intlayer/index.md +29 -0
- package/fr/autoFill.md +1 -2
- package/fr/how_works_intlayer.md +1 -1
- package/fr/intlayer_with_create_react_app.md +1 -14
- package/fr/intlayer_with_nextjs_14.md +1 -14
- package/fr/intlayer_with_nextjs_15.md +1 -14
- package/fr/intlayer_with_nextjs_page_router.md +1 -13
- package/fr/intlayer_with_nuxt.md +731 -0
- package/fr/intlayer_with_react_native+expo.md +6 -3
- package/fr/intlayer_with_vite+preact.md +7 -18
- package/fr/intlayer_with_vite+react.md +7 -17
- package/fr/intlayer_with_vite+vue.md +30 -15
- package/fr/packages/nuxt-intlayer/index.md +29 -0
- package/fr/roadmap.md +11 -11
- package/hi/autoFill.md +1 -2
- package/hi/how_works_intlayer.md +1 -1
- package/hi/intlayer_with_create_react_app.md +1 -14
- package/hi/intlayer_with_nextjs_14.md +1 -14
- package/hi/intlayer_with_nextjs_15.md +1 -14
- package/hi/intlayer_with_nextjs_page_router.md +1 -13
- package/hi/intlayer_with_nuxt.md +784 -0
- package/hi/intlayer_with_react_native+expo.md +6 -3
- package/hi/intlayer_with_vite+preact.md +7 -18
- package/hi/intlayer_with_vite+react.md +7 -17
- package/hi/intlayer_with_vite+vue.md +59 -47
- package/hi/packages/nuxt-intlayer/index.md +29 -0
- package/hi/roadmap.md +11 -11
- package/index.cjs +30 -0
- package/index.d.ts +2 -0
- package/it/autoFill.md +1 -2
- package/it/how_works_intlayer.md +1 -1
- package/it/intlayer_with_create_react_app.md +0 -6
- package/it/intlayer_with_nextjs_14.md +1 -14
- package/it/intlayer_with_nextjs_15.md +1 -14
- package/it/intlayer_with_nextjs_page_router.md +1 -13
- package/it/intlayer_with_nuxt.md +793 -0
- package/it/intlayer_with_react_native+expo.md +6 -3
- package/it/intlayer_with_vite+preact.md +7 -18
- package/it/intlayer_with_vite+react.md +7 -17
- package/it/intlayer_with_vite+vue.md +26 -17
- package/it/packages/nuxt-intlayer/index.md +29 -0
- package/it/roadmap.md +11 -11
- package/ja/autoFill.md +1 -2
- package/ja/how_works_intlayer.md +1 -1
- package/ja/intlayer_with_create_react_app.md +1 -14
- package/ja/intlayer_with_nextjs_14.md +1 -14
- package/ja/intlayer_with_nextjs_15.md +1 -14
- package/ja/intlayer_with_nextjs_page_router.md +1 -13
- package/ja/intlayer_with_nuxt.md +792 -0
- package/ja/intlayer_with_react_native+expo.md +6 -3
- package/ja/intlayer_with_vite+preact.md +7 -18
- package/ja/intlayer_with_vite+react.md +7 -17
- package/ja/intlayer_with_vite+vue.md +68 -63
- package/ja/packages/nuxt-intlayer/index.md +29 -0
- package/ja/roadmap.md +11 -11
- package/ko/autoFill.md +1 -2
- package/ko/how_works_intlayer.md +1 -1
- package/ko/intlayer_with_create_react_app.md +1 -14
- package/ko/intlayer_with_nextjs_14.md +1 -14
- package/ko/intlayer_with_nextjs_15.md +1 -14
- package/ko/intlayer_with_nextjs_page_router.md +1 -13
- package/ko/intlayer_with_nuxt.md +784 -0
- package/ko/intlayer_with_react_native+expo.md +6 -3
- package/ko/intlayer_with_vite+preact.md +7 -18
- package/ko/intlayer_with_vite+react.md +7 -17
- package/ko/intlayer_with_vite+vue.md +69 -59
- package/ko/packages/nuxt-intlayer/index.md +31 -0
- package/ko/roadmap.md +11 -11
- package/package.json +4 -4
- package/pt/autoFill.md +1 -2
- package/pt/how_works_intlayer.md +1 -1
- package/pt/intlayer_with_create_react_app.md +1 -14
- package/pt/intlayer_with_nextjs_14.md +1 -14
- package/pt/intlayer_with_nextjs_15.md +1 -14
- package/pt/intlayer_with_nextjs_page_router.md +1 -13
- package/pt/intlayer_with_nuxt.md +792 -0
- package/pt/intlayer_with_react_native+expo.md +6 -3
- package/pt/intlayer_with_vite+preact.md +7 -18
- package/pt/intlayer_with_vite+react.md +7 -17
- package/pt/intlayer_with_vite+vue.md +23 -19
- package/pt/packages/nuxt-intlayer/index.md +29 -0
- package/pt/roadmap.md +11 -11
- package/ru/autoFill.md +1 -2
- package/ru/how_works_intlayer.md +1 -1
- package/ru/intlayer_with_create_react_app.md +1 -14
- package/ru/intlayer_with_nextjs_14.md +1 -14
- package/ru/intlayer_with_nextjs_15.md +1 -14
- package/ru/intlayer_with_nextjs_page_router.md +1 -13
- package/ru/intlayer_with_nuxt.md +792 -0
- package/ru/intlayer_with_react_native+expo.md +6 -3
- package/ru/intlayer_with_vite+preact.md +7 -18
- package/ru/intlayer_with_vite+react.md +7 -17
- package/ru/intlayer_with_vite+vue.md +25 -17
- package/ru/packages/nuxt-intlayer/index.md +31 -0
- package/ru/roadmap.md +11 -11
- package/zh/autoFill.md +1 -2
- package/zh/intlayer_with_create_react_app.md +1 -14
- package/zh/intlayer_with_nextjs_14.md +1 -14
- package/zh/intlayer_with_nextjs_15.md +1 -14
- package/zh/intlayer_with_nextjs_page_router.md +1 -13
- package/zh/intlayer_with_nuxt.md +784 -0
- package/zh/intlayer_with_react_native+expo.md +6 -3
- package/zh/intlayer_with_vite+preact.md +7 -18
- package/zh/intlayer_with_vite+react.md +7 -17
- package/zh/intlayer_with_vite+vue.md +68 -57
- package/zh/packages/nuxt-intlayer/index.md +31 -0
- package/zh/roadmap.md +11 -11
|
@@ -0,0 +1,791 @@
|
|
|
1
|
+
# Erste Schritte mit der Internationalisierung (i18n) mit Intlayer und Nuxt
|
|
2
|
+
|
|
3
|
+
Siehe [Application Template](https://github.com/aymericzip/intlayer-nuxt-template) auf GitHub.
|
|
4
|
+
|
|
5
|
+
## Was ist Intlayer?
|
|
6
|
+
|
|
7
|
+
**Intlayer** ist eine innovative, Open-Source-Internationalisierungsbibliothek (i18n), die entwickelt wurde, um die Unterstützung mehrerer Sprachen in modernen Webanwendungen zu vereinfachen.
|
|
8
|
+
|
|
9
|
+
Mit Intlayer können Sie:
|
|
10
|
+
|
|
11
|
+
- **Übersetzungen einfach verwalten** durch deklarative Wörterbücher auf Komponentenebene.
|
|
12
|
+
- **Metadaten, Routen und Inhalte dynamisch lokalisieren**.
|
|
13
|
+
- **TypeScript-Unterstützung sicherstellen** mit automatisch generierten Typen, die die Autovervollständigung und Fehlererkennung verbessern.
|
|
14
|
+
- **Von erweiterten Funktionen profitieren**, wie dynamische Spracherkennung und -umschaltung.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Schritt-für-Schritt-Anleitung zur Einrichtung von Intlayer in einer Nuxt-Anwendung
|
|
19
|
+
|
|
20
|
+
### Schritt 1: Abhängigkeiten installieren
|
|
21
|
+
|
|
22
|
+
Installieren Sie die erforderlichen Pakete mit npm:
|
|
23
|
+
|
|
24
|
+
```bash packageManager="npm"
|
|
25
|
+
npm install intlayer vue-intlayer
|
|
26
|
+
npm install --save-dev nuxt-intlayer
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```bash packageManager="pnpm"
|
|
30
|
+
pnpm add intlayer vue-intlayer
|
|
31
|
+
pnpm add --save-dev nuxt-intlayer
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```bash packageManager="yarn"
|
|
35
|
+
yarn add intlayer vue-intlayer
|
|
36
|
+
yarn add --save-dev nuxt-intlayer
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- **intlayer**
|
|
40
|
+
|
|
41
|
+
Das Kernpaket, das Internationalisierungswerkzeuge für Konfigurationsmanagement, Übersetzung, [Inhaltsdeklaration](https://github.com/aymericzip/intlayer/blob/main/docs/de/dictionary/get_started.md), Transpilation und [CLI-Befehle](https://github.com/aymericzip/intlayer/blob/main/docs/de/intlayer_cli.md) bereitstellt.
|
|
42
|
+
|
|
43
|
+
- **vue-intlayer**
|
|
44
|
+
Das Paket, das Intlayer in Vue-Anwendungen integriert. Es bietet die Composables für die Vue-Komponenten.
|
|
45
|
+
|
|
46
|
+
- **nuxt-intlayer**
|
|
47
|
+
Das Nuxt-Modul, das Intlayer in Nuxt-Anwendungen integriert. Es bietet eine automatische Einrichtung, Middleware für die Spracherkennung, Cookie-Verwaltung und URL-Umleitung.
|
|
48
|
+
|
|
49
|
+
### Schritt 2: Konfiguration Ihres Projekts
|
|
50
|
+
|
|
51
|
+
Erstellen Sie eine Konfigurationsdatei, um die Sprachen Ihrer Anwendung zu konfigurieren:
|
|
52
|
+
|
|
53
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
54
|
+
import { Locales, type IntlayerConfig } from "intlayer";
|
|
55
|
+
|
|
56
|
+
const config: IntlayerConfig = {
|
|
57
|
+
internationalization: {
|
|
58
|
+
locales: [
|
|
59
|
+
Locales.ENGLISH,
|
|
60
|
+
Locales.FRENCH,
|
|
61
|
+
Locales.SPANISH,
|
|
62
|
+
// Ihre weiteren Sprachen
|
|
63
|
+
],
|
|
64
|
+
defaultLocale: Locales.ENGLISH,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default config;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
72
|
+
import { Locales } from "intlayer";
|
|
73
|
+
|
|
74
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
75
|
+
const config = {
|
|
76
|
+
internationalization: {
|
|
77
|
+
locales: [
|
|
78
|
+
Locales.ENGLISH,
|
|
79
|
+
Locales.FRENCH,
|
|
80
|
+
Locales.SPANISH,
|
|
81
|
+
// Ihre weiteren Sprachen
|
|
82
|
+
],
|
|
83
|
+
defaultLocale: Locales.ENGLISH,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export default config;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
91
|
+
const { Locales } = require("intlayer");
|
|
92
|
+
|
|
93
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
94
|
+
const config = {
|
|
95
|
+
internationalization: {
|
|
96
|
+
locales: [
|
|
97
|
+
Locales.ENGLISH,
|
|
98
|
+
Locales.FRENCH,
|
|
99
|
+
Locales.SPANISH,
|
|
100
|
+
// Ihre weiteren Sprachen
|
|
101
|
+
],
|
|
102
|
+
defaultLocale: Locales.ENGLISH,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
module.exports = config;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
> Über diese Konfigurationsdatei können Sie lokalisierte URLs, Middleware-Umleitungen, Cookie-Namen, den Speicherort und die Erweiterung Ihrer Inhaltsdeklarationen festlegen, Intlayer-Logs in der Konsole deaktivieren und mehr. Eine vollständige Liste der verfügbaren Parameter finden Sie in der [Konfigurationsdokumentation](https://github.com/aymericzip/intlayer/blob/main/docs/de/configuration.md).
|
|
110
|
+
|
|
111
|
+
### Schritt 3: Intlayer in Ihre Nuxt-Konfiguration integrieren
|
|
112
|
+
|
|
113
|
+
Fügen Sie das Intlayer-Modul zu Ihrer Nuxt-Konfiguration hinzu:
|
|
114
|
+
|
|
115
|
+
```typescript fileName="nuxt.config.ts"
|
|
116
|
+
import { defineNuxtConfig } from "nuxt/config";
|
|
117
|
+
|
|
118
|
+
export default defineNuxtConfig({
|
|
119
|
+
// ... Ihre bestehende Nuxt-Konfiguration
|
|
120
|
+
modules: ["nuxt-intlayer"],
|
|
121
|
+
});
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
> Das `nuxt-intlayer`-Modul übernimmt automatisch die Integration von Intlayer in Nuxt. Es richtet den Aufbau der Inhaltsdeklaration ein, überwacht Dateien im Entwicklungsmodus, bietet Middleware für die Spracherkennung und verwaltet lokalisierte Routen.
|
|
125
|
+
|
|
126
|
+
### Schritt 4: Ihre Inhalte deklarieren
|
|
127
|
+
|
|
128
|
+
Erstellen und verwalten Sie Ihre Inhaltsdeklarationen, um Übersetzungen zu speichern:
|
|
129
|
+
|
|
130
|
+
```tsx fileName="components/helloWorld.content.ts" contentDeclarationFormat="typescript"
|
|
131
|
+
import { t, type Dictionary } from "intlayer";
|
|
132
|
+
|
|
133
|
+
const helloWorldContent = {
|
|
134
|
+
key: "helloworld",
|
|
135
|
+
content: {
|
|
136
|
+
count: t({
|
|
137
|
+
de: "Anzahl ist ",
|
|
138
|
+
en: "count is ",
|
|
139
|
+
fr: "le compte est ",
|
|
140
|
+
es: "el recuento es ",
|
|
141
|
+
}),
|
|
142
|
+
edit: t({
|
|
143
|
+
de: "Bearbeiten Sie <code>components/HelloWorld.vue</code> und speichern Sie, um HMR zu testen",
|
|
144
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
145
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
146
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
147
|
+
}),
|
|
148
|
+
checkOut: t({
|
|
149
|
+
de: "Schauen Sie sich ",
|
|
150
|
+
en: "Check out ",
|
|
151
|
+
fr: "Vérifiez ",
|
|
152
|
+
es: "Compruebe ",
|
|
153
|
+
}),
|
|
154
|
+
nuxtIntlayer: t({
|
|
155
|
+
de: "Nuxt Intlayer Dokumentation",
|
|
156
|
+
en: "Nuxt Intlayer documentation",
|
|
157
|
+
fr: "Documentation de Nuxt Intlayer",
|
|
158
|
+
es: "Documentación de Nuxt Intlayer",
|
|
159
|
+
}),
|
|
160
|
+
learnMore: t({
|
|
161
|
+
de: "Erfahren Sie mehr über Nuxt in der ",
|
|
162
|
+
en: "Learn more about Nuxt in the ",
|
|
163
|
+
fr: "En savoir plus sur Nuxt dans la ",
|
|
164
|
+
es: "Aprenda más sobre Nuxt en la ",
|
|
165
|
+
}),
|
|
166
|
+
nuxtDocs: t({
|
|
167
|
+
de: "Nuxt Dokumentation",
|
|
168
|
+
en: "Nuxt Documentation",
|
|
169
|
+
fr: "Documentation Nuxt",
|
|
170
|
+
es: "Documentación de Nuxt",
|
|
171
|
+
}),
|
|
172
|
+
readTheDocs: t({
|
|
173
|
+
de: "Klicken Sie auf das Nuxt-Logo, um mehr zu erfahren",
|
|
174
|
+
en: "Click on the Nuxt logo to learn more",
|
|
175
|
+
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
176
|
+
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
177
|
+
}),
|
|
178
|
+
},
|
|
179
|
+
} satisfies Dictionary;
|
|
180
|
+
|
|
181
|
+
export default helloWorldContent;
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
```javascript fileName="components/helloWorld.content.mjs" contentDeclarationFormat="esm"
|
|
185
|
+
import { t } from "intlayer";
|
|
186
|
+
|
|
187
|
+
/** @type {import('intlayer').Dictionary} */
|
|
188
|
+
const helloWorldContent = {
|
|
189
|
+
key: "helloworld",
|
|
190
|
+
content: {
|
|
191
|
+
count: t({
|
|
192
|
+
de: "Anzahl ist ",
|
|
193
|
+
en: "count is ",
|
|
194
|
+
fr: "le compte est ",
|
|
195
|
+
es: "el recuento es ",
|
|
196
|
+
}),
|
|
197
|
+
edit: t({
|
|
198
|
+
de: "Bearbeiten Sie <code>components/HelloWorld.vue</code> und speichern Sie, um HMR zu testen",
|
|
199
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
200
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
201
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
202
|
+
}),
|
|
203
|
+
checkOut: t({
|
|
204
|
+
de: "Schauen Sie sich ",
|
|
205
|
+
en: "Check out ",
|
|
206
|
+
fr: "Vérifiez ",
|
|
207
|
+
es: "Compruebe ",
|
|
208
|
+
}),
|
|
209
|
+
nuxtIntlayer: t({
|
|
210
|
+
de: "Nuxt Intlayer Dokumentation",
|
|
211
|
+
en: "Nuxt Intlayer documentation",
|
|
212
|
+
fr: "Documentation de Nuxt Intlayer",
|
|
213
|
+
es: "Documentación de Nuxt Intlayer",
|
|
214
|
+
}),
|
|
215
|
+
learnMore: t({
|
|
216
|
+
de: "Erfahren Sie mehr über Nuxt in der ",
|
|
217
|
+
en: "Learn more about Nuxt in the ",
|
|
218
|
+
fr: "En savoir plus sur Nuxt dans la ",
|
|
219
|
+
es: "Aprenda más sobre Nuxt en la ",
|
|
220
|
+
}),
|
|
221
|
+
nuxtDocs: t({
|
|
222
|
+
de: "Nuxt Dokumentation",
|
|
223
|
+
en: "Nuxt Documentation",
|
|
224
|
+
fr: "Documentation Nuxt",
|
|
225
|
+
es: "Documentación de Nuxt",
|
|
226
|
+
}),
|
|
227
|
+
readTheDocs: t({
|
|
228
|
+
de: "Klicken Sie auf das Nuxt-Logo, um mehr zu erfahren",
|
|
229
|
+
en: "Click on the Nuxt logo to learn more",
|
|
230
|
+
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
231
|
+
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
232
|
+
}),
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export default helloWorldContent;
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
```javascript fileName="components/helloWorld.content.cjs" contentDeclarationFormat="commonjs"
|
|
240
|
+
const { t } = require("intlayer");
|
|
241
|
+
|
|
242
|
+
/** @type {import('intlayer').Dictionary} */
|
|
243
|
+
const helloWorldContent = {
|
|
244
|
+
key: "helloworld",
|
|
245
|
+
content: {
|
|
246
|
+
count: t({
|
|
247
|
+
de: "Anzahl ist ",
|
|
248
|
+
en: "count is ",
|
|
249
|
+
fr: "le compte est ",
|
|
250
|
+
es: "el recuento es ",
|
|
251
|
+
}),
|
|
252
|
+
edit: t({
|
|
253
|
+
de: "Bearbeiten Sie <code>components/HelloWorld.vue</code> und speichern Sie, um HMR zu testen",
|
|
254
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
255
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
256
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
257
|
+
}),
|
|
258
|
+
checkOut: t({
|
|
259
|
+
de: "Schauen Sie sich ",
|
|
260
|
+
en: "Check out ",
|
|
261
|
+
fr: "Vérifiez ",
|
|
262
|
+
es: "Compruebe ",
|
|
263
|
+
}),
|
|
264
|
+
nuxtIntlayer: t({
|
|
265
|
+
de: "Nuxt Intlayer Dokumentation",
|
|
266
|
+
en: "Nuxt Intlayer documentation",
|
|
267
|
+
fr: "Documentation de Nuxt Intlayer",
|
|
268
|
+
es: "Documentación de Nuxt Intlayer",
|
|
269
|
+
}),
|
|
270
|
+
learnMore: t({
|
|
271
|
+
de: "Erfahren Sie mehr über Nuxt in der ",
|
|
272
|
+
en: "Learn more about Nuxt in the ",
|
|
273
|
+
fr: "En savoir plus sur Nuxt dans la ",
|
|
274
|
+
es: "Aprenda más sobre Nuxt en la ",
|
|
275
|
+
}),
|
|
276
|
+
nuxtDocs: t({
|
|
277
|
+
de: "Nuxt Dokumentation",
|
|
278
|
+
en: "Nuxt Documentation",
|
|
279
|
+
fr: "Documentation Nuxt",
|
|
280
|
+
es: "Documentación de Nuxt",
|
|
281
|
+
}),
|
|
282
|
+
readTheDocs: t({
|
|
283
|
+
de: "Klicken Sie auf das Nuxt-Logo, um mehr zu erfahren",
|
|
284
|
+
en: "Click on the Nuxt logo to learn more",
|
|
285
|
+
fr: "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
286
|
+
es: "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
287
|
+
}),
|
|
288
|
+
},
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
module.exports = helloWorldContent;
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
```json5 fileName="components/helloWorld.content.json5"
|
|
295
|
+
{
|
|
296
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
297
|
+
"key": "helloworld",
|
|
298
|
+
"content": {
|
|
299
|
+
"count": {
|
|
300
|
+
"nodeType": "translation",
|
|
301
|
+
"translation": {
|
|
302
|
+
"de": "Anzahl ist ",
|
|
303
|
+
"en": "count is ",
|
|
304
|
+
"fr": "le compte est ",
|
|
305
|
+
"es": "el recuento es ",
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
"edit": {
|
|
309
|
+
"nodeType": "translation",
|
|
310
|
+
"translation": {
|
|
311
|
+
"de": "Bearbeiten Sie <code>components/HelloWorld.vue</code> und speichern Sie, um HMR zu testen",
|
|
312
|
+
"en": "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
313
|
+
"fr": "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
314
|
+
"es": "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
"checkOut": {
|
|
318
|
+
"nodeType": "translation",
|
|
319
|
+
"translation": {
|
|
320
|
+
"de": "Schauen Sie sich ",
|
|
321
|
+
"en": "Check out ",
|
|
322
|
+
"fr": "Vérifiez ",
|
|
323
|
+
"es": "Compruebe ",
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
"nuxtIntlayer": {
|
|
327
|
+
"nodeType": "translation",
|
|
328
|
+
"translation": {
|
|
329
|
+
"de": "Nuxt Intlayer Dokumentation",
|
|
330
|
+
"en": "Nuxt Intlayer documentation",
|
|
331
|
+
"fr": "Documentation de Nuxt Intlayer",
|
|
332
|
+
"es": "Documentación de Nuxt Intlayer",
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
"learnMore": {
|
|
336
|
+
"nodeType": "translation",
|
|
337
|
+
"translation": {
|
|
338
|
+
"de": "Erfahren Sie mehr über Nuxt in der ",
|
|
339
|
+
"en": "Learn more about Nuxt in the ",
|
|
340
|
+
"fr": "En savoir plus sur Nuxt dans la ",
|
|
341
|
+
"es": "Aprenda más sobre Nuxt en la ",
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
"nuxtDocs": {
|
|
345
|
+
"nodeType": "translation",
|
|
346
|
+
"translation": {
|
|
347
|
+
"de": "Nuxt Dokumentation",
|
|
348
|
+
"en": "Nuxt Documentation",
|
|
349
|
+
"fr": "Documentation Nuxt",
|
|
350
|
+
"es": "Documentación de Nuxt",
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
"readTheDocs": {
|
|
354
|
+
"nodeType": "translation",
|
|
355
|
+
"translation": {
|
|
356
|
+
"de": "Klicken Sie auf das Nuxt-Logo, um mehr zu erfahren",
|
|
357
|
+
"en": "Click on the Nuxt logo to learn more",
|
|
358
|
+
"fr": "Cliquez sur le logo Nuxt pour en savoir plus",
|
|
359
|
+
"es": "Haga clic en el logotipo de Nuxt para obtener más información",
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
}
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
> Ihre Inhaltsdeklarationen können überall in Ihrer Anwendung definiert werden, solange sie im `contentDir` Verzeichnis (standardmäßig `./src`) enthalten sind und der Dateierweiterung für Inhaltsdeklarationen entsprechen (standardmäßig `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
|
|
367
|
+
|
|
368
|
+
> Für weitere Details, lesen Sie die [Dokumentation zur Inhaltsdeklaration](https://github.com/aymericzip/intlayer/blob/main/docs/de/dictionary/get_started.md).
|
|
369
|
+
|
|
370
|
+
### Schritt 5: Verwenden Sie Intlayer in Ihrem Code
|
|
371
|
+
|
|
372
|
+
Greifen Sie in Ihrer Nuxt-Anwendung mit dem `useIntlayer` Composable auf Ihre Inhaltswörterbücher zu:
|
|
373
|
+
|
|
374
|
+
```vue fileName="components/HelloWorld.vue"
|
|
375
|
+
<script setup lang="ts">
|
|
376
|
+
import { ref } from "vue";
|
|
377
|
+
import { useIntlayer } from "vue-intlayer";
|
|
378
|
+
|
|
379
|
+
defineProps({
|
|
380
|
+
msg: String,
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
const {
|
|
384
|
+
count,
|
|
385
|
+
edit,
|
|
386
|
+
checkOut,
|
|
387
|
+
nuxtIntlayer,
|
|
388
|
+
learnMore,
|
|
389
|
+
nuxtDocs,
|
|
390
|
+
readTheDocs,
|
|
391
|
+
} = useIntlayer("helloworld");
|
|
392
|
+
const countRef = ref(0);
|
|
393
|
+
</script>
|
|
394
|
+
|
|
395
|
+
<template>
|
|
396
|
+
<h1>{{ msg }}</h1>
|
|
397
|
+
|
|
398
|
+
<div class="card">
|
|
399
|
+
<button type="button" @click="countRef++">
|
|
400
|
+
<count />
|
|
401
|
+
{{ countRef }}
|
|
402
|
+
</button>
|
|
403
|
+
<p v-html="edit"></p>
|
|
404
|
+
</div>
|
|
405
|
+
|
|
406
|
+
<p>
|
|
407
|
+
<checkOut />
|
|
408
|
+
<a href="https://nuxt.com/docs/getting-started/introduction" target="_blank"
|
|
409
|
+
>Nuxt</a
|
|
410
|
+
>, <nuxtIntlayer />
|
|
411
|
+
</p>
|
|
412
|
+
<p>
|
|
413
|
+
<learnMore />
|
|
414
|
+
<a href="https://nuxt.com" target="_blank"><nuxtDocs /></a>.
|
|
415
|
+
</p>
|
|
416
|
+
<p class="read-the-docs"><readTheDocs /></p>
|
|
417
|
+
<p class="read-the-docs">{{ readTheDocs }}</p>
|
|
418
|
+
</template>
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
#### Zugriff auf Inhalte in Intlayer
|
|
422
|
+
|
|
423
|
+
Intlayer bietet zwei APIs, um auf Ihre Inhalte zuzugreifen:
|
|
424
|
+
|
|
425
|
+
- **Komponentenbasierte Syntax** (empfohlen):
|
|
426
|
+
Verwenden Sie die `<myContent />` oder `<Component :is="myContent" />` Syntax, um Inhalte als Intlayer Node darzustellen. Dies integriert sich nahtlos mit dem [Visuellen Editor](https://github.com/aymericzip/intlayer/blob/main/docs/de/intlayer_visual_editor.md) und [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/de/intlayer_CMS.md).
|
|
427
|
+
|
|
428
|
+
- **String-basierte Syntax**:
|
|
429
|
+
Verwenden Sie `{{ myContent }}`, um den Inhalt als einfachen Text darzustellen, ohne Unterstützung für den visuellen Editor.
|
|
430
|
+
|
|
431
|
+
- **Roh-HTML-Syntax**:
|
|
432
|
+
Verwenden Sie `<div v-html="myContent" />`, um den Inhalt als Roh-HTML darzustellen, ohne Unterstützung für den visuellen Editor.
|
|
433
|
+
|
|
434
|
+
- **Destrukturierungssyntax**:
|
|
435
|
+
Das `useIntlayer` Composable gibt einen Proxy mit dem Inhalt zurück. Dieser Proxy kann destrukturiert werden, um auf den Inhalt zuzugreifen und dabei die Reaktivität zu bewahren.
|
|
436
|
+
- Verwenden Sie `const content = useIntlayer("myContent");` und `{{ content.myContent }}` / `<content.myContent />`.
|
|
437
|
+
- Oder verwenden Sie `const { myContent } = useIntlayer("myContent");` und `{{ myContent }}` / `<myContent/>`, um den Inhalt zu destrukturieren.
|
|
438
|
+
|
|
439
|
+
### (Optional) Schritt 6: Ändern Sie die Sprache Ihrer Inhalte
|
|
440
|
+
|
|
441
|
+
Um die Sprache Ihrer Inhalte zu ändern, können Sie die `setLocale` Funktion verwenden, die vom `useLocale` Composable bereitgestellt wird. Diese Funktion ermöglicht es Ihnen, die Sprache der Anwendung festzulegen und die Inhalte entsprechend zu aktualisieren.
|
|
442
|
+
|
|
443
|
+
Erstellen Sie eine Komponente, um zwischen Sprachen zu wechseln:
|
|
444
|
+
|
|
445
|
+
```vue fileName="components/LocaleSwitcher.vue"
|
|
446
|
+
<template>
|
|
447
|
+
<div class="locale-switcher">
|
|
448
|
+
<select v-model="selectedLocale" @change="changeLocale">
|
|
449
|
+
<option v-for="loc in availableLocales" :key="loc" :value="loc">
|
|
450
|
+
{{ getLocaleName(loc) }}
|
|
451
|
+
</option>
|
|
452
|
+
</select>
|
|
453
|
+
</div>
|
|
454
|
+
</template>
|
|
455
|
+
|
|
456
|
+
<script setup lang="ts">
|
|
457
|
+
import { ref, watch } from "vue";
|
|
458
|
+
import { getLocaleName } from "intlayer";
|
|
459
|
+
import { useLocale } from "vue-intlayer";
|
|
460
|
+
|
|
461
|
+
// Abrufen von Sprachinformationen und setLocale Funktion
|
|
462
|
+
const { locale, availableLocales, setLocale } = useLocale();
|
|
463
|
+
|
|
464
|
+
// Verfolgen der ausgewählten Sprache mit einem Ref
|
|
465
|
+
const selectedLocale = ref(locale.value);
|
|
466
|
+
|
|
467
|
+
// Aktualisieren der Sprache, wenn sich die Auswahl ändert
|
|
468
|
+
const changeLocale = () => setLocale(selectedLocale.value);
|
|
469
|
+
|
|
470
|
+
// Halten Sie selectedLocale mit der globalen Sprache synchron
|
|
471
|
+
watch(
|
|
472
|
+
() => locale.value,
|
|
473
|
+
(newLocale) => {
|
|
474
|
+
selectedLocale.value = newLocale;
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
</script>
|
|
478
|
+
</template>
|
|
479
|
+
|
|
480
|
+
<style scoped>
|
|
481
|
+
.locale-switcher {
|
|
482
|
+
margin: 1rem 0;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
select {
|
|
486
|
+
padding: 0.5rem;
|
|
487
|
+
border-radius: 0.25rem;
|
|
488
|
+
border: 1px solid #ccc;
|
|
489
|
+
}
|
|
490
|
+
</style>
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
Verwenden Sie diese Komponente dann in Ihren Seiten oder Ihrem Layout:
|
|
494
|
+
|
|
495
|
+
```vue fileName="app.vue"
|
|
496
|
+
<script setup lang="ts">
|
|
497
|
+
import { useIntlayer } from "vue-intlayer";
|
|
498
|
+
import LocaleSwitcher from "~/components/LocaleSwitcher.vue";
|
|
499
|
+
|
|
500
|
+
const content = useIntlayer("app"); // Erstellen Sie die zugehörige Intlayer-Deklarationsdatei
|
|
501
|
+
</script>
|
|
502
|
+
|
|
503
|
+
<template>
|
|
504
|
+
<div>
|
|
505
|
+
<header>
|
|
506
|
+
<LocaleSwitcher />
|
|
507
|
+
</header>
|
|
508
|
+
<main>
|
|
509
|
+
<NuxtPage />
|
|
510
|
+
</main>
|
|
511
|
+
</div>
|
|
512
|
+
</template>
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
### (Optional) Schritt 7: Lokalisierte Routen zu Ihrer Anwendung hinzufügen
|
|
516
|
+
|
|
517
|
+
Nuxt verwaltet automatisch lokalisierte Routen, wenn das `nuxt-intlayer` Modul verwendet wird. Dies erstellt automatisch Routen für jede Sprache basierend auf der Struktur Ihres Seitenverzeichnisses.
|
|
518
|
+
|
|
519
|
+
Beispiel:
|
|
520
|
+
|
|
521
|
+
```plaintext
|
|
522
|
+
pages/
|
|
523
|
+
├── index.vue → /, /de, /fr, /es
|
|
524
|
+
├── about.vue → /about, /de/about, /fr/about, /es/about
|
|
525
|
+
└── contact/
|
|
526
|
+
└── index.vue → /contact, /de/contact, /fr/contact, /es/contact
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
Um eine lokalisierte Seite zu erstellen, erstellen Sie einfach Ihre Vue-Dateien im `pages/` Verzeichnis:
|
|
530
|
+
|
|
531
|
+
```vue fileName="pages/about.vue"
|
|
532
|
+
<script setup lang="ts">
|
|
533
|
+
import { useIntlayer } from "vue-intlayer";
|
|
534
|
+
|
|
535
|
+
const content = useIntlayer("about");
|
|
536
|
+
</script>
|
|
537
|
+
|
|
538
|
+
<template>
|
|
539
|
+
<div>
|
|
540
|
+
<h1>{{ content.title }}</h1>
|
|
541
|
+
<p>{{ content.description }}</p>
|
|
542
|
+
</div>
|
|
543
|
+
</template>
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
Das `nuxt-intlayer` Modul wird automatisch:
|
|
547
|
+
|
|
548
|
+
- Die bevorzugte Sprache des Benutzers erkennen
|
|
549
|
+
- Sprachwechsel über die URL verwalten
|
|
550
|
+
- Das entsprechende `<html lang="">` Attribut setzen
|
|
551
|
+
- Sprach-Cookies verwalten
|
|
552
|
+
- Benutzer zur entsprechenden lokalisierten URL weiterleiten
|
|
553
|
+
|
|
554
|
+
### (Optional) Schritt 8: Erstellen einer lokalisierten Link-Komponente
|
|
555
|
+
|
|
556
|
+
Um sicherzustellen, dass die Navigation Ihrer Anwendung die aktuelle Sprache berücksichtigt, können Sie eine benutzerdefinierte `LocalizedLink` Komponente erstellen. Diese Komponente fügt automatisch interne URLs mit der aktuellen Sprache vor.
|
|
557
|
+
|
|
558
|
+
```vue fileName="components/LocalizedLink.vue"
|
|
559
|
+
<template>
|
|
560
|
+
<NuxtLink :to="localizedHref" v-bind="$attrs">
|
|
561
|
+
<slot />
|
|
562
|
+
</NuxtLink>
|
|
563
|
+
</template>
|
|
564
|
+
|
|
565
|
+
<script setup lang="ts">
|
|
566
|
+
import { computed } from "vue";
|
|
567
|
+
import { getLocalizedUrl } from "intlayer";
|
|
568
|
+
import { useLocale } from "vue-intlayer";
|
|
569
|
+
|
|
570
|
+
const props = defineProps({
|
|
571
|
+
to: {
|
|
572
|
+
type: String,
|
|
573
|
+
required: true,
|
|
574
|
+
},
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
const { locale } = useLocale();
|
|
578
|
+
|
|
579
|
+
// Prüfen, ob der Link extern ist
|
|
580
|
+
const isExternalLink = computed(() => /^https?:\/\//.test(props.to || ""));
|
|
581
|
+
|
|
582
|
+
// Erstellen eines lokalisierten href für interne Links
|
|
583
|
+
const localizedHref = computed(() =>
|
|
584
|
+
isExternalLink.value ? props.to : getLocalizedUrl(props.to, locale.value)
|
|
585
|
+
);
|
|
586
|
+
</script>
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
Verwenden Sie diese Komponente dann in Ihrer gesamten Anwendung:
|
|
590
|
+
|
|
591
|
+
```vue fileName="pages/index.vue"
|
|
592
|
+
<template>
|
|
593
|
+
<div>
|
|
594
|
+
<LocalizedLink to="/about">
|
|
595
|
+
{{ content.aboutLink }}
|
|
596
|
+
</LocalizedLink>
|
|
597
|
+
|
|
598
|
+
{{ content.contactLink }}
|
|
599
|
+
</LocalizedLink>
|
|
600
|
+
</div>
|
|
601
|
+
</template>
|
|
602
|
+
|
|
603
|
+
<script setup lang="ts">
|
|
604
|
+
import { useIntlayer } from "vue-intlayer";
|
|
605
|
+
import LocalizedLink from "~/components/LocalizedLink.vue";
|
|
606
|
+
|
|
607
|
+
const content = useIntlayer("home");
|
|
608
|
+
</script>
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
### (Optional) Schritt 9: Metadaten und SEO verwalten
|
|
612
|
+
|
|
613
|
+
Nuxt bietet hervorragende SEO-Funktionen. Sie können Intlayer verwenden, um lokalisierte Metadaten zu verwalten:
|
|
614
|
+
|
|
615
|
+
```vue fileName="pages/about.vue"
|
|
616
|
+
<script setup lang="ts">
|
|
617
|
+
import { useSeoMeta } from "nuxt/app";
|
|
618
|
+
import { getIntlayer } from "intlayer";
|
|
619
|
+
import { useLocale } from "vue-intlayer";
|
|
620
|
+
|
|
621
|
+
const { locale } = useLocale();
|
|
622
|
+
const content = getIntlayer("about-meta", locale.value);
|
|
623
|
+
|
|
624
|
+
useSeoMeta({
|
|
625
|
+
title: content.title,
|
|
626
|
+
description: content.description,
|
|
627
|
+
});
|
|
628
|
+
</script>
|
|
629
|
+
|
|
630
|
+
<template>
|
|
631
|
+
<div>
|
|
632
|
+
<h1>{{ content.pageTitle }}</h1>
|
|
633
|
+
<p>{{ content.pageContent }}</p>
|
|
634
|
+
</div>
|
|
635
|
+
</template>
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
Erstellen Sie die entsprechende Inhaltsdeklaration:
|
|
639
|
+
|
|
640
|
+
```typescript fileName="pages/about-meta.content.ts" contentDeclarationFormat="typescript"
|
|
641
|
+
import { t, type Dictionary } from "intlayer";
|
|
642
|
+
import type { useSeoMeta } from "nuxt/app";
|
|
643
|
+
|
|
644
|
+
const aboutMetaContent = {
|
|
645
|
+
key: "about-meta",
|
|
646
|
+
content: {
|
|
647
|
+
title: t({
|
|
648
|
+
de: "Über Uns - Mein Unternehmen",
|
|
649
|
+
en: "About Us - My Company",
|
|
650
|
+
fr: "À Propos - Ma Société",
|
|
651
|
+
es: "Acerca de Nosotros - Mi Empresa",
|
|
652
|
+
}),
|
|
653
|
+
description: t({
|
|
654
|
+
de: "Erfahren Sie mehr über unser Unternehmen und unsere Mission",
|
|
655
|
+
en: "Learn more about our company and our mission",
|
|
656
|
+
fr: "En savoir plus sur notre société et notre mission",
|
|
657
|
+
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
658
|
+
}),
|
|
659
|
+
},
|
|
660
|
+
} satisfies Dictionary<Parameters<typeof useSeoMeta>[0]>;
|
|
661
|
+
|
|
662
|
+
export default aboutMetaContent;
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
```typescript fileName="pages/about-meta.content.mjs" contentDeclarationFormat="esm"
|
|
666
|
+
import { t } from "intlayer";
|
|
667
|
+
|
|
668
|
+
/** @type {import('intlayer').Dictionary} */
|
|
669
|
+
const aboutMetaContent = {
|
|
670
|
+
key: "about-meta",
|
|
671
|
+
content: {
|
|
672
|
+
title: t({
|
|
673
|
+
de: "Über Uns - Mein Unternehmen",
|
|
674
|
+
en: "About Us - My Company",
|
|
675
|
+
fr: "À Propos - Ma Société",
|
|
676
|
+
es: "Acerca de Nosotros - Mi Empresa",
|
|
677
|
+
}),
|
|
678
|
+
description: t({
|
|
679
|
+
de: "Erfahren Sie mehr über unser Unternehmen und unsere Mission",
|
|
680
|
+
en: "Learn more about our company and our mission",
|
|
681
|
+
fr: "En savoir plus sur notre société et notre mission",
|
|
682
|
+
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
683
|
+
}),
|
|
684
|
+
},
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
export default aboutMetaContent;
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
```typescript fileName="pages/about-meta.content.js" contentDeclarationFormat="cjs"
|
|
691
|
+
const { t } = require("intlayer");
|
|
692
|
+
|
|
693
|
+
/** @type {import('intlayer').Dictionary} */
|
|
694
|
+
const aboutMetaContent = {
|
|
695
|
+
key: "about-meta",
|
|
696
|
+
content: {
|
|
697
|
+
title: t({
|
|
698
|
+
de: "Über Uns - Mein Unternehmen",
|
|
699
|
+
en: "About Us - My Company",
|
|
700
|
+
fr: "À Propos - Ma Société",
|
|
701
|
+
es: "Acerca de Nosotros - Mi Empresa",
|
|
702
|
+
}),
|
|
703
|
+
description: t({
|
|
704
|
+
de: "Erfahren Sie mehr über unser Unternehmen und unsere Mission",
|
|
705
|
+
en: "Learn more about our company and our mission",
|
|
706
|
+
fr: "En savoir plus sur notre société et notre mission",
|
|
707
|
+
es: "Conozca más sobre nuestra empresa y nuestra misión",
|
|
708
|
+
}),
|
|
709
|
+
},
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
module.exports = aboutMetaContent;
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
```json fileName="pages/about-meta.content.json" contentDeclarationFormat="json"
|
|
716
|
+
{
|
|
717
|
+
"key": "about-meta",
|
|
718
|
+
"content": {
|
|
719
|
+
"title": {
|
|
720
|
+
"nodeType": "translation",
|
|
721
|
+
"translations": {
|
|
722
|
+
"de": "Über Uns - Mein Unternehmen",
|
|
723
|
+
"en": "About Us - My Company",
|
|
724
|
+
"fr": "À Propos - Ma Société",
|
|
725
|
+
"es": "Acerca de Nosotros - Mi Empresa"
|
|
726
|
+
}
|
|
727
|
+
},
|
|
728
|
+
"description": {
|
|
729
|
+
"nodeType": "translation",
|
|
730
|
+
"translations": {
|
|
731
|
+
"de": "Erfahren Sie mehr über unser Unternehmen und unsere Mission",
|
|
732
|
+
"en": "Learn more about our company and our mission",
|
|
733
|
+
"fr": "En savoir plus sur notre société et notre mission",
|
|
734
|
+
"es": "Conozca más sobre nuestra empresa y nuestra misión"
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
### TypeScript konfigurieren
|
|
742
|
+
|
|
743
|
+
Intlayer verwendet Modulerweiterung, um die Vorteile von TypeScript zu nutzen und Ihre Codebasis robuster zu machen.
|
|
744
|
+
|
|
745
|
+

|
|
746
|
+
|
|
747
|
+

|
|
748
|
+
|
|
749
|
+
Stellen Sie sicher, dass Ihre TypeScript-Konfiguration die automatisch generierten Typen enthält.
|
|
750
|
+
|
|
751
|
+
```json5 fileName="tsconfig.json"
|
|
752
|
+
{
|
|
753
|
+
// ... Ihre bestehenden TypeScript-Konfigurationen
|
|
754
|
+
"include": [
|
|
755
|
+
// ... Ihre bestehenden TypeScript-Konfigurationen
|
|
756
|
+
".intlayer/**/*.ts", // Schließen Sie die automatisch generierten Typen ein
|
|
757
|
+
],
|
|
758
|
+
}
|
|
759
|
+
```
|
|
760
|
+
|
|
761
|
+
### Git-Konfiguration
|
|
762
|
+
|
|
763
|
+
Es wird empfohlen, die von Intlayer generierten Dateien zu ignorieren. Dies ermöglicht es Ihnen, zu vermeiden, diese in Ihr Git-Repository einzuchecken.
|
|
764
|
+
|
|
765
|
+
Fügen Sie dazu die folgenden Anweisungen zu Ihrer `.gitignore`-Datei hinzu:
|
|
766
|
+
|
|
767
|
+
```plaintext fileName=".gitignore"
|
|
768
|
+
# Ignorieren Sie die von Intlayer generierten Dateien
|
|
769
|
+
.intlayer
|
|
770
|
+
```
|
|
771
|
+
|
|
772
|
+
### VS Code Erweiterung
|
|
773
|
+
|
|
774
|
+
Um Ihre Entwicklungserfahrung mit Intlayer zu verbessern, können Sie die offizielle **Intlayer VS Code Erweiterung** installieren.
|
|
775
|
+
|
|
776
|
+
[Installieren Sie sie aus dem VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
|
|
777
|
+
|
|
778
|
+
Diese Erweiterung bietet:
|
|
779
|
+
|
|
780
|
+
- **Autovervollständigung** für Übersetzungsschlüssel.
|
|
781
|
+
- **Echtzeit-Fehlererkennung** für fehlende Übersetzungen.
|
|
782
|
+
- **Inline-Vorschauen** von übersetzten Inhalten.
|
|
783
|
+
- **Schnellaktionen**, um Übersetzungen einfach zu erstellen und zu aktualisieren.
|
|
784
|
+
|
|
785
|
+
Weitere Details zur Verwendung der Erweiterung finden Sie in der [Intlayer VS Code Erweiterungsdokumentation](https://intlayer.org/doc/vs-code-extension).
|
|
786
|
+
|
|
787
|
+
---
|
|
788
|
+
|
|
789
|
+
### Weiterführende Schritte
|
|
790
|
+
|
|
791
|
+
Um weiterzugehen, können Sie den [visuellen Editor](https://github.com/aymericzip/intlayer/blob/main/docs/de/intlayer_visual_editor.md) implementieren oder Ihre Inhalte mit dem [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/de/intlayer_CMS.md) auslagern.
|