Quellcode durchsuchen

gluon-luci-portconfig: i18n

Matthias Schiffer vor 9 Jahren
Ursprung
Commit
cdc16af1bd

+ 6 - 6
package/gluon-luci-portconfig/Makefile

@@ -4,12 +4,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gluon-luci-portconfig
-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-portconfig
   SECTION:=gluon
@@ -18,10 +20,6 @@ define Package/gluon-luci-portconfig
   DEPENDS:=+gluon-luci-admin +gluon-mesh-batman-adv
 endef
 
-define Package/gluon-luci-portconfig/description
-	Luci module for advanced ethernet port configuration
-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-portconfig,i18n)
 endef
 
 define Package/gluon-luci-portconfig/install
 	$(CP) ./files/* $(1)/
+	$(call GluonInstallI18N,gluon-luci-portconfig,$(1))
 endef
 
 $(eval $(call BuildPackage,gluon-luci-portconfig))

+ 1 - 2
package/gluon-luci-portconfig/files/usr/lib/lua/luci/controller/admin/portconfig.lua

@@ -15,6 +15,5 @@ $Id$
 module("luci.controller.admin.portconfig", package.seeall)
 
 function index()
-        entry({"admin", "portconfig"}, cbi("admin/portconfig"), _("Schnittstellen"), 20)
+        entry({"admin", "portconfig"}, cbi("admin/portconfig"), _("Network"), 20)
 end
-

+ 16 - 18
package/gluon-luci-portconfig/files/usr/lib/lua/luci/model/cbi/admin/portconfig.lua

@@ -18,35 +18,33 @@ local wan = uci:get_all("network", "wan")
 local wan6 = uci:get_all("network", "wan6")
 local dns = uci:get_first("gluon-wan-dnsmasq", "static")
 
-local f = SimpleForm("portconfig", "WAN-Verbindung")
+local f = SimpleForm("portconfig", translate("WAN connection"))
 f.template = "admin/expertmode"
-f.submit = "Speichern"
-f.reset = "Zurücksetzen"
 
 local s
 local o
 
 s = f:section(SimpleSection, nil, nil)
 
-o = s:option(ListValue, "ipv4", "IPv4")
-o:value("dhcp", "Automatisch (DHCP)")
-o:value("static", "Statisch")
-o:value("none", "Deaktiviert")
+o = s:option(ListValue, "ipv4", translate("IPv4"))
+o:value("dhcp", translate("Automatic (DHCP)"))
+o:value("static", translate("Static"))
+o:value("none", translate("Disabled"))
 o.default = wan.proto
 
-o = s:option(Value, "ipv4_addr", "IP-Adresse")
+o = s:option(Value, "ipv4_addr", translate("IP address"))
 o:depends("ipv4", "static")
 o.value = wan.ipaddr
 o.datatype = "ip4addr"
 o.rmempty = false
 
-o = s:option(Value, "ipv4_netmask", "Netzmaske")
+o = s:option(Value, "ipv4_netmask", translate("Netmask"))
 o:depends("ipv4", "static")
 o.value = wan.netmask or "255.255.255.0"
 o.datatype = "ip4addr"
 o.rmempty = false
 
-o = s:option(Value, "ipv4_gateway", "Gateway")
+o = s:option(Value, "ipv4_gateway", translate("Gateway"))
 o:depends("ipv4", "static")
 o.value = wan.gateway
 o.datatype = "ip4addr"
@@ -55,19 +53,19 @@ o.rmempty = false
 
 s = f:section(SimpleSection, nil, nil)
 
-o = s:option(ListValue, "ipv6", "IPv6")
-o:value("dhcpv6", "Automatisch (RA/DHCPv6)")
-o:value("static", "Statisch")
-o:value("none", "Deaktiviert")
+o = s:option(ListValue, "ipv6", translate("IPv6"))
+o:value("dhcpv6", translate("Automatic (RA/DHCPv6)"))
+o:value("static", translate("Static"))
+o:value("none", translate("Disabled"))
 o.default = wan6.proto
 
-o = s:option(Value, "ipv6_addr", "IP-Adresse")
+o = s:option(Value, "ipv6_addr", translate("IP address"))
 o:depends("ipv6", "static")
 o.value = wan6.ip6addr
 o.datatype = "ip6addr"
 o.rmempty = false
 
-o = s:option(Value, "ipv6_gateway", "Gateway")
+o = s:option(Value, "ipv6_gateway", translate("Gateway"))
 o:depends("ipv6", "static")
 o.value = wan6.ip6gw
 o.datatype = "ip6addr"
@@ -77,14 +75,14 @@ o.rmempty = false
 if dns then
   s = f:section(SimpleSection, nil, nil)
 
-  o = s:option(DynamicList, "dns", "Statische DNS-Server")
+  o = s:option(DynamicList, "dns", translate("Static DNS servers"))
   o:write(nil, uci:get("gluon-wan-dnsmasq", dns, "server"))
   o.datatype = "ipaddr"
 end
 
 s = f:section(SimpleSection, nil, nil)
 
-o = s:option(Flag, "mesh_wan", "Mesh auf dem WAN-Port aktivieren")
+o = s:option(Flag, "mesh_wan", translate("Enable meshing on the WAN interface"))
 o.default = uci:get_bool("network", "mesh_wan", "auto") and o.enabled or o.disabled
 o.rmempty = false
 

+ 29 - 0
package/gluon-luci-portconfig/i18n/de.po

@@ -0,0 +1,29 @@
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2015-05-04 02:08+0200\n"
+"Last-Translator:  <mschiffer@universe-factory.net>\n"
+"Language-Team: German\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid "Automatic (DHCP)"
+msgstr "Automatisch (DHCP)"
+
+msgid "Automatic (RA/DHCPv6)"
+msgstr "Automatisch (RA/DHCPv6)"
+
+msgid "Enable meshing on the WAN interface"
+msgstr "Mesh auf dem WAN-Port aktivieren"
+
+msgid "Static"
+msgstr "Statisch"
+
+msgid "Static DNS servers"
+msgstr "Statische DNS-Server"
+
+msgid "WAN connection"
+msgstr "WAN-Verbindung"

+ 20 - 0
package/gluon-luci-portconfig/i18n/gluon-luci-portconfig.pot

@@ -0,0 +1,20 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "Automatic (DHCP)"
+msgstr ""
+
+msgid "Automatic (RA/DHCPv6)"
+msgstr ""
+
+msgid "Enable meshing on the WAN interface"
+msgstr ""
+
+msgid "Static"
+msgstr ""
+
+msgid "Static DNS servers"
+msgstr ""
+
+msgid "WAN connection"
+msgstr ""