locon 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,10 +25,19 @@ npm install locon
|
|
|
25
25
|
yarn add locon
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
**Important:** After installation, run pod install for iOS:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
cd ios && pod install
|
|
32
|
+
```
|
|
33
|
+
|
|
28
34
|
**Peer dependencies**
|
|
29
35
|
|
|
30
36
|
- `react >= 19.0.0`
|
|
31
37
|
- `react-native >= 0.70.0`
|
|
38
|
+
- `react-native-localize >= 3.0.0` (installed automatically)
|
|
39
|
+
|
|
40
|
+
`react-native-localize` is used for accurate device language detection on iOS and Android.
|
|
32
41
|
|
|
33
42
|
---
|
|
34
43
|
|
|
@@ -96,9 +105,9 @@ export default App
|
|
|
96
105
|
If `currentLocale` is not provided and `autodetect` is `true` (default),
|
|
97
106
|
`locon` will:
|
|
98
107
|
|
|
99
|
-
1.
|
|
100
|
-
2.
|
|
101
|
-
3. If
|
|
108
|
+
1. Use `react-native-localize` to detect device locale on iOS/Android
|
|
109
|
+
2. Match the detected locale (including region) or just language code against your `assets`
|
|
110
|
+
3. If a match is found, use it as initial locale
|
|
102
111
|
4. Otherwise, fall back to `defaultLocale`
|
|
103
112
|
|
|
104
113
|
#### 3. Use the `useLocon()` hook
|
package/package.json
CHANGED