mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Start localization
Trac 30310
This commit is contained in:
parent
f94ef87c46
commit
4e5a50f2b5
9 changed files with 115 additions and 26 deletions
|
@ -38,4 +38,16 @@ class Popup {
|
|||
setToggleText(txt) {
|
||||
document.getElementById('toggle').innerText = txt;
|
||||
}
|
||||
static fill(n, func) {
|
||||
switch(n.nodeType) {
|
||||
case 3: { // Node.TEXT_NODE
|
||||
const m = /^__MSG_([^_]*)__$/.exec(n.nodeValue);
|
||||
if (m) { n.nodeValue = func(m[1]); }
|
||||
break;
|
||||
}
|
||||
case 1: // Node.ELEMENT_NODE
|
||||
n.childNodes.forEach(c => Popup.fill(c, func));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue