gluon-status-page: improve localization (#1241)
This commit is contained in:
parent
7a53482f86
commit
94e7827ac8
@ -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)
|
||||
|
@ -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": "Узел",
|
||||
|
Loading…
Reference in New Issue
Block a user