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
PKG_NAME:=gluon-luci-admin
PKG_VERSION:=0.1
PKG_VERSION:=1
PKG_RELEASE:=1
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
SECTION:=gluon
@ -18,10 +20,6 @@ define Package/gluon-luci-admin
DEPENDS:=gluon-config-mode-core-virtual
endef
define Package/gluon-luci-admin/description
Luci based config mode
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
@ -30,10 +28,12 @@ define Build/Configure
endef
define Build/Compile
$(call GluonBuildI18N,gluon-luci-admin,i18n)
endef
define Package/gluon-luci-admin/install
$(CP) ./files/* $(1)/
$(call GluonInstallI18N,gluon-luci-admin,$(1))
endef
$(eval $(call BuildPackage,gluon-luci-admin))

View File

@ -29,11 +29,11 @@ function index()
root.index = true
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_authenticator = function() return "root" end
page.index = true
entry({"admin", "index"}, cbi("admin/info"), _("Info"), 1).ignoreindex = true
entry({"admin", "remote"}, cbi("admin/remote"), _("Remotezugriff"), 10)
entry({"admin", "index"}, cbi("admin/info"), _("Information"), 1).ignoreindex = true
entry({"admin", "remote"}, cbi("admin/remote"), _("Remote access"), 10)
end

View File

@ -18,7 +18,7 @@ module("luci.controller.admin.upgrade", package.seeall)
function index()
local has_platform = nixio.fs.access("/lib/upgrade/platform.sh")
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)
end
end

View File

@ -16,15 +16,13 @@ $Id$
local fs = require "nixio.fs"
local m = Map("system", "SSH-Keys")
m.submit = "Speichern"
m.reset = "Zurücksetzen"
local m = Map("system", translate("SSH keys"))
m.pageaction = false
m.template = "admin/expertmode"
if fs.access("/etc/config/dropbear") then
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.anonymous = true
@ -57,23 +55,22 @@ if fs.access("/etc/config/dropbear") then
end
end
local m2 = Map("system", "Passwort")
m2.submit = "Speichern"
local m2 = Map("system", translate("Password"))
m2.reset = false
m2.pageaction = false
m2.template = "admin/expertmode"
local s = m2:section(TypedSection, "_dummy2", nil,
[[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).]])
local s = m2:section(TypedSection, "_dummy2", nil, translate(
"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."))
s.addremove = false
s.anonymous = true
local pw1 = s:option(Value, "pw1", "Passwort")
local pw1 = s:option(Value, "pw1", translate("Password"))
pw1.password = true
local pw2 = s:option(Value, "pw2", "Wiederholung")
local pw2 = s:option(Value, "pw2", translate("Confirmation"))
pw2.password = true
function s.cfgsections()
@ -87,18 +84,18 @@ function m2.on_commit(map)
if v1 and v2 then
if v1 == v2 then
if #v1 > 0 then
if luci.sys.user.setpasswd(luci.dispatcher.context.authuser, v1) == 0 then
m2.message = "Passwort geändert."
else
m2.errmessage = "Das Passwort konnte nicht geändert werden."
end
if luci.sys.user.setpasswd(luci.dispatcher.context.authuser, v1) == 0 then
m2.message = translate("Password changed.")
else
m2.errmessage = translate("Unable to change the password.")
end
else
-- 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')
m2.message = "Passwort gelöscht."
m2.message = translate("Password removed.")
end
else
m2.errmessage = "Die beiden Passwörter stimmen nicht überein."
m2.errmessage = translate("The password and the confirmation differ.")
end
end
end

View File

@ -2,6 +2,7 @@
local fs = require 'luci.fs'
local uci = require('luci.model.uci').cursor()
local util = require 'luci.util'
local i18n = require 'luci.i18n'
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
@ -9,13 +10,13 @@
local keys = {
hostname = 'Hostname',
primary_mac = 'MAC-Adresse',
model = 'Hardware-Modell',
version = 'Gluon-Version',
release = 'Firmware-Release',
site = 'Site',
pubkey = 'Öffentlicher VPN-Schlüssel',
hostname = i18n.translate('Hostname'),
primary_mac = i18n.translate('MAC address'),
model = i18n.translate('Hardware model'),
version = i18n.translate('Gluon version'),
release = i18n.translate('Firmware release'),
site = i18n.translate('Site'),
pubkey = i18n.translate('Public VPN key'),
}
local values = {
@ -36,7 +37,7 @@
end
end
-%>
<h2>Info</h2>
<h2><%:Information%></h2>
<% for _, key in ipairs({'hostname', 'primary_mac', 'model', 'version', 'release', 'site', 'pubkey'}) do %>
<div class="cbi-value">
<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%>
<h2>Firmware aktualisieren</h2>
<h2><%:Upgrade firmware%></h2>
<form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
<p>
Hier kannst du ein manuelles Firmwareupdate durchführen.
</p>
<% if bad_image then %>
<p class="error">Die übermittelte Firmwaredatei kann nicht verwendet werden.</p>
<% end %>
<div class="cbi-section-node">
<div class="cbi-value">
<label class="cbi-value-title">
Firmware-Datei
</label>
<div class="cbi-value-field">
<input class="cbi-input-file" type="file" name="image" />
<p>
<%:You can manually upgrade your firmware here.%>
</p>
<% if bad_image then %>
<p class="error"><%:The provided firmware image is not valid for this device.%></p>
<% end %>
<div class="cbi-section-node">
<div class="cbi-value">
<label class="cbi-value-title">
<%:Firmware image%>
</label>
<div class="cbi-value-field">
<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 class="cbi-value cbi-value-last">
<label class="cbi-value-title">
Einstellungen beibehalten
</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 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>
</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>
<%+footer%>

View File

@ -15,20 +15,20 @@ $Id$
<%+header%>
<h2>Firmware aktualisieren</h2>
<h2><%:Upgrade firmware%></h2>
<p>
Die Firmwaredatei wurde übermittelt. Bitte vergleiche MD5-Checksumme
und Dateigröße und klicke anschließend auf "Fortfahren".
<%:The firmware image has been transmitted. Please ensure the MD5 checksum and image size are correct and click "continue".%>
</p>
<% 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 %>
<p>
<ul>
<li>md5sum: <code><%=checksum%></code></li>
<li>Größe: <%
<li><%:Size%>: <%
function byte_format(byte)
local suff = {"B", "KB", "MB", "GB", "TB"}
for i=1, 5 do
@ -51,16 +51,16 @@ $Id$
%></li>
</ul>
</p>
<div class="cbi-page-actions right">
<div class="cbi-page-actions">
<form style="display:inline">
<input type="hidden" name="step" value="3" />
<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 style="display:inline">
<input type="hidden" name="step" value="1" />
<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>
</div>
<%+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%>">
<head>
<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" />
</head>
<body>
<div id="maincontainer">
<div id="maincontent">
<p>
Die Firmware wird jetzt aktualisiert.
<strong>UNTERBRICH AUF KEINEN FALL DIE STROMVERSORGUNG!</strong>
Dieser Vorgang wird einige Minuten dauern.
Anschließend startet das Gerät automatisch neu.
<%:The firmware is currently being upgraded.%>
<strong><%:Don't switch off the device in any circumstance!%></strong>
<%:The upgrade will take a few minutes. When it is finished, your node will reboot automatically.%>
</p>
</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 ""