aboutsummaryrefslogtreecommitdiff
path: root/javascript/localization.js
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-05-01 14:39:52 +0300
committerGitHub <noreply@github.com>2023-05-01 14:39:52 +0300
commit696c338ee2841830fd5010427d90347329d5786a (patch)
tree6f9c37f302e6bcaf1ce3e1f1913f2db54f3b184e /javascript/localization.js
parentb463b8a12672e010a8c86ea1c73b2c14ae5555d5 (diff)
parent50f63e22472dd532ddd76adb28f29aef46a71a86 (diff)
Merge pull request #9953 from akx/js-misc-fixes
Miscellaneous JS fixes
Diffstat (limited to 'javascript/localization.js')
-rw-r--r--javascript/localization.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/javascript/localization.js b/javascript/localization.js
index 1a5a1dbb..e1ffa271 100644
--- a/javascript/localization.js
+++ b/javascript/localization.js
@@ -35,11 +35,11 @@ function canBeTranslated(node, text){
if(! text) return false;
if(! node.parentElement) return false;
- parentType = node.parentElement.nodeName
+ var parentType = node.parentElement.nodeName
if(parentType=='SCRIPT' || parentType=='STYLE' || parentType=='TEXTAREA') return false;
if (parentType=='OPTION' || parentType=='SPAN'){
- pnode = node
+ var pnode = node
for(var level=0; level<4; level++){
pnode = pnode.parentElement
if(! pnode) break;
@@ -69,7 +69,7 @@ function getTranslation(text){
}
function processTextNode(node){
- text = node.textContent.trim()
+ var text = node.textContent.trim()
if(! canBeTranslated(node, text)) return
@@ -105,7 +105,7 @@ function processNode(node){
}
function dumpTranslations(){
- dumped = {}
+ var dumped = {}
if (localization.rtl) {
dumped.rtl = true
}
@@ -151,7 +151,7 @@ document.addEventListener("DOMContentLoaded", function() {
})
function download_localization() {
- text = JSON.stringify(dumpTranslations(), null, 4)
+ var text = JSON.stringify(dumpTranslations(), null, 4)
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));