@umituz/react-native-localization 1.5.3 → 1.5.4
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
|
@@ -197,6 +197,16 @@ const buildResources = (): Record<string, { translation: any }> => {
|
|
|
197
197
|
|
|
198
198
|
const resources = buildResources();
|
|
199
199
|
|
|
200
|
+
// Debug: Log loaded resources in development
|
|
201
|
+
/* eslint-disable-next-line no-console */
|
|
202
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
203
|
+
console.log('🌍 i18n Resources loaded:', {
|
|
204
|
+
languages: Object.keys(resources),
|
|
205
|
+
enUSKeys: resources['en-US']?.translation ? Object.keys(resources['en-US'].translation) : [],
|
|
206
|
+
hasGoals: !!resources['en-US']?.translation?.goals,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
|
|
200
210
|
/**
|
|
201
211
|
* Initialize i18next
|
|
202
212
|
* Deferred initialization to avoid React Native renderer conflicts
|
|
@@ -228,10 +238,27 @@ const initializeI18n = () => {
|
|
|
228
238
|
compatibilityJSON: 'v3', // Use v3 format for React Native (no Intl.PluralRules support)
|
|
229
239
|
pluralSeparator: '_', // Use underscore separator for plural keys
|
|
230
240
|
keySeparator: '.', // Use dot separator for nested keys
|
|
241
|
+
|
|
242
|
+
// Debug options
|
|
243
|
+
debug: typeof __DEV__ !== 'undefined' && __DEV__,
|
|
231
244
|
});
|
|
232
245
|
|
|
233
246
|
isInitialized = true;
|
|
247
|
+
|
|
248
|
+
// Debug: Verify initialization
|
|
249
|
+
/* eslint-disable-next-line no-console */
|
|
250
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
251
|
+
console.log('✅ i18n initialized:', {
|
|
252
|
+
language: i18n.language,
|
|
253
|
+
hasResource: !!i18n.getResourceBundle(i18n.language, 'translation'),
|
|
254
|
+
goalsTitle: i18n.t('goals.list.title', { defaultValue: 'NOT_FOUND' }),
|
|
255
|
+
});
|
|
256
|
+
}
|
|
234
257
|
} catch (error) {
|
|
258
|
+
/* eslint-disable-next-line no-console */
|
|
259
|
+
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
260
|
+
console.error('❌ i18n initialization error:', error);
|
|
261
|
+
}
|
|
235
262
|
// Don't throw - allow app to continue without i18n
|
|
236
263
|
}
|
|
237
264
|
};
|