isdata-customer-sdk 0.2.5 → 0.2.6
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/dist/index.common.js +25 -9
- package/dist/index.common.js.map +1 -1
- package/dist/index.umd.js +25 -9
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +3 -3
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -33336,6 +33336,9 @@ const catalog_i18n_check = element => {
|
|
|
33336
33336
|
};
|
|
33337
33337
|
;// ./src/api/i18n/commom_i18n/common_i18n.js
|
|
33338
33338
|
|
|
33339
|
+
|
|
33340
|
+
|
|
33341
|
+
|
|
33339
33342
|
const common_i18n_check = element => {
|
|
33340
33343
|
const checkResult = {
|
|
33341
33344
|
result: false,
|
|
@@ -33344,33 +33347,46 @@ const common_i18n_check = element => {
|
|
|
33344
33347
|
// 检查目录列表 名称 列
|
|
33345
33348
|
if (element.tagName === 'BUTTON') {
|
|
33346
33349
|
let innerHTML = element.innerHTML;
|
|
33347
|
-
let oldValue =
|
|
33350
|
+
let oldValue = element.getAttribute("oldValue");
|
|
33351
|
+
if (!oldValue) {
|
|
33352
|
+
oldValue = innerHTML;
|
|
33353
|
+
}
|
|
33354
|
+
let firstCheck = checkTextFormat(oldValue);
|
|
33355
|
+
let firstCheckResult = firstCheck ? true : false;
|
|
33348
33356
|
console.log("检查 button 元素:", innerHTML);
|
|
33357
|
+
console.log("检查结果:", firstCheckResult);
|
|
33349
33358
|
let scriptFunction = (appID, lang) => {
|
|
33350
|
-
|
|
33351
|
-
|
|
33359
|
+
let elementsArray = [];
|
|
33360
|
+
element.childNodes.forEach(node => {
|
|
33361
|
+
let scriptNodeItem = node;
|
|
33352
33362
|
if (scriptNodeItem.nodeType === Node.TEXT_NODE) {
|
|
33353
33363
|
let text = element.getAttribute("oldValue");
|
|
33364
|
+
console.log("执行 button 文本节点翻译:", text);
|
|
33354
33365
|
let isTextMatch = checkTextFormat(text);
|
|
33355
33366
|
if (!isTextMatch) {
|
|
33356
|
-
|
|
33367
|
+
elementsArray.push(scriptNodeItem);
|
|
33357
33368
|
} else {
|
|
33358
|
-
|
|
33369
|
+
console.log("执行 button 脚本节点翻译isTextMatch:", isTextMatch ? true : false);
|
|
33370
|
+
// element.removeChild(scriptNodeItem);
|
|
33359
33371
|
let key = isTextMatch.key;
|
|
33360
33372
|
let textNode = document.createTextNode(i18n(key, appID, lang) || key);
|
|
33361
|
-
|
|
33373
|
+
elementsArray.push(textNode);
|
|
33362
33374
|
}
|
|
33363
33375
|
} else {
|
|
33364
|
-
|
|
33376
|
+
elementsArray.push(scriptNodeItem);
|
|
33365
33377
|
}
|
|
33366
|
-
}
|
|
33378
|
+
});
|
|
33379
|
+
element.innerHTML = '';
|
|
33380
|
+
elementsArray.forEach(el => {
|
|
33381
|
+
element.appendChild(el);
|
|
33382
|
+
});
|
|
33367
33383
|
};
|
|
33368
33384
|
let tempHTMLMatch = {
|
|
33369
33385
|
oldValue: oldValue,
|
|
33370
33386
|
isScriptAction: true,
|
|
33371
33387
|
scriptFunction: scriptFunction
|
|
33372
33388
|
};
|
|
33373
|
-
checkResult.result =
|
|
33389
|
+
checkResult.result = firstCheckResult;
|
|
33374
33390
|
checkResult.innerHTMLMatch = tempHTMLMatch;
|
|
33375
33391
|
return checkResult;
|
|
33376
33392
|
}
|