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.
Files changed (2) hide show
  1. package/README.md +12 -3
  2. 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. Read device locale from `Intl.DateTimeFormat().resolvedOptions().locale`
100
- 2. Extract language code (e.g. `'en'` from `'en-US'`)
101
- 3. If that language exists in `assets`, use it as initial locale
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "locon",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "locon is a simple and lightweight library for React Native that provides a simple way to manage translations in your app.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",