@umituz/react-native-localization 1.6.6 → 1.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-localization",
3
- "version": "1.6.6",
3
+ "version": "1.7.0",
4
4
  "description": "Universal localization system for React Native apps with i18n support",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -214,6 +214,9 @@ if (typeof global !== 'undefined' && !(global as any).__i18n_resources_logged) {
214
214
  }
215
215
  }
216
216
 
217
+ // Global flag to ensure initReactI18next is only used once
218
+ let reactI18nextInitialized = false;
219
+
217
220
  /**
218
221
  * Initialize i18next
219
222
  * CRITICAL: Check i18n.isInitialized to prevent multiple initializations
@@ -231,7 +234,13 @@ const initializeI18n = () => {
231
234
  throw new Error('initReactI18next is undefined');
232
235
  }
233
236
 
234
- i18n.use(initReactI18next).init({
237
+ // CRITICAL: Only use initReactI18next once (prevents context registration issues)
238
+ if (!reactI18nextInitialized) {
239
+ i18n.use(initReactI18next);
240
+ reactI18nextInitialized = true;
241
+ }
242
+
243
+ i18n.init({
235
244
  resources,
236
245
  lng: DEFAULT_LANGUAGE,
237
246
  fallbackLng: DEFAULT_LANGUAGE,