gluon-status-page: improve localization (#1241)

This commit is contained in:
Christof Schulze 2017-10-31 19:25:27 +01:00 committed by GitHub
parent 7a53482f86
commit 94e7827ac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View File

@ -5,12 +5,16 @@ define(["lib/helper"], function (Helper) {
update(nodeInfo)
function dlEntry(dl, dict, key, prettyName) {
function dlEntry(dl, dict, key, prettyName, transform) {
var v = Helper.dictGet(dict, key.split("."))
if (v === null)
return
if (transform) {
v = transform(v)
}
var dt = document.createElement("dt")
var dd = document.createElement("dd")
@ -30,6 +34,13 @@ define(["lib/helper"], function (Helper) {
dl.appendChild(dd)
}
function enabledDisabled(v) {
if (v) {
return Helper._("enabled");
}
return Helper._("disabled");
}
function update(nodeInfo) {
var list = document.createElement("dl")
@ -39,8 +50,8 @@ define(["lib/helper"], function (Helper) {
dlEntry(list, nodeInfo, "network.mac", Helper._("Primary MAC"))
dlEntry(list, nodeInfo, "network.addresses", Helper._("IP Address"))
dlEntry(list, nodeInfo, "software.firmware.release", Helper._("Firmware"))
dlEntry(list, nodeInfo, "software.fastd.enabled", "Mesh-VPN")
dlEntry(list, nodeInfo, "software.autoupdater.enabled", Helper._("Automatic updates"))
dlEntry(list, nodeInfo, "software.fastd.enabled", Helper._("Mesh VPN"), enabledDisabled)
dlEntry(list, nodeInfo, "software.autoupdater.enabled", Helper._("Automatic updates"), enabledDisabled)
dlEntry(list, nodeInfo, "software.autoupdater.branch", Helper._("Branch"))
el.appendChild(list)

View File

@ -106,7 +106,10 @@ define([ "bacon" ], function (Bacon) {
"not connected": "nicht verbunden",
"Packets/s": "Pakete/s",
"Statistic": "Statistik",
"Neighbors": "Nachbarknoten"
"Neighbors": "Nachbarknoten",
"Mesh VPN": "Mesh-VPN",
"enabled": "aktiviert",
"disabled": "deaktiviert"
},
"ru": {
"Node": "Узел",