From 0c80e7863f1745bebcfb26192c5996a275526fa4 Mon Sep 17 00:00:00 2001 From: Kokel Date: Sun, 26 Apr 2015 17:34:05 +0200 Subject: [PATCH 1/2] gluon-luci-node-role: add translations --- package/gluon-luci-node-role/Makefile | 4 +++ .../lua/luci/controller/admin/noderole.lua | 2 +- .../lib/lua/luci/model/cbi/admin/noderole.lua | 15 +++++------ package/gluon-luci-node-role/i18n/de.po | 27 +++++++++++++++++++ .../i18n/gluon-luci-node-role.pot | 14 ++++++++++ 5 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 package/gluon-luci-node-role/i18n/de.po create mode 100644 package/gluon-luci-node-role/i18n/gluon-luci-node-role.pot diff --git a/package/gluon-luci-node-role/Makefile b/package/gluon-luci-node-role/Makefile index 5e0fbb00..ded7bd3f 100644 --- a/package/gluon-luci-node-role/Makefile +++ b/package/gluon-luci-node-role/Makefile @@ -8,6 +8,8 @@ PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) include $(GLUONDIR)/include/package.mk +PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG) + define Package/gluon-luci-node-role SECTION:=gluon CATEGORY:=Gluon @@ -23,10 +25,12 @@ define Build/Configure endef define Build/Compile + $(call GluonBuildI18N,gluon-luci-node-role,i18n) endef define Package/gluon-luci-node-role/install $(CP) ./files/* $(1)/ + $(call GluonInstallI18N,gluon-luci-node-role,$(1)) endef define Package/gluon-luci-node-role/postinst diff --git a/package/gluon-luci-node-role/files/usr/lib/lua/luci/controller/admin/noderole.lua b/package/gluon-luci-node-role/files/usr/lib/lua/luci/controller/admin/noderole.lua index dcde01f1..cfca1275 100644 --- a/package/gluon-luci-node-role/files/usr/lib/lua/luci/controller/admin/noderole.lua +++ b/package/gluon-luci-node-role/files/usr/lib/lua/luci/controller/admin/noderole.lua @@ -1,5 +1,5 @@ module("luci.controller.admin.noderole", package.seeall) function index() - entry({"admin", "noderole"}, cbi("admin/noderole"), "Verwendungszweck", 20) + entry({"admin", "noderole"}, cbi("admin/noderole"), "Node role", 20) end diff --git a/package/gluon-luci-node-role/files/usr/lib/lua/luci/model/cbi/admin/noderole.lua b/package/gluon-luci-node-role/files/usr/lib/lua/luci/model/cbi/admin/noderole.lua index 1d6d1798..48750508 100644 --- a/package/gluon-luci-node-role/files/usr/lib/lua/luci/model/cbi/admin/noderole.lua +++ b/package/gluon-luci-node-role/files/usr/lib/lua/luci/model/cbi/admin/noderole.lua @@ -1,23 +1,22 @@ local f, s, o local site = require 'gluon.site_config' +local i18n = require "luci.i18n" local uci = luci.model.uci.cursor() local config = 'gluon-node-info' -- where to read the configuration from local role = uci:get(config, uci:get_first(config, "system"), "role") -f = SimpleForm("role", "Verwendungszweck") +f = SimpleForm("role", i18n.translate("Node role")) f.reset = false f.template = "admin/expertmode" -f.submit = "Fertig" -s = f:section(SimpleSection, nil, [[ -Wenn dein Freifunk-Router eine besondere Rolle im Freifunk Netz einnimmt, kannst du diese hier angeben. -Bringe bitte zuvor in Erfahrung welche Auswirkungen die zur Verfügung stehenden Rollen im Freifunk-Netz haben. -Setze die Rolle nur, wenn du weißt was du machst. -]]) +s = f:section(SimpleSection, nil, i18n.translate( + "If this node has a special role within the freifunk network you can specify this role here. " + .. "Please find out about the available roles and their impact first. " + .. "Only change the role if you know what you are doing.")) -o = s:option(ListValue, "role", "Rolle") +o = s:option(ListValue, "role", i18n.translate("Role")) o.default = role o.rmempty = false for role, prettyname in pairs(site.roles.list) do diff --git a/package/gluon-luci-node-role/i18n/de.po b/package/gluon-luci-node-role/i18n/de.po new file mode 100644 index 00000000..e3037b26 --- /dev/null +++ b/package/gluon-luci-node-role/i18n/de.po @@ -0,0 +1,27 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"PO-Revision-Date: 2015-04-26 17:18+0200\n" +"Last-Translator: Tobias Hachmer \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 "Node role" +msgstr "Verwendungszweck" + +msgid "Role" +msgstr "Rolle" + +msgid "" +"If this node has a special role within the freifunk network you can specify " +"this role here. Please find out about the available roles and their impact " +"first. Only change the role if you know what you are doing." +msgstr "" +"Wenn dein Freifunk-Knoten eine besondere Rolle im Freifunk Netz einnimmt, " +"kannst du diese hier angeben. Bringe bitte zuvor in Erfahrung, welche " +"Auswirkungen die zur Verfügung stehenden Rollen im Freifunk-Netz haben. " +"Setze die Rolle nur, wenn du weißt was du machst." diff --git a/package/gluon-luci-node-role/i18n/gluon-luci-node-role.pot b/package/gluon-luci-node-role/i18n/gluon-luci-node-role.pot new file mode 100644 index 00000000..acf6dd79 --- /dev/null +++ b/package/gluon-luci-node-role/i18n/gluon-luci-node-role.pot @@ -0,0 +1,14 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "Node role" +msgstr "" + +msgid "Role" +msgstr "" + +msgid "" +"If this node has a special role within the freifunk network you can specify this role here. " +"Please find out about the available roles and their impact first. " +"Only change the role if you know what you are doing." +msgstr "" From 25d8b18f7ae007b654db9bd8747db34c24765361 Mon Sep 17 00:00:00 2001 From: kokel Date: Tue, 28 Apr 2015 06:43:11 +0200 Subject: [PATCH 2/2] gluon-luci-node-role: activate reset button --- .../files/usr/lib/lua/luci/model/cbi/admin/noderole.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/package/gluon-luci-node-role/files/usr/lib/lua/luci/model/cbi/admin/noderole.lua b/package/gluon-luci-node-role/files/usr/lib/lua/luci/model/cbi/admin/noderole.lua index 48750508..d2ab51a7 100644 --- a/package/gluon-luci-node-role/files/usr/lib/lua/luci/model/cbi/admin/noderole.lua +++ b/package/gluon-luci-node-role/files/usr/lib/lua/luci/model/cbi/admin/noderole.lua @@ -8,7 +8,6 @@ local config = 'gluon-node-info' local role = uci:get(config, uci:get_first(config, "system"), "role") f = SimpleForm("role", i18n.translate("Node role")) -f.reset = false f.template = "admin/expertmode" s = f:section(SimpleSection, nil, i18n.translate(