gluon-luci-admin: i18n

This commit is contained in:
Matthias Schiffer 2015-05-04 01:29:29 +02:00
parent 623966afae
commit e1f2ac11b6
10 changed files with 279 additions and 78 deletions

View File

@ -4,12 +4,14 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-luci-admin PKG_NAME:=gluon-luci-admin
PKG_VERSION:=0.1 PKG_VERSION:=1
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk include $(GLUONDIR)/include/package.mk
PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
define Package/gluon-luci-admin define Package/gluon-luci-admin
SECTION:=gluon SECTION:=gluon
@ -18,10 +20,6 @@ define Package/gluon-luci-admin
DEPENDS:=gluon-config-mode-core-virtual DEPENDS:=gluon-config-mode-core-virtual
endef endef
define Package/gluon-luci-admin/description
Luci based config mode
endef
define Build/Prepare define Build/Prepare
mkdir -p $(PKG_BUILD_DIR) mkdir -p $(PKG_BUILD_DIR)
endef endef
@ -30,10 +28,12 @@ define Build/Configure
endef endef
define Build/Compile define Build/Compile
$(call GluonBuildI18N,gluon-luci-admin,i18n)
endef endef
define Package/gluon-luci-admin/install define Package/gluon-luci-admin/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-luci-admin,$(1))
endef endef
$(eval $(call BuildPackage,gluon-luci-admin)) $(eval $(call BuildPackage,gluon-luci-admin))

View File

@ -29,11 +29,11 @@ function index()
root.index = true root.index = true
end end
local page = entry({"admin"}, alias("admin", "index"), "Expert Mode", 10) local page = entry({"admin"}, alias("admin", "index"), _("Expert Mode"), 10)
page.sysauth = "root" page.sysauth = "root"
page.sysauth_authenticator = function() return "root" end page.sysauth_authenticator = function() return "root" end
page.index = true page.index = true
entry({"admin", "index"}, cbi("admin/info"), _("Info"), 1).ignoreindex = true entry({"admin", "index"}, cbi("admin/info"), _("Information"), 1).ignoreindex = true
entry({"admin", "remote"}, cbi("admin/remote"), _("Remotezugriff"), 10) entry({"admin", "remote"}, cbi("admin/remote"), _("Remote access"), 10)
end end

View File

@ -18,7 +18,7 @@ module("luci.controller.admin.upgrade", package.seeall)
function index() function index()
local has_platform = nixio.fs.access("/lib/upgrade/platform.sh") local has_platform = nixio.fs.access("/lib/upgrade/platform.sh")
if has_platform then if has_platform then
entry({"admin", "upgrade"}, call("action_upgrade"), "Firmware aktualisieren", 90) entry({"admin", "upgrade"}, call("action_upgrade"), _("Upgrade firmware"), 90)
entry({"admin", "upgrade", "reboot"}, template("admin/upgrade_reboot"), nil, nil) entry({"admin", "upgrade", "reboot"}, template("admin/upgrade_reboot"), nil, nil)
end end
end end

View File

@ -16,15 +16,13 @@ $Id$
local fs = require "nixio.fs" local fs = require "nixio.fs"
local m = Map("system", "SSH-Keys") local m = Map("system", translate("SSH keys"))
m.submit = "Speichern"
m.reset = "Zurücksetzen"
m.pageaction = false m.pageaction = false
m.template = "admin/expertmode" m.template = "admin/expertmode"
if fs.access("/etc/config/dropbear") then if fs.access("/etc/config/dropbear") then
local s = m:section(TypedSection, "_dummy1", nil, local s = m:section(TypedSection, "_dummy1", nil,
"Hier hast du die Möglichkeit SSH-Keys (einen pro Zeile) zu hinterlegen:") translate("You can provide your SSH keys here (one per line):"))
s.addremove = false s.addremove = false
s.anonymous = true s.anonymous = true
@ -57,23 +55,22 @@ if fs.access("/etc/config/dropbear") then
end end
end end
local m2 = Map("system", "Passwort") local m2 = Map("system", translate("Password"))
m2.submit = "Speichern"
m2.reset = false m2.reset = false
m2.pageaction = false m2.pageaction = false
m2.template = "admin/expertmode" m2.template = "admin/expertmode"
local s = m2:section(TypedSection, "_dummy2", nil, local s = m2:section(TypedSection, "_dummy2", nil, translate(
[[Alternativ kannst du auch ein Passwort setzen. Wähle bitte ein sicheres Passwort, das du nirgendwo anders verwendest.<br /><br /> "Alternatively, you can set a password to access you node. Please choose a secure password you don't use anywhere else.<br /><br />"
Beim Setzen eines leeren Passworts wird der Login per Passwort gesperrt (dies ist die Standard-Einstellung).]]) .. "If you set an empty password, login via password will be disabled. This is the default."))
s.addremove = false s.addremove = false
s.anonymous = true s.anonymous = true
local pw1 = s:option(Value, "pw1", "Passwort") local pw1 = s:option(Value, "pw1", translate("Password"))
pw1.password = true pw1.password = true
local pw2 = s:option(Value, "pw2", "Wiederholung") local pw2 = s:option(Value, "pw2", translate("Confirmation"))
pw2.password = true pw2.password = true
function s.cfgsections() function s.cfgsections()
@ -87,18 +84,18 @@ function m2.on_commit(map)
if v1 and v2 then if v1 and v2 then
if v1 == v2 then if v1 == v2 then
if #v1 > 0 then if #v1 > 0 then
if luci.sys.user.setpasswd(luci.dispatcher.context.authuser, v1) == 0 then if luci.sys.user.setpasswd(luci.dispatcher.context.authuser, v1) == 0 then
m2.message = "Passwort geändert." m2.message = translate("Password changed.")
else else
m2.errmessage = "Das Passwort konnte nicht geändert werden." m2.errmessage = translate("Unable to change the password.")
end end
else else
-- We don't check the return code here as the error 'password for root is already locked' is normal... -- We don't check the return code here as the error 'password for root is already locked' is normal...
os.execute('passwd -l root >/dev/null') os.execute('passwd -l root >/dev/null')
m2.message = "Passwort gelöscht." m2.message = translate("Password removed.")
end end
else else
m2.errmessage = "Die beiden Passwörter stimmen nicht überein." m2.errmessage = translate("The password and the confirmation differ.")
end end
end end
end end

View File

@ -2,6 +2,7 @@
local fs = require 'luci.fs' local fs = require 'luci.fs'
local uci = require('luci.model.uci').cursor() local uci = require('luci.model.uci').cursor()
local util = require 'luci.util' local util = require 'luci.util'
local i18n = require 'luci.i18n'
local site = require 'gluon.site_config' local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig' local sysconfig = require 'gluon.sysconfig'
@ -9,13 +10,13 @@
local keys = { local keys = {
hostname = 'Hostname', hostname = i18n.translate('Hostname'),
primary_mac = 'MAC-Adresse', primary_mac = i18n.translate('MAC address'),
model = 'Hardware-Modell', model = i18n.translate('Hardware model'),
version = 'Gluon-Version', version = i18n.translate('Gluon version'),
release = 'Firmware-Release', release = i18n.translate('Firmware release'),
site = 'Site', site = i18n.translate('Site'),
pubkey = 'Öffentlicher VPN-Schlüssel', pubkey = i18n.translate('Public VPN key'),
} }
local values = { local values = {
@ -36,7 +37,7 @@
end end
end end
-%> -%>
<h2>Info</h2> <h2><%:Information%></h2>
<% for _, key in ipairs({'hostname', 'primary_mac', 'model', 'version', 'release', 'site', 'pubkey'}) do %> <% for _, key in ipairs({'hostname', 'primary_mac', 'model', 'version', 'release', 'site', 'pubkey'}) do %>
<div class="cbi-value"> <div class="cbi-value">
<div class="cbi-value-title"><%=keys[key]%></div><div class="cbi-value-field"><%=values[key] or 'n/a'%></div> <div class="cbi-value-title"><%=keys[key]%></div><div class="cbi-value-field"><%=values[key] or 'n/a'%></div>

View File

@ -15,41 +15,41 @@ $Id$
<%+header%> <%+header%>
<h2>Firmware aktualisieren</h2> <h2><%:Upgrade firmware%></h2>
<form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data"> <form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
<p> <p>
Hier kannst du ein manuelles Firmwareupdate durchführen. <%:You can manually upgrade your firmware here.%>
</p> </p>
<% if bad_image then %> <% if bad_image then %>
<p class="error">Die übermittelte Firmwaredatei kann nicht verwendet werden.</p> <p class="error"><%:The provided firmware image is not valid for this device.%></p>
<% end %> <% end %>
<div class="cbi-section-node"> <div class="cbi-section-node">
<div class="cbi-value"> <div class="cbi-value">
<label class="cbi-value-title"> <label class="cbi-value-title">
Firmware-Datei <%:Firmware image%>
</label> </label>
<div class="cbi-value-field"> <div class="cbi-value-field">
<input class="cbi-input-file" type="file" name="image" /> <input class="cbi-input-file" type="file" name="image" />
</div>
</div>
<div class="cbi-value cbi-value-last">
<label class="cbi-value-title">
<%:Keep settings%>
</label>
<div class="cbi-value-field">
<input id="keepcfg" class="cbi-input-checkbox" type="checkbox" name="keepcfg" value="1" checked="checked" />
<label for="keepcfg"></label>
</div>
</div> </div>
</div> </div>
<div class="cbi-value cbi-value-last"> <div class="cbi-page-actions right">
<label class="cbi-value-title"> <input type="hidden" name="step" value="2" />
Einstellungen beibehalten <input class="cbi-button cbi-button-apply" type="submit" value="<%:Upload image%>" />
</label>
<div class="cbi-value-field">
<input id="keepcfg" class="cbi-input-checkbox" type="checkbox" name="keepcfg" value="1" checked="checked" />
<label for="keepcfg"></label>
</div>
</div> </div>
</div>
<div class="cbi-page-actions right">
<input type="hidden" name="step" value="2" />
<input class="cbi-button cbi-button-apply" type="submit" value="Upload image" />
</div>
</form> </form>
<%+footer%> <%+footer%>

View File

@ -15,20 +15,20 @@ $Id$
<%+header%> <%+header%>
<h2>Firmware aktualisieren</h2> <h2><%:Upgrade firmware%></h2>
<p> <p>
Die Firmwaredatei wurde übermittelt. Bitte vergleiche MD5-Checksumme <%:The firmware image has been transmitted. Please ensure the MD5 checksum and image size are correct and click "continue".%>
und Dateigröße und klicke anschließend auf "Fortfahren".
</p> </p>
<% if flashsize > 0 and filesize > flashsize then %> <% if flashsize > 0 and filesize > flashsize then %>
<p class="error">Die Firmware passt nicht in den Speicher des Gerätes.</p> <p class="error"><%:The firmware is too big for your device's storage.%></p>
<% end %> <% end %>
<p> <p>
<ul> <ul>
<li>md5sum: <code><%=checksum%></code></li> <li>md5sum: <code><%=checksum%></code></li>
<li>Größe: <% <li><%:Size%>: <%
function byte_format(byte) function byte_format(byte)
local suff = {"B", "KB", "MB", "GB", "TB"} local suff = {"B", "KB", "MB", "GB", "TB"}
for i=1, 5 do for i=1, 5 do
@ -51,16 +51,16 @@ $Id$
%></li> %></li>
</ul> </ul>
</p> </p>
<div class="cbi-page-actions right"> <div class="cbi-page-actions">
<form style="display:inline"> <form style="display:inline">
<input type="hidden" name="step" value="3" /> <input type="hidden" name="step" value="3" />
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" /> <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
<input class="cbi-button cbi-button-apply" type="submit" value="Fortfahren" /> <input class="cbi-button cbi-button-apply" type="submit" value="<%:Continue%>" />
</form> </form>
<form style="display:inline"> <form style="display:inline">
<input type="hidden" name="step" value="1" /> <input type="hidden" name="step" value="1" />
<input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" /> <input type="hidden" name="keepcfg" value="<%=keepconfig and "1" or "0"%>" />
<input class="cbi-button cbi-button-reset" type="submit" value="Abbrechen" /> <input class="cbi-button cbi-button-reset" type="submit" value="<%:Cancel%>" />
</form> </form>
</div> </div>
<%+footer%> <%+footer%>

View File

@ -3,17 +3,16 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%=luci.i18n.context.lang%>" lang="<%=luci.i18n.context.lang%>"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%=luci.i18n.context.lang%>" lang="<%=luci.i18n.context.lang%>">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Firmware wird aktualisiert</title> <title><%:Upgrading firmware%></title>
<link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" /> <link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" />
</head> </head>
<body> <body>
<div id="maincontainer"> <div id="maincontainer">
<div id="maincontent"> <div id="maincontent">
<p> <p>
Die Firmware wird jetzt aktualisiert. <%:The firmware is currently being upgraded.%>
<strong>UNTERBRICH AUF KEINEN FALL DIE STROMVERSORGUNG!</strong> <strong><%:Don't switch off the device in any circumstance!%></strong>
Dieser Vorgang wird einige Minuten dauern. <%:The upgrade will take a few minutes. When it is finished, your node will reboot automatically.%>
Anschließend startet das Gerät automatisch neu.
</p> </p>
</div> </div>
</div> </div>

View File

@ -0,0 +1,111 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-05-04 00:34+0200\n"
"Last-Translator: <mschiffer@universe-factory.net>\n"
"Language-Team: German\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid ""
"Alternatively, you can set a password to access you node. Please choose a "
"secure password you don't use anywhere else.<br /><br />If you set an empty "
"password, login via password will be disabled. This is the default."
msgstr ""
"Alternativ kannst du auch ein Passwort setzen. Wähle bitte ein sicheres "
"Passwort, das du nirgendwo anders verwendest.<br /><br />Beim Setzen eines "
"leeren Passworts wird der Login per Passwort gesperrt (dies ist die Standard-"
"Einstellung)."
msgid "Continue"
msgstr "Fortfahren"
msgid "Don't switch off the device in any circumstance!"
msgstr "Unterbrich auf keinen Fall die Stromversorgung!"
msgid "Expert Mode"
msgstr "Export Mode"
msgid "Firmware image"
msgstr "Firmware-Datei"
msgid "Firmware release"
msgstr "Firmware-Release"
msgid "Gluon version"
msgstr "Gluon-Version"
msgid "Hardware model"
msgstr "Hardware-Modell"
msgid "Information"
msgstr "Info"
msgid "MAC address"
msgstr "MAC-Adresse"
msgid "Password changed."
msgstr "Passwort geändert."
msgid "Password removed."
msgstr "Passwort gelöscht."
msgid "Public VPN key"
msgstr "Öffentlicher VPN-Schlüssel"
msgid "Remote access"
msgstr "Remotezugriff"
msgid "SSH keys"
msgstr "SSH-Schlüssel"
msgid "Site"
msgstr "Site"
msgid ""
"The firmware image has been transmitted. Please ensure the MD5 checksum and "
"image size are correct and click \"continue\"."
msgstr ""
"Die Firmwaredatei wurde übermittelt. Bitte vergleiche MD5-Checksumme und "
"Dateigröße und klicke anschließend auf \"fortfahren\"."
msgid "The firmware is currently being upgraded."
msgstr "Die Firmware wird jetzt aktualisiert."
msgid "The firmware is too big for your device's storage."
msgstr "Die Firmware passt nicht in den Speicher des Gerätes."
msgid "The password and the confirmation differ."
msgstr "Die beiden Passwörter stimmen nicht überein."
msgid "The provided firmware image is not valid for this device."
msgstr "Die übermittelte Datei ist keine gültige Firmware für dieses Gerät."
msgid ""
"The upgrade will take a few minutes. When it is finished, your node will "
"reboot automatically."
msgstr ""
"Dieser Vorgang wird einige Minuten dauern. Anschließend startet das Gerät "
"automatisch neu."
msgid "Unable to change the password."
msgstr "Das Passwort konnte nicht geändert werden."
msgid "Upgrade firmware"
msgstr "Firmware aktualisieren"
msgid "Upgrading firmware"
msgstr "Firmware wird aktualisiert"
msgid "Upload image"
msgstr "Datei hochladen"
msgid "You can manually upgrade your firmware here."
msgstr "Hier kannst du ein manuelles Firmwareupdate durchführen."
msgid "You can provide your SSH keys here (one per line):"
msgstr ""
"Hier hast du die Möglichkeit, SSH-Keys zu hinterlegen (einen pro Zeile):"

View File

@ -0,0 +1,93 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid ""
"Alternatively, you can set a password to access you node. Please choose a "
"secure password you don't use anywhere else.<br /><br />If you set an empty "
"password, login via password will be disabled. This is the default."
msgstr ""
msgid "Continue"
msgstr ""
msgid "Don't switch off the device in any circumstance!"
msgstr ""
msgid "Expert Mode"
msgstr ""
msgid "Firmware image"
msgstr ""
msgid "Firmware release"
msgstr ""
msgid "Gluon version"
msgstr ""
msgid "Hardware model"
msgstr ""
msgid "Information"
msgstr ""
msgid "MAC address"
msgstr ""
msgid "Password changed."
msgstr ""
msgid "Password removed."
msgstr ""
msgid "Public VPN key"
msgstr ""
msgid "Remote access"
msgstr ""
msgid "SSH keys"
msgstr ""
msgid "Site"
msgstr ""
msgid ""
"The firmware image has been transmitted. Please ensure the MD5 checksum and "
"image size are correct and click \"continue\"."
msgstr ""
msgid "The firmware is currently being upgraded."
msgstr ""
msgid "The firmware is too big for your device's storage."
msgstr ""
msgid "The password and the confirmation differ."
msgstr ""
msgid "The provided firmware image is not valid for this device."
msgstr ""
msgid ""
"The upgrade will take a few minutes. When it is finished, your node will "
"reboot automatically."
msgstr ""
msgid "Unable to change the password."
msgstr ""
msgid "Upgrade firmware"
msgstr ""
msgid "Upgrading firmware"
msgstr ""
msgid "Upload image"
msgstr ""
msgid "You can manually upgrade your firmware here."
msgstr ""
msgid "You can provide your SSH keys here (one per line):"
msgstr ""