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
32
proxy/static/_locales/en_US/messages.json
Normal file
32
proxy/static/_locales/en_US/messages.json
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"appDesc": {
|
||||
"message": "Snowflake is a WebRTC pluggable transport for Tor."
|
||||
},
|
||||
"popupTurnOn": {
|
||||
"message": "Turn On"
|
||||
},
|
||||
"popupTurnOff": {
|
||||
"message": "Turn Off"
|
||||
},
|
||||
"popupLearnMore": {
|
||||
"message": "Learn more"
|
||||
},
|
||||
"popupStatusOff": {
|
||||
"message": "Snowflake is off"
|
||||
},
|
||||
"popupStatusOn": {
|
||||
"message": "Number of users currently connected: $1"
|
||||
},
|
||||
"popupStatusReady": {
|
||||
"message": "Your Snowflake is ready to help users circumvent censorship!"
|
||||
},
|
||||
"popupWebRTCOff": {
|
||||
"message": "WebRTC feature is not detected."
|
||||
},
|
||||
"popupDescOn": {
|
||||
"message": "Number of users your Snowflake has helped circumvent censorship in the last 24 hours: $1"
|
||||
},
|
||||
"badgeCookiesOff": {
|
||||
"message": "Cookies are not enabled."
|
||||
}
|
||||
}
|
|
@ -11,18 +11,18 @@
|
|||
<body>
|
||||
<div id="active">
|
||||
<div id="statusimg"></div>
|
||||
<p id="statustext">Snowflake is off</p>
|
||||
<p id="statustext">__MSG_popupStatusOff__</p>
|
||||
<p id="statusdesc"></p>
|
||||
</div>
|
||||
<div class="b button">
|
||||
<label id="toggle" for="enabled">Turn On</label>
|
||||
<label id="toggle" for="enabled">__MSG_popupTurnOn__</label>
|
||||
<label class="switch">
|
||||
<input id="enabled" type="checkbox" />
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="b learn">
|
||||
<a target="_blank" href="https://snowflake.torproject.org/">Learn more</a>
|
||||
<a target="_blank" href="https://snowflake.torproject.org/">__MSG_popupLearnMore__</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
<p>Which looks like this:</p>
|
||||
|
||||
<iframe src="embed.html" width="320px" height="200px" frameborder="0" scrolling="no"></iframe>
|
||||
<iframe src="embed.html" width="320px" height="240px" frameborder="0" scrolling="no"></iframe>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -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