From a02d7ad8005268a3a0200878008740f1932680c7 Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Mon, 4 May 2015 02:29:03 +0200
Subject: [PATCH] gluon-luci-private-wifi: i18n

---
 package/gluon-luci-private-wifi/Makefile      |  8 +++--
 .../lua/luci/controller/admin/privatewifi.lua |  2 +-
 .../lua/luci/model/cbi/admin/privatewifi.lua  | 22 ++++++-------
 package/gluon-luci-private-wifi/i18n/de.po    | 32 +++++++++++++++++++
 .../i18n/gluon-luci-private-wifi.pot          | 18 +++++++++++
 5 files changed, 67 insertions(+), 15 deletions(-)
 create mode 100644 package/gluon-luci-private-wifi/i18n/de.po
 create mode 100644 package/gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot

diff --git a/package/gluon-luci-private-wifi/Makefile b/package/gluon-luci-private-wifi/Makefile
index 0d5c4619c..604929ddc 100644
--- a/package/gluon-luci-private-wifi/Makefile
+++ b/package/gluon-luci-private-wifi/Makefile
@@ -1,12 +1,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gluon-luci-private-wifi
-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-private-wifi
   SECTION:=gluon
@@ -23,10 +25,12 @@ define Build/Configure
 endef
 
 define Build/Compile
+	$(call GluonBuildI18N,gluon-luci-private-wifi,i18n)
 endef
 
 define Package/gluon-luci-private-wifi/install
 	$(CP) ./files/* $(1)/
+	$(call GluonInstallI18N,gluon-luci-private-wifi,$(1))
 endef
 
 $(eval $(call BuildPackage,gluon-luci-private-wifi))
diff --git a/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/controller/admin/privatewifi.lua b/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/controller/admin/privatewifi.lua
index 0b10b4e92..e11ba58b7 100644
--- a/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/controller/admin/privatewifi.lua
+++ b/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/controller/admin/privatewifi.lua
@@ -1,5 +1,5 @@
 module("luci.controller.admin.privatewifi", package.seeall)
 
 function index()
-	entry({"admin", "privatewifi"}, cbi("admin/privatewifi"), "Privates WLAN", 10)
+	entry({"admin", "privatewifi"}, cbi("admin/privatewifi"), _("Private WLAN"), 10)
 end
diff --git a/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua b/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua
index b91573101..f2f003507 100644
--- a/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua
+++ b/package/gluon-luci-private-wifi/files/usr/lib/lua/luci/model/cbi/admin/privatewifi.lua
@@ -6,26 +6,24 @@ local config = 'wireless'
 local primary_iface = 'wan_radio0'
 local ssid = uci:get(config, primary_iface, "ssid")
 
-f = SimpleForm("wifi", "Privates WLAN")
-f.reset = false
+f = SimpleForm("wifi", translate("Private WLAN"))
 f.template = "admin/expertmode"
-f.submit = "Fertig"
 
-s = f:section(SimpleSection, nil, [[
-Dein Freifunk-Router kann ebenfalls die Reichweite deines privaten Netzes erweitern.
-Hierfür wird der WAN-Port mit einem seperaten WLAN gebridged.
-Diese Funktionalität ist völlig unabhängig von Freifunk.
-Beachte, dass du nicht gleichzeitig das Meshen über den WAN Port aktiviert haben solltest.
-]])
+s = f:section(SimpleSection, nil, translate(
+                'Your node can additionally extend your private network by bridging the WAN interface '
+                  .. 'with a seperate WLAN. This feature is completely independent of the mesh functionality. '
+                  .. 'Please note that the private WLAN and meshing on the WAN interface should not be enabled '
+                  .. 'at the same time.'
+))
 
-o = s:option(Flag, "enabled", "Aktiviert")
+o = s:option(Flag, "enabled", translate("Enabled"))
 o.default = (ssid and not uci:get_bool(config, primary_iface, "disabled")) and o.enabled or o.disabled
 o.rmempty = false
 
-o = s:option(Value, "ssid", "Name (SSID)")
+o = s:option(Value, "ssid", translate("Name (SSID)"))
 o.default = ssid
 
-o = s:option(Value, "key", "Schlüssel", "8-63 Zeichen")
+o = s:option(Value, "key", translate("Key"), translate("8-63 characters"))
 o.datatype = "wpakey"
 o.default = uci:get(config, primary_iface, "key")
 
diff --git a/package/gluon-luci-private-wifi/i18n/de.po b/package/gluon-luci-private-wifi/i18n/de.po
new file mode 100644
index 000000000..ccf513414
--- /dev/null
+++ b/package/gluon-luci-private-wifi/i18n/de.po
@@ -0,0 +1,32 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2015-05-04 02:25+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 "8-63 characters"
+msgstr "8-63 Zeichen"
+
+msgid "Name (SSID)"
+msgstr "Name (SSID)"
+
+msgid "Private WLAN"
+msgstr "Privates WLAN"
+
+msgid ""
+"Your node can additionally extend your private network by bridging the WAN "
+"interface with a seperate WLAN. This feature is completely independent of "
+"the mesh functionality. Please note that the private WLAN and meshing on the "
+"WAN interface should not be enabled at the same time."
+msgstr ""
+"Dein Knoten kann zusätzlich die Reichweite deines privaten Netzes erweitern. "
+"Hierfür wird der WAN-Port mit einem seperaten WLAN gebridged. Diese "
+"Funktionalität ist völlig unabhängig von den Mesh-Funktionen des Knotens. "
+"Beachte, dass du nicht gleichzeitig das Meshen über den WAN-Port aktiviert "
+"haben solltest."
diff --git a/package/gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot b/package/gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot
new file mode 100644
index 000000000..4051319f8
--- /dev/null
+++ b/package/gluon-luci-private-wifi/i18n/gluon-luci-private-wifi.pot
@@ -0,0 +1,18 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "8-63 characters"
+msgstr ""
+
+msgid "Name (SSID)"
+msgstr ""
+
+msgid "Private WLAN"
+msgstr ""
+
+msgid ""
+"Your node can additionally extend your private network by bridging the WAN "
+"interface with a seperate WLAN. This feature is completely independent of "
+"the mesh functionality. Please note that the private WLAN and meshing on the "
+"WAN interface should not be enabled at the same time."
+msgstr ""
-- 
GitLab