@intlayer/docs 9.0.0-canary.5 → 9.0.0-canary.6
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/docs/ar/intlayer_with_react_native+expo.md +56 -79
- package/docs/ar/packages/react-native-intlayer/exports.md +48 -14
- package/docs/de/intlayer_with_react_native+expo.md +50 -68
- package/docs/de/packages/react-native-intlayer/exports.md +47 -13
- package/docs/en/intlayer_with_react_native+expo.md +14 -18
- package/docs/en/packages/react-native-intlayer/exports.md +47 -13
- package/docs/en-GB/intlayer_with_react_native+expo.md +40 -94
- package/docs/en-GB/packages/react-native-intlayer/exports.md +51 -18
- package/docs/es/intlayer_with_react_native+expo.md +43 -80
- package/docs/es/packages/react-native-intlayer/exports.md +47 -13
- package/docs/fr/intlayer_with_react_native+expo.md +54 -68
- package/docs/fr/packages/react-native-intlayer/exports.md +47 -13
- package/docs/hi/intlayer_with_react_native+expo.md +90 -87
- package/docs/hi/packages/react-native-intlayer/exports.md +48 -14
- package/docs/id/intlayer_with_react_native+expo.md +45 -33
- package/docs/id/packages/react-native-intlayer/exports.md +47 -13
- package/docs/it/intlayer_with_react_native+expo.md +32 -72
- package/docs/it/packages/react-native-intlayer/exports.md +47 -13
- package/docs/ja/intlayer_with_react_native+expo.md +98 -137
- package/docs/ja/packages/react-native-intlayer/exports.md +47 -14
- package/docs/ko/intlayer_with_react_native+expo.md +231 -29
- package/docs/ko/packages/react-native-intlayer/exports.md +48 -14
- package/docs/pl/intlayer_with_react_native+expo.md +75 -46
- package/docs/pl/packages/react-native-intlayer/exports.md +47 -13
- package/docs/pt/intlayer_with_react_native+expo.md +38 -75
- package/docs/pt/packages/react-native-intlayer/exports.md +47 -13
- package/docs/ru/intlayer_with_react_native+expo.md +71 -60
- package/docs/ru/packages/react-native-intlayer/exports.md +49 -16
- package/docs/tr/intlayer_with_react_native+expo.md +30 -56
- package/docs/tr/packages/react-native-intlayer/exports.md +48 -15
- package/docs/uk/intlayer_with_react_native+expo.md +64 -52
- package/docs/uk/packages/react-native-intlayer/exports.md +47 -13
- package/docs/vi/intlayer_with_react_native+expo.md +43 -32
- package/docs/vi/packages/react-native-intlayer/exports.md +47 -13
- package/docs/zh/intlayer_with_react_native+expo.md +216 -82
- package/docs/zh/packages/react-native-intlayer/exports.md +48 -14
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-06-18
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-06-25
|
|
4
4
|
title: "Expo + React Native i18n - Vollständiger Leitfaden zur Übersetzung Ihrer App"
|
|
5
5
|
description: "Kein i18next mehr. Der 2026-Leitfaden zum Erstellen einer mehrsprachigen (i18n) Expo + React Native-App. Übersetzen Sie mit KI-Agenten und optimieren Sie Bundle-Größe, SEO und Performance."
|
|
6
6
|
keywords:
|
|
@@ -17,6 +17,9 @@ slugs:
|
|
|
17
17
|
applicationTemplate: https://github.com/aymericzip/intlayer-react-native-template
|
|
18
18
|
applicationShowcase: https://intlayer-react-native.vercel.app
|
|
19
19
|
history:
|
|
20
|
+
- version: 9.0.0
|
|
21
|
+
date: 2026-06-25
|
|
22
|
+
changes: "Provider und Hooks direkt aus react-native-intlayer importieren; react-intlayer wird nicht mehr als direkte Abhängigkeit benötigt"
|
|
20
23
|
- version: 8.9.0
|
|
21
24
|
date: 2026-05-04
|
|
22
25
|
changes: "Aktualisieren der Solid useIntlayer API-Nutzung auf direkten Eigenschaftszugriff"
|
|
@@ -37,7 +40,7 @@ author: aymericzip
|
|
|
37
40
|
<iframe
|
|
38
41
|
src="https://ide.intlayer.org/aymericzip/intlayer-react-native-template?file=intlayer.config.ts"
|
|
39
42
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
40
|
-
title="Demo CodeSandbox - Intlayer"
|
|
43
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
41
44
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
42
45
|
loading="lazy"
|
|
43
46
|
/>
|
|
@@ -56,11 +59,13 @@ author: aymericzip
|
|
|
56
59
|
</Tab>
|
|
57
60
|
</Tabs>
|
|
58
61
|
|
|
59
|
-
|
|
62
|
+
## Inhaltsverzeichnis
|
|
63
|
+
|
|
64
|
+
<TOC/>
|
|
60
65
|
|
|
61
66
|
## Warum Intlayer gegenüber Alternativen?
|
|
62
67
|
|
|
63
|
-
Im Vergleich zu Hauptlösungen wie „react-native-localize
|
|
68
|
+
Im Vergleich zu Hauptlösungen wie „react-native-localize" oder „i18next" ist Intlayer eine Lösung, die über integrierte Optimierungen verfügt wie:
|
|
64
69
|
|
|
65
70
|
<AccordionGroup>
|
|
66
71
|
|
|
@@ -96,7 +101,7 @@ Das Verbinden großer JSON-Dateien mit Komponenten kann zu Leistungs- und Reakti
|
|
|
96
101
|
|
|
97
102
|
<Accordion header="Skalierung mit Nicht-Entwickler">
|
|
98
103
|
|
|
99
|
-
Intlayer ist mehr als nur eine i18n-Lösung. Es bietet einen **selbstgehosteten [visuellen Editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md)** und ein **[vollständiges CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md)**, um Ihnen zu helfen
|
|
104
|
+
Intlayer ist mehr als nur eine i18n-Lösung. Es bietet einen **selbstgehosteten [visuellen Editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md)** und ein **[vollständiges CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md)**, um Ihnen zu helfen, Ihre mehrsprachigen Inhalte in **Echtzeit** zu verwalten und die Zusammenarbeit mit Übersetzern, Textern und anderen Teammitgliedern reibungslos zu gestalten. Inhalte können lokal und/oder remote gespeichert werden.
|
|
100
105
|
|
|
101
106
|
</Accordion>
|
|
102
107
|
|
|
@@ -115,65 +120,40 @@ Siehe [Anwendungsvorlage](https://github.com/aymericzip/intlayer-react-native-te
|
|
|
115
120
|
|
|
116
121
|
Installieren Sie aus Ihrem React Native-Projekt die folgenden Pakete:
|
|
117
122
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
Npx-Intlayer-Init
|
|
122
|
-
„
|
|
123
|
+
```bash packageManager="npm"
|
|
124
|
+
npx intlayer-cli init --interactive
|
|
125
|
+
```
|
|
123
126
|
|
|
124
|
-
|
|
125
|
-
pnpm
|
|
126
|
-
|
|
127
|
-
pnpm intlayer init
|
|
128
|
-
„
|
|
127
|
+
```bash packageManager="pnpm"
|
|
128
|
+
pnpm dlx intlayer-cli init --interactive
|
|
129
|
+
```
|
|
129
130
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
Garnzwischenschicht init
|
|
134
|
-
„
|
|
131
|
+
```bash packageManager="yarn"
|
|
132
|
+
yarn dlx intlayer-cli init --interactive
|
|
133
|
+
```
|
|
135
134
|
|
|
136
135
|
```bash packageManager="bun"
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
Brötchen x Zwischenschicht init
|
|
140
|
-
„
|
|
141
|
-
|
|
142
|
-
### Pakete
|
|
143
|
-
|
|
144
|
-
- **Zwischenschicht**
|
|
145
|
-
Das zentrale i18n-Toolkit für Konfiguration, Wörterbuchinhalt, Typgenerierung und CLI-Befehle.
|
|
146
|
-
|
|
147
|
-
- **react-intlayer**
|
|
148
|
-
React-Integration, die die Kontextanbieter und React-Hooks bereitstellt, die Sie in React Native zum Abrufen und Wechseln von Gebietsschemas verwenden.
|
|
149
|
-
|
|
150
|
-
- **react-native-intlayer**
|
|
151
|
-
React Native-Integration, die das Metro-Plugin für die Integration von Intlayer mit dem React Native-Bundler bereitstellt.
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
</Step>
|
|
156
|
-
|
|
157
|
-
<Step number={2} title="Abhängigkeiten installieren">
|
|
136
|
+
bunx intlayer-cli init --interactive
|
|
137
|
+
```
|
|
158
138
|
|
|
139
|
+
> Das Flag `--interactive` ist optional. Verwenden Sie `intlayer-cli init`, wenn Sie ein KI-Agent sind.
|
|
159
140
|
|
|
160
|
-
|
|
141
|
+
> Dieser Befehl erkennt Ihre Umgebung und installiert die erforderlichen Pakete. Zum Beispiel:
|
|
161
142
|
|
|
162
143
|
```bash packageManager="npm"
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
npm install --save-dev react-native-intlayer
|
|
166
|
-
````
|
|
144
|
+
npm install intlayer react-native-intlayer
|
|
145
|
+
```
|
|
167
146
|
|
|
168
147
|
```bash packageManager="pnpm"
|
|
169
|
-
pnpm add intlayer react-intlayer
|
|
170
|
-
pnpm add --save-dev react-native-intlayer
|
|
171
|
-
pnpm intlayer init
|
|
148
|
+
pnpm add intlayer react-native-intlayer
|
|
172
149
|
```
|
|
173
150
|
|
|
174
151
|
```bash packageManager="yarn"
|
|
175
|
-
yarn add intlayer react-intlayer
|
|
176
|
-
|
|
152
|
+
yarn add intlayer react-native-intlayer
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
```bash packageManager="bun"
|
|
156
|
+
bun add intlayer react-native-intlayer
|
|
177
157
|
```
|
|
178
158
|
|
|
179
159
|
### Pakete
|
|
@@ -181,17 +161,14 @@ yarn add --save-dev react-native-intlayer
|
|
|
181
161
|
- **intlayer**
|
|
182
162
|
Das Kern-i18n-Toolkit für Konfiguration, Wörterbuchinhalte, Typgenerierung und CLI-Befehle.
|
|
183
163
|
|
|
184
|
-
- **react-intlayer**
|
|
185
|
-
React-Integration, die die Context-Provider und React-Hooks bereitstellt, die Sie in React Native verwenden, um Lokalisierungen zu erhalten und zu wechseln.
|
|
186
|
-
|
|
187
164
|
- **react-native-intlayer**
|
|
188
|
-
React Native-Integration, die das Metro-Plugin
|
|
165
|
+
React Native-Integration, die die Kontext-Provider und React-Hooks bereitstellt, die Sie zum Abrufen und Wechseln von Lokalisierungen verwenden, die React Native-Polyfills sowie das Metro-Plugin für die Integration von Intlayer mit dem React Native-Bundler. Alle Exporte aus `react-intlayer` werden erneut exportiert, sodass Sie in einer React Native-App nur dieses eine Paket benötigen.
|
|
189
166
|
|
|
190
167
|
---
|
|
191
168
|
|
|
192
169
|
</Step>
|
|
193
170
|
|
|
194
|
-
<Step number={
|
|
171
|
+
<Step number={2} title="Erstellen Sie eine Intlayer-Konfiguration">
|
|
195
172
|
|
|
196
173
|
In Ihrem Projektstammverzeichnis (oder an einem beliebigen anderen Ort) erstellen Sie eine **Intlayer-Konfigurationsdatei**. Sie könnte wie folgt aussehen:
|
|
197
174
|
|
|
@@ -225,7 +202,7 @@ Innerhalb dieser Konfiguration können Sie:
|
|
|
225
202
|
|
|
226
203
|
</Step>
|
|
227
204
|
|
|
228
|
-
<Step number={
|
|
205
|
+
<Step number={3} title="Fügen Sie das Metro-Plugin hinzu">
|
|
229
206
|
|
|
230
207
|
Metro ist ein Bundler für React Native. Es ist der Standard-Bundler für React Native-Projekte, die mit dem Befehl `react-native init` erstellt wurden. Um Intlayer mit Metro zu verwenden, müssen Sie das Plugin zu Ihrer `metro.config.js`-Datei hinzufügen:
|
|
231
208
|
|
|
@@ -240,13 +217,18 @@ module.exports = (async () => {
|
|
|
240
217
|
})();
|
|
241
218
|
```
|
|
242
219
|
|
|
220
|
+
> Hinweis: `configMetroIntlayer` ist eine Promise-Funktion. Verwenden Sie stattdessen `configMetroIntlayerSync`, wenn Sie sie synchron verwenden möchten, oder vermeiden Sie IFFE (Immediately Invoked Function Expression).
|
|
221
|
+
> Hinweis: `configMetroIntlayerSync` erlaubt es nicht, Intlayer-Wörterbücher beim Serverstart zu erstellen.
|
|
222
|
+
|
|
243
223
|
</Step>
|
|
244
224
|
|
|
245
|
-
<Step number={
|
|
225
|
+
<Step number={4} title="Fügen Sie den Intlayer-Provider hinzu">
|
|
226
|
+
|
|
227
|
+
Um die Benutzersprache in Ihrer gesamten Anwendung synchron zu halten, müssen Sie Ihre Root-Komponente mit der `IntlayerProvider`-Komponente aus `react-native-intlayer` umschließen.
|
|
246
228
|
|
|
247
|
-
|
|
229
|
+
> Importieren Sie immer aus `react-native-intlayer`. Dessen `IntlayerProvider` enthält Polyfills für die von Intlayer verwendete Web-API, und das Paket exportiert alle Hooks und Utilities aus `react-intlayer` erneut.
|
|
248
230
|
|
|
249
|
-
|
|
231
|
+
Außerdem müssen Sie die Funktion `intlayerPolyfill` zu Ihrer `index.js`-Datei hinzufügen, um sicherzustellen, dass Intlayer ordnungsgemäß funktioniert.
|
|
250
232
|
|
|
251
233
|
```tsx fileName="app/_layout.tsx" codeFormat={["typescript", "esm"]}
|
|
252
234
|
import { Stack } from "expo-router";
|
|
@@ -271,7 +253,7 @@ export default RootLayout;
|
|
|
271
253
|
|
|
272
254
|
</Step>
|
|
273
255
|
|
|
274
|
-
<Step number={
|
|
256
|
+
<Step number={5} title="Deklarieren Sie Ihren Inhalt">
|
|
275
257
|
|
|
276
258
|
Erstellen Sie **Content-Deklarations**-Dateien an beliebiger Stelle in Ihrem Projekt (häufig innerhalb von `src/`), unter Verwendung eines der von Intlayer unterstützten Dateiendungen:
|
|
277
259
|
|
|
@@ -336,13 +318,13 @@ export default homeScreenContent;
|
|
|
336
318
|
}
|
|
337
319
|
```
|
|
338
320
|
|
|
339
|
-
> Für Details zu Inhaltsdeklarationen siehe [Intlayer
|
|
321
|
+
> Für Details zu Inhaltsdeklarationen siehe [Intlayer's Inhaltsdokumentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/de/dictionary/content_file.md).
|
|
340
322
|
|
|
341
323
|
---
|
|
342
324
|
|
|
343
325
|
</Step>
|
|
344
326
|
|
|
345
|
-
<Step number={
|
|
327
|
+
<Step number={6} title="Verwenden Sie Intlayer in Ihren Komponenten">
|
|
346
328
|
|
|
347
329
|
Verwenden Sie den `useIntlayer` Hook in untergeordneten Komponenten, um lokalisierten Inhalt zu erhalten.
|
|
348
330
|
|
|
@@ -350,7 +332,7 @@ Verwenden Sie den `useIntlayer` Hook in untergeordneten Komponenten, um lokalisi
|
|
|
350
332
|
|
|
351
333
|
```tsx fileName="app/(tabs)/index.tsx" codeFormat={["typescript", "esm"]}
|
|
352
334
|
import { Image, StyleSheet, Platform } from "react-native";
|
|
353
|
-
import { useIntlayer } from "intlayer";
|
|
335
|
+
import { useIntlayer } from "react-native-intlayer";
|
|
354
336
|
import { HelloWave } from "@/components/HelloWave";
|
|
355
337
|
import ParallaxScrollView from "@/components/ParallaxScrollView";
|
|
356
338
|
import { ThemedText } from "@/components/ThemedText";
|
|
@@ -397,7 +379,7 @@ export default HomeScreen;
|
|
|
397
379
|
|
|
398
380
|
</Step>
|
|
399
381
|
|
|
400
|
-
<Step number={
|
|
382
|
+
<Step number={7} title="Ändern der App-Sprache" isOptional={true}>
|
|
401
383
|
|
|
402
384
|
Um die Sprache innerhalb Ihrer Komponenten zu wechseln, können Sie die `setLocale`-Methode des `useLocale`-Hooks verwenden:
|
|
403
385
|
|
|
@@ -405,7 +387,7 @@ Um die Sprache innerhalb Ihrer Komponenten zu wechseln, können Sie die `setLoca
|
|
|
405
387
|
import { type FC } from "react";
|
|
406
388
|
import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
|
|
407
389
|
import { getLocaleName } from "intlayer";
|
|
408
|
-
import { useLocale } from "react-intlayer";
|
|
390
|
+
import { useLocale } from "react-native-intlayer";
|
|
409
391
|
|
|
410
392
|
export const LocaleSwitcher: FC = () => {
|
|
411
393
|
const { setLocale, availableLocales } = useLocale();
|
|
@@ -482,7 +464,7 @@ Dies ermöglicht Funktionen wie:
|
|
|
482
464
|
Um zu vermeiden, dass automatisch generierte Dateien von Intlayer committet werden, fügen Sie Folgendes zu Ihrer `.gitignore` hinzu:
|
|
483
465
|
|
|
484
466
|
```bash
|
|
485
|
-
#
|
|
467
|
+
# Ignoriere die von Intlayer generierten Dateien
|
|
486
468
|
.intlayer
|
|
487
469
|
```
|
|
488
470
|
|
|
@@ -523,7 +505,7 @@ Intlayer zielt hauptsächlich auf die Web Intl API ab; bei React Native müssen
|
|
|
523
505
|
|
|
524
506
|
Checkliste:
|
|
525
507
|
|
|
526
|
-
- Verwenden Sie die neuesten Versionen von `intlayer
|
|
508
|
+
- Verwenden Sie die neuesten Versionen von `intlayer` und `react-native-intlayer`.
|
|
527
509
|
- Aktivieren Sie das Intlayer Polyfill.
|
|
528
510
|
- Wenn Sie `getLocaleName` oder andere auf der Intl-API basierende Utilities verwenden, importieren Sie diese Polyfills frühzeitig (zum Beispiel in `index.js` oder `App.tsx`):
|
|
529
511
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2026-01-21
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-06-25
|
|
4
4
|
title: react-native-intlayer Paketdokumentation
|
|
5
|
-
description: React Native-Unterstützung für Intlayer, die Provider
|
|
5
|
+
description: React Native-Unterstützung für Intlayer, die Provider, Hooks, Polyfills und Metro-Konfiguration bereitstellt.
|
|
6
6
|
keywords:
|
|
7
7
|
- react-native-intlayer
|
|
8
8
|
- react-native
|
|
@@ -14,6 +14,9 @@ slugs:
|
|
|
14
14
|
- react-native-intlayer
|
|
15
15
|
- exports
|
|
16
16
|
history:
|
|
17
|
+
- version: 9.0.0
|
|
18
|
+
date: 2026-06-25
|
|
19
|
+
changes: "Vollständige react-intlayer-API (Hooks, Utilities, format/html/markdown-Unterpfade) erneut exportieren, sodass eine React Native-App nur von react-native-intlayer abhängt"
|
|
17
20
|
- version: 8.0.0
|
|
18
21
|
date: 2026-01-21
|
|
19
22
|
changes: "Vereinheitlichte Dokumentation für alle Exporte"
|
|
@@ -22,7 +25,9 @@ author: aymericzip
|
|
|
22
25
|
|
|
23
26
|
# react-native-intlayer-Paket
|
|
24
27
|
|
|
25
|
-
Das Paket `react-native-intlayer` stellt die notwendigen Werkzeuge bereit, um Intlayer in React Native-Anwendungen zu integrieren. Es
|
|
28
|
+
Das Paket `react-native-intlayer` stellt die notwendigen Werkzeuge bereit, um Intlayer in React Native-Anwendungen zu integrieren. Es exportiert die vollständige `react-intlayer`-API (Hooks und Utilities) erneut mit einem React Native-fähigen `IntlayerProvider` sowie den von React Native benötigten Polyfills und der Metro-Konfiguration.
|
|
29
|
+
|
|
30
|
+
> In einer React Native-App importieren Sie **alles** aus `react-native-intlayer`. Sie müssen `react-intlayer` nicht direkt installieren oder importieren.
|
|
26
31
|
|
|
27
32
|
## Installation
|
|
28
33
|
|
|
@@ -34,14 +39,30 @@ npm install react-native-intlayer
|
|
|
34
39
|
|
|
35
40
|
### Provider
|
|
36
41
|
|
|
37
|
-
| Komponente | Beschreibung
|
|
38
|
-
| ------------------ |
|
|
39
|
-
| `IntlayerProvider` | Provider-Komponente, die Ihre Anwendung umschließt und den Intlayer-Kontext bereitstellt. |
|
|
42
|
+
| Komponente | Beschreibung |
|
|
43
|
+
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
44
|
+
| `IntlayerProvider` | Provider-Komponente, die Ihre Anwendung umschließt und den Intlayer-Kontext bereitstellt. Wendet die erforderlichen Polyfills automatisch an. |
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import { IntlayerProvider } from "react-native-intlayer";
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Hooks und Utilities
|
|
51
|
+
|
|
52
|
+
Diese werden aus `react-intlayer` erneut exportiert, sodass Sie sie direkt aus `react-native-intlayer` importieren können:
|
|
40
53
|
|
|
41
|
-
|
|
54
|
+
| Export | Beschreibung |
|
|
55
|
+
| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
56
|
+
| `useIntlayer` | Auf lokalisierten Inhalt für einen Wörterbuchschlüssel zugreifen. |
|
|
57
|
+
| `useLocale` | Die aktuelle Spracheinstellung lesen und ändern. |
|
|
58
|
+
| `useDictionary`, `useDictionaryAsync`, `useDictionaryDynamic`, `useLoadDynamic` | Wörterbuchinhalte auf verschiedene Arten laden. |
|
|
59
|
+
| `useI18n` | i18next-kompatibler Hook. |
|
|
60
|
+
| `t` | Inline-Übersetzungshelfer. |
|
|
61
|
+
| `getIntlayer`, `getDictionary` | Imperative Inhalts-Getter. |
|
|
62
|
+
| `localeCookie`, `localeInStorage`, `setLocaleCookie`, `setLocaleInStorage`, `useLocaleCookie`, `useLocaleStorage` | Hilfsfunktionen zur Sprachpersistenz. |
|
|
42
63
|
|
|
43
64
|
```tsx
|
|
44
|
-
import "react-native-intlayer";
|
|
65
|
+
import { useIntlayer, useLocale, t } from "react-native-intlayer";
|
|
45
66
|
```
|
|
46
67
|
|
|
47
68
|
### Polyfill
|
|
@@ -50,10 +71,25 @@ import "react-native-intlayer";
|
|
|
50
71
|
| ------------------ | --------------------------------------------------------------------------------------------------- |
|
|
51
72
|
| `intlayerPolyfill` | Funktion, die die notwendigen Polyfills für React Native anwendet, damit Intlayer unterstützt wird. |
|
|
52
73
|
|
|
53
|
-
|
|
74
|
+
```tsx
|
|
75
|
+
import { intlayerPolyfill } from "react-native-intlayer";
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
> Der Polyfill wird automatisch angewendet, wenn Sie `IntlayerProvider` importieren. Rufen Sie `intlayerPolyfill` nur manuell auf, wenn Sie die Polyfills benötigen, bevor der Provider eingehängt wird.
|
|
79
|
+
|
|
80
|
+
### Formatierer
|
|
81
|
+
|
|
82
|
+
Hooks für die Zahlen-, Datums- und andere Intl-basierte Formatierung sind über den Unterpfad `/format` verfügbar:
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
import { useNumber, useDate } from "react-native-intlayer/format";
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Markdown- und HTML-Rendering
|
|
54
89
|
|
|
55
90
|
```tsx
|
|
56
|
-
import "react-native-intlayer";
|
|
91
|
+
import { MarkdownProvider } from "react-native-intlayer/markdown";
|
|
92
|
+
import { HTMLProvider } from "react-native-intlayer/html";
|
|
57
93
|
```
|
|
58
94
|
|
|
59
95
|
### Metro-Konfiguration
|
|
@@ -66,8 +102,6 @@ Das Paket `react-native-intlayer` stellt Metro-Konfigurationshilfsfunktionen ber
|
|
|
66
102
|
| `configMetroIntlayerSync` | Synchrone Funktion, die die Metro-Konfiguration zusammenführt, ohne Intlayer-Ressourcen vorzubereiten. |
|
|
67
103
|
| `exclusionList` | Erstellt ein RegExp-Muster für Metros blockList, um Inhaltsdateien vom Bundle auszuschließen. |
|
|
68
104
|
|
|
69
|
-
Import:
|
|
70
|
-
|
|
71
105
|
```tsx
|
|
72
|
-
import "react-native-intlayer/metro";
|
|
106
|
+
import { configMetroIntlayer } from "react-native-intlayer/metro";
|
|
73
107
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-06-18
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-06-25
|
|
4
4
|
title: "Expo + React Native i18n - Complete guide to translate your app"
|
|
5
5
|
description: "No more i18next. The 2026 guide to building a multilingual (i18n) Expo + React Native app. Translate with AI agents and optimize bundle size, SEO and performances."
|
|
6
6
|
keywords:
|
|
@@ -17,6 +17,9 @@ slugs:
|
|
|
17
17
|
applicationTemplate: https://github.com/aymericzip/intlayer-react-native-template
|
|
18
18
|
applicationShowcase: https://intlayer-react-native.vercel.app
|
|
19
19
|
history:
|
|
20
|
+
- version: 9.0.0
|
|
21
|
+
date: 2026-06-25
|
|
22
|
+
changes: "Import providers and hooks directly from react-native-intlayer; react-intlayer is no longer needed as a direct dependency"
|
|
20
23
|
- version: 8.9.0
|
|
21
24
|
date: 2026-05-04
|
|
22
25
|
changes: "Update Solid useIntlayer API usage to direct property access"
|
|
@@ -141,23 +144,19 @@ bunx intlayer-cli init --interactive
|
|
|
141
144
|
> This command will detect your environment and install the required packages. For example:
|
|
142
145
|
|
|
143
146
|
```bash packageManager="npm"
|
|
144
|
-
npm install intlayer react-intlayer
|
|
145
|
-
npm install --save-dev react-native-intlayer
|
|
147
|
+
npm install intlayer react-native-intlayer
|
|
146
148
|
```
|
|
147
149
|
|
|
148
150
|
```bash packageManager="pnpm"
|
|
149
|
-
pnpm add intlayer react-intlayer
|
|
150
|
-
pnpm add --save-dev react-native-intlayer
|
|
151
|
+
pnpm add intlayer react-native-intlayer
|
|
151
152
|
```
|
|
152
153
|
|
|
153
154
|
```bash packageManager="yarn"
|
|
154
|
-
yarn add intlayer react-intlayer
|
|
155
|
-
yarn add --save-dev react-native-intlayer
|
|
155
|
+
yarn add intlayer react-native-intlayer
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
```bash packageManager="bun"
|
|
159
|
-
bun add intlayer react-intlayer
|
|
160
|
-
bun add --dev react-native-intlayer
|
|
159
|
+
bun add intlayer react-native-intlayer
|
|
161
160
|
```
|
|
162
161
|
|
|
163
162
|
### Packages
|
|
@@ -165,11 +164,8 @@ bun add --dev react-native-intlayer
|
|
|
165
164
|
- **intlayer**
|
|
166
165
|
The core i18n toolkit for configuration, dictionary content, types generation, and CLI commands.
|
|
167
166
|
|
|
168
|
-
- **react-intlayer**
|
|
169
|
-
React integration that provides the context providers and React hooks you’ll use in React Native for obtaining and switching locales.
|
|
170
|
-
|
|
171
167
|
- **react-native-intlayer**
|
|
172
|
-
React Native integration that provides the Metro plugin for integrating Intlayer with the React Native bundler.
|
|
168
|
+
React Native integration that provides the context providers and React hooks you'll use to obtain and switch locales, the React Native polyfills, and the Metro plugin for integrating Intlayer with the React Native bundler. It re-exports everything from `react-intlayer`, so you only need this single package in a React Native app.
|
|
173
169
|
|
|
174
170
|
---
|
|
175
171
|
|
|
@@ -231,9 +227,9 @@ module.exports = (async () => {
|
|
|
231
227
|
|
|
232
228
|
<Step number={4} title="Add the Intlayer provider">
|
|
233
229
|
|
|
234
|
-
To keep synchronized the user language across your application, you need to wrap your root component with the `IntlayerProvider` component from `react-intlayer
|
|
230
|
+
To keep synchronized the user language across your application, you need to wrap your root component with the `IntlayerProvider` component from `react-native-intlayer`.
|
|
235
231
|
|
|
236
|
-
>
|
|
232
|
+
> Always import from `react-native-intlayer`. Its `IntlayerProvider` includes polyfills for the web API used by Intlayer, and the package re-exports all the hooks and utilities from `react-intlayer`.
|
|
237
233
|
|
|
238
234
|
Also, you need to add the `intlayerPolyfill` function to your `index.js` file to ensure that Intlayer can work properly.
|
|
239
235
|
|
|
@@ -339,7 +335,7 @@ Use the `useIntlayer` hook in child components to get localized content.
|
|
|
339
335
|
|
|
340
336
|
```tsx fileName="app/(tabs)/index.tsx" codeFormat={["typescript", "esm"]}
|
|
341
337
|
import { Image, StyleSheet, Platform } from "react-native";
|
|
342
|
-
import { useIntlayer } from "react-intlayer";
|
|
338
|
+
import { useIntlayer } from "react-native-intlayer";
|
|
343
339
|
import { HelloWave } from "@/components/HelloWave";
|
|
344
340
|
import ParallaxScrollView from "@/components/ParallaxScrollView";
|
|
345
341
|
import { ThemedText } from "@/components/ThemedText";
|
|
@@ -394,7 +390,7 @@ To switch locales from within your components, you can use the `useLocale` hook
|
|
|
394
390
|
import { type FC } from "react";
|
|
395
391
|
import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
|
|
396
392
|
import { getLocaleName } from "intlayer";
|
|
397
|
-
import { useLocale } from "react-intlayer";
|
|
393
|
+
import { useLocale } from "react-native-intlayer";
|
|
398
394
|
|
|
399
395
|
export const LocaleSwitcher: FC = () => {
|
|
400
396
|
const { setLocale, availableLocales } = useLocale();
|
|
@@ -512,7 +508,7 @@ Intlayer primarily targets the Web Intl API; on React Native you must include th
|
|
|
512
508
|
|
|
513
509
|
Checklist:
|
|
514
510
|
|
|
515
|
-
- Use the latest versions of `intlayer
|
|
511
|
+
- Use the latest versions of `intlayer` and `react-native-intlayer`.
|
|
516
512
|
- Enable the Intlayer polyfill.
|
|
517
513
|
- If you use `getLocaleName` or other Intl-API-based utilities, import these polyfills early (for example in `index.js` or `App.tsx`):
|
|
518
514
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2026-01-21
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-06-25
|
|
4
4
|
title: react-native-intlayer Package Documentation
|
|
5
|
-
description: React Native support for Intlayer, providing providers and
|
|
5
|
+
description: React Native support for Intlayer, providing providers, hooks, polyfills, and Metro configuration.
|
|
6
6
|
keywords:
|
|
7
7
|
- react-native-intlayer
|
|
8
8
|
- react-native
|
|
@@ -14,6 +14,9 @@ slugs:
|
|
|
14
14
|
- react-native-intlayer
|
|
15
15
|
- exports
|
|
16
16
|
history:
|
|
17
|
+
- version: 9.0.0
|
|
18
|
+
date: 2026-06-25
|
|
19
|
+
changes: "Re-export the full react-intlayer API (hooks, utilities, format/html/markdown subpaths) so a React Native app only depends on react-native-intlayer"
|
|
17
20
|
- version: 8.0.0
|
|
18
21
|
date: 2026-01-21
|
|
19
22
|
changes: "Unified documentation for all exports"
|
|
@@ -22,7 +25,9 @@ author: aymericzip
|
|
|
22
25
|
|
|
23
26
|
# react-native-intlayer Package
|
|
24
27
|
|
|
25
|
-
The `react-native-intlayer` package provides the necessary tools to integrate Intlayer into React Native applications. It
|
|
28
|
+
The `react-native-intlayer` package provides the necessary tools to integrate Intlayer into React Native applications. It re-exports the full `react-intlayer` API (hooks and utilities) with a React Native-ready `IntlayerProvider`, plus the polyfills and Metro configuration required by React Native.
|
|
29
|
+
|
|
30
|
+
> In a React Native app, import **everything** from `react-native-intlayer`. You do not need to install or import `react-intlayer` directly.
|
|
26
31
|
|
|
27
32
|
## Installation
|
|
28
33
|
|
|
@@ -34,14 +39,30 @@ npm install react-native-intlayer
|
|
|
34
39
|
|
|
35
40
|
### Provider
|
|
36
41
|
|
|
37
|
-
| Component | Description
|
|
38
|
-
| ------------------ |
|
|
39
|
-
| `IntlayerProvider` | Provider component that wraps your application and provides the Intlayer context. |
|
|
42
|
+
| Component | Description |
|
|
43
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
44
|
+
| `IntlayerProvider` | Provider component that wraps your application and provides the Intlayer context. Automatically applies the required polyfills. |
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import { IntlayerProvider } from "react-native-intlayer";
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Hooks and utilities
|
|
51
|
+
|
|
52
|
+
These are re-exported from `react-intlayer`, so you can import them straight from `react-native-intlayer`:
|
|
40
53
|
|
|
41
|
-
|
|
54
|
+
| Export | Description |
|
|
55
|
+
| ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
|
|
56
|
+
| `useIntlayer` | Access localized content for a dictionary key. |
|
|
57
|
+
| `useLocale` | Read and change the current locale. |
|
|
58
|
+
| `useDictionary`, `useDictionaryAsync`, `useDictionaryDynamic`, `useLoadDynamic` | Load dictionary content in various ways. |
|
|
59
|
+
| `useI18n` | i18next-compatible hook. |
|
|
60
|
+
| `t` | Inline translation helper. |
|
|
61
|
+
| `getIntlayer`, `getDictionary` | Imperative content getters. |
|
|
62
|
+
| `localeCookie`, `localeInStorage`, `setLocaleCookie`, `setLocaleInStorage`, `useLocaleCookie`, `useLocaleStorage` | Locale persistence helpers. |
|
|
42
63
|
|
|
43
64
|
```tsx
|
|
44
|
-
import "react-native-intlayer";
|
|
65
|
+
import { useIntlayer, useLocale, t } from "react-native-intlayer";
|
|
45
66
|
```
|
|
46
67
|
|
|
47
68
|
### Polyfill
|
|
@@ -50,10 +71,25 @@ import "react-native-intlayer";
|
|
|
50
71
|
| ------------------ | ------------------------------------------------------------------------------- |
|
|
51
72
|
| `intlayerPolyfill` | Function that applies necessary polyfills for React Native to support Intlayer. |
|
|
52
73
|
|
|
53
|
-
|
|
74
|
+
```tsx
|
|
75
|
+
import { intlayerPolyfill } from "react-native-intlayer";
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
> The polyfill is applied automatically when you import `IntlayerProvider`. Call `intlayerPolyfill` manually only if you need the polyfills before the provider mounts.
|
|
79
|
+
|
|
80
|
+
### Formatters
|
|
81
|
+
|
|
82
|
+
Number, date, and other Intl-based formatting hooks are available from the `/format` subpath:
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
import { useNumber, useDate } from "react-native-intlayer/format";
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Markdown and HTML rendering
|
|
54
89
|
|
|
55
90
|
```tsx
|
|
56
|
-
import "react-native-intlayer";
|
|
91
|
+
import { MarkdownProvider } from "react-native-intlayer/markdown";
|
|
92
|
+
import { HTMLProvider } from "react-native-intlayer/html";
|
|
57
93
|
```
|
|
58
94
|
|
|
59
95
|
### Metro Configuration
|
|
@@ -66,8 +102,6 @@ The `react-native-intlayer` package provides Metro configuration utilities to en
|
|
|
66
102
|
| `configMetroIntlayerSync` | Synchronous function that merges the Metro configuration without preparing Intlayer resources. |
|
|
67
103
|
| `exclusionList` | Creates a RegExp pattern for Metro's blockList to exclude content files from the bundle. |
|
|
68
104
|
|
|
69
|
-
Import:
|
|
70
|
-
|
|
71
105
|
```tsx
|
|
72
|
-
import "react-native-intlayer/metro";
|
|
106
|
+
import { configMetroIntlayer } from "react-native-intlayer/metro";
|
|
73
107
|
```
|