@umituz/react-native-localization 3.5.31 → 3.5.33
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 +1 -1
- package/src/scripts/utils/translator.js +10 -14
package/package.json
CHANGED
|
@@ -78,19 +78,17 @@ async function translateObject(enObj, targetObj, targetLang, path = '', stats =
|
|
|
78
78
|
for (let i = 0; i < enValue.length; i++) {
|
|
79
79
|
if (typeof enValue[i] === 'string') {
|
|
80
80
|
if (needsTranslation(targetObj[key][i], enValue[i])) {
|
|
81
|
-
const preview = enValue[i].length > 40 ? enValue[i].substring(0, 40) + '...' : enValue[i];
|
|
82
|
-
const isNewKey = targetObj[key][i] === enValue[i];
|
|
83
|
-
const prefix = isNewKey ? '🆕 NEW' : '🔄';
|
|
84
|
-
console.log(` ${prefix} ${currentPath}[${i}]: "${preview}"`);
|
|
85
|
-
|
|
86
81
|
const translated = await translateText(enValue[i], targetLang);
|
|
87
82
|
|
|
88
83
|
if (translated !== enValue[i]) {
|
|
84
|
+
const preview = enValue[i].length > 40 ? enValue[i].substring(0, 40) + '...' : enValue[i];
|
|
85
|
+
const isNewKey = targetObj[key][i] === enValue[i];
|
|
86
|
+
const prefix = isNewKey ? '🆕 NEW' : '🔄';
|
|
87
|
+
console.log(` ${prefix} ${currentPath}[${i}]: "${preview}"`);
|
|
88
|
+
|
|
89
89
|
targetObj[key][i] = translated;
|
|
90
90
|
stats.count++;
|
|
91
91
|
if (isNewKey) stats.newKeys.push(`${currentPath}[${i}]`);
|
|
92
|
-
} else {
|
|
93
|
-
console.log(` ⏭️ Skipped (universal word): ${currentPath}[${i}]`);
|
|
94
92
|
}
|
|
95
93
|
|
|
96
94
|
await delay(200);
|
|
@@ -104,19 +102,17 @@ async function translateObject(enObj, targetObj, targetLang, path = '', stats =
|
|
|
104
102
|
await translateObject(enValue, targetObj[key], targetLang, currentPath, stats);
|
|
105
103
|
} else if (typeof enValue === 'string') {
|
|
106
104
|
if (needsTranslation(targetValue, enValue)) {
|
|
107
|
-
const preview = enValue.length > 40 ? enValue.substring(0, 40) + '...' : enValue;
|
|
108
|
-
const isNewKey = targetValue === enValue;
|
|
109
|
-
const prefix = isNewKey ? '🆕 NEW' : '🔄';
|
|
110
|
-
console.log(` ${prefix} ${currentPath}: "${preview}"`);
|
|
111
|
-
|
|
112
105
|
const translated = await translateText(enValue, targetLang);
|
|
113
106
|
|
|
114
107
|
if (translated !== enValue) {
|
|
108
|
+
const preview = enValue.length > 40 ? enValue.substring(0, 40) + '...' : enValue;
|
|
109
|
+
const isNewKey = targetValue === enValue;
|
|
110
|
+
const prefix = isNewKey ? '🆕 NEW' : '🔄';
|
|
111
|
+
console.log(` ${prefix} ${currentPath}: "${preview}"`);
|
|
112
|
+
|
|
115
113
|
targetObj[key] = translated;
|
|
116
114
|
stats.count++;
|
|
117
115
|
if (isNewKey) stats.newKeys.push(currentPath);
|
|
118
|
-
} else {
|
|
119
|
-
console.log(` ⏭️ Skipped (universal word): ${currentPath}`);
|
|
120
116
|
}
|
|
121
117
|
|
|
122
118
|
await delay(200);
|