ztechno_core 0.0.10 → 0.0.11
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/lib/translate_service.js +2 -2
- package/package.json +1 -1
package/lib/translate_service.js
CHANGED
|
@@ -91,13 +91,13 @@ class ZTranslateService {
|
|
|
91
91
|
}
|
|
92
92
|
async translateHtml(html, cookies) {
|
|
93
93
|
const lang = this.getLang(cookies);
|
|
94
|
-
const
|
|
94
|
+
const srcLang = this.getSourceLang();
|
|
95
95
|
const dom = htmlParser.parseFromString(html);
|
|
96
96
|
const htmlNodes = dom.getElementsByTagName('html');
|
|
97
97
|
const mainNodes = dom.getElementsByTagName('main');
|
|
98
98
|
const isView = htmlNodes.length === 0;
|
|
99
99
|
const domNode = isView ? mainNodes[0] : htmlNodes[0];
|
|
100
|
-
if (lang !==
|
|
100
|
+
if (lang !== srcLang) {
|
|
101
101
|
const node = isView ? domNode : domNode.getElementsByTagName('body')[0];
|
|
102
102
|
const promises = [];
|
|
103
103
|
this.translateHtmlRec(lang, node, promises);
|