@umituz/react-native-localization 3.5.29 → 3.5.30

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": "3.5.29",
3
+ "version": "3.5.30",
4
4
  "description": "Generic localization system for React Native apps with i18n support",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -47,15 +47,13 @@ const LANGUAGE_MAP = {
47
47
  };
48
48
 
49
49
  const SKIP_WORDS = new Set([
50
- 'OK',
51
- 'Email',
52
50
  'Google',
53
51
  'Apple',
54
52
  'Facebook',
55
- 'Premium',
56
- 'Pro',
57
- 'Plus',
58
- 'BPM',
53
+ 'Instagram',
54
+ 'Twitter',
55
+ 'YouTube',
56
+ 'WhatsApp',
59
57
  ]);
60
58
 
61
59
  const LANGUAGE_NAMES = {
@@ -76,9 +76,17 @@ async function translateObject(enObj, targetObj, targetLang, path = '', stats =
76
76
  const isNewKey = targetObj[key][i] === enValue[i];
77
77
  const prefix = isNewKey ? '🆕 NEW' : '🔄';
78
78
  console.log(` ${prefix} ${currentPath}[${i}]: "${preview}"`);
79
- targetObj[key][i] = await translateText(enValue[i], targetLang);
80
- stats.count++;
81
- if (isNewKey) stats.newKeys.push(`${currentPath}[${i}]`);
79
+
80
+ const translated = await translateText(enValue[i], targetLang);
81
+
82
+ if (translated !== enValue[i]) {
83
+ targetObj[key][i] = translated;
84
+ stats.count++;
85
+ if (isNewKey) stats.newKeys.push(`${currentPath}[${i}]`);
86
+ } else {
87
+ console.log(` ⏭️ Skipped (universal word): ${currentPath}[${i}]`);
88
+ }
89
+
82
90
  await delay(200);
83
91
  }
84
92
  }
@@ -94,9 +102,17 @@ async function translateObject(enObj, targetObj, targetLang, path = '', stats =
94
102
  const isNewKey = targetValue === enValue;
95
103
  const prefix = isNewKey ? '🆕 NEW' : '🔄';
96
104
  console.log(` ${prefix} ${currentPath}: "${preview}"`);
97
- targetObj[key] = await translateText(enValue, targetLang);
98
- stats.count++;
99
- if (isNewKey) stats.newKeys.push(currentPath);
105
+
106
+ const translated = await translateText(enValue, targetLang);
107
+
108
+ if (translated !== enValue) {
109
+ targetObj[key] = translated;
110
+ stats.count++;
111
+ if (isNewKey) stats.newKeys.push(currentPath);
112
+ } else {
113
+ console.log(` ⏭️ Skipped (universal word): ${currentPath}`);
114
+ }
115
+
100
116
  await delay(200);
101
117
  }
102
118
  }