@umituz/react-native-localization 3.5.32 → 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 -10
package/package.json
CHANGED
|
@@ -78,14 +78,14 @@ 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}]`);
|
|
@@ -102,14 +102,14 @@ async function translateObject(enObj, targetObj, targetLang, path = '', stats =
|
|
|
102
102
|
await translateObject(enValue, targetObj[key], targetLang, currentPath, stats);
|
|
103
103
|
} else if (typeof enValue === 'string') {
|
|
104
104
|
if (needsTranslation(targetValue, enValue)) {
|
|
105
|
-
const preview = enValue.length > 40 ? enValue.substring(0, 40) + '...' : enValue;
|
|
106
|
-
const isNewKey = targetValue === enValue;
|
|
107
|
-
const prefix = isNewKey ? '🆕 NEW' : '🔄';
|
|
108
|
-
console.log(` ${prefix} ${currentPath}: "${preview}"`);
|
|
109
|
-
|
|
110
105
|
const translated = await translateText(enValue, targetLang);
|
|
111
106
|
|
|
112
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
|
+
|
|
113
113
|
targetObj[key] = translated;
|
|
114
114
|
stats.count++;
|
|
115
115
|
if (isNewKey) stats.newKeys.push(currentPath);
|