From 613dceaa25dfe5dceb86fe7146dfa67e8e86b15a Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 19 Mar 2015 01:08:38 +0100
Subject: [PATCH] gluon-config-mode-geo-location: add translations

---
 .../gluon-config-mode-geo-location/Makefile   |  5 ++++
 .../config-mode/wizard/0400-geo-location.lua  | 15 +++++-----
 .../gluon-config-mode-geo-location/i18n/de.po | 30 +++++++++++++++++++
 .../gluon-config-mode-geo-location/i18n/en.po | 30 +++++++++++++++++++
 .../i18n/gluon-config-mode-geo-location.pot   | 19 ++++++++++++
 5 files changed, 91 insertions(+), 8 deletions(-)
 create mode 100644 package/gluon-config-mode-geo-location/i18n/de.po
 create mode 100644 package/gluon-config-mode-geo-location/i18n/en.po
 create mode 100644 package/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot

diff --git a/package/gluon-config-mode-geo-location/Makefile b/package/gluon-config-mode-geo-location/Makefile
index ba30542af..4ce31f120 100644
--- a/package/gluon-config-mode-geo-location/Makefile
+++ b/package/gluon-config-mode-geo-location/Makefile
@@ -7,6 +7,9 @@ PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
 include $(GLUONDIR)/include/package.mk
 
+PKG_CONFIG_DEPENDS += $(GLUON_I18N_CONFIG)
+
+
 define Package/gluon-config-mode-geo-location
   SECTION:=gluon
   CATEGORY:=Gluon
@@ -22,10 +25,12 @@ define Build/Configure
 endef
 
 define Build/Compile
+	$(call GluonBuildI18N,gluon-config-mode-geo-location)
 endef
 
 define Package/gluon-config-mode-geo-location/install
 	$(CP) ./files/* $(1)/
+	$(call GluonInstallI18N,gluon-config-mode-geo-location,$(1))
 endef
 
 $(eval $(call BuildPackage,gluon-config-mode-geo-location))
diff --git a/package/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua b/package/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua
index 6afd317c4..ef60ae66c 100644
--- a/package/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua
+++ b/package/gluon-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua
@@ -1,33 +1,32 @@
 local cbi = require "luci.cbi"
+local i18n = require "luci.i18n"
 local uci = luci.model.uci.cursor()
 
 local M = {}
 
 function M.section(form)
   local s = form:section(cbi.SimpleSection, nil,
-    [[Um deinen Knoten auf der Karte anzeigen zu können, benötigen
-    wir seine Koordinaten. Hier hast du die Möglichkeit, diese zu
-    hinterlegen.]])
+    i18n.translate("If you want your node to be displayed on the map, you can enter its coodinates here."))
 
   local o
 
-  o = s:option(cbi.Flag, "_location", "Knoten auf der Karte anzeigen")
+  o = s:option(cbi.Flag, "_location", i18n.translate("Show node on the map"))
   o.default = uci:get_first("gluon-node-info", "location", "share_location", o.disabled)
   o.rmempty = false
 
-  o = s:option(cbi.Value, "_latitude", "Breitengrad")
+  o = s:option(cbi.Value, "_latitude", i18n.translate("Latitude"))
   o.default = uci:get_first("gluon-node-info", "location", "latitude")
   o:depends("_location", "1")
   o.rmempty = false
   o.datatype = "float"
-  o.description = "z.B. 53.873621"
+  o.description = i18n.translatef("e.g. %s", "53.873621")
 
-  o = s:option(cbi.Value, "_longitude", "Längengrad")
+  o = s:option(cbi.Value, "_longitude", i18n.translate("Longitude"))
   o.default = uci:get_first("gluon-node-info", "location", "longitude")
   o:depends("_location", "1")
   o.rmempty = false
   o.datatype = "float"
-  o.description = "z.B. 10.689901"
+  o.description = i18n.translatef("e.g. %s", "10.689901")
 end
 
 function M.handle(data)
diff --git a/package/gluon-config-mode-geo-location/i18n/de.po b/package/gluon-config-mode-geo-location/i18n/de.po
new file mode 100644
index 000000000..085730260
--- /dev/null
+++ b/package/gluon-config-mode-geo-location/i18n/de.po
@@ -0,0 +1,30 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2015-03-19 01:05+0100\n"
+"Last-Translator: Matthias Schiffer <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 ""
+"If you want your node to be displayed on the map, you can enter its "
+"coodinates here."
+msgstr ""
+"Um deinen Knoten auf der Karte anzeigen zu können, benötigen wir seine "
+"Koordinaten. Hier hast du die Möglichkeit, diese zu hinterlegen."
+
+msgid "Latitude"
+msgstr "Breitengrad"
+
+msgid "Longitude"
+msgstr "Längengrad"
+
+msgid "Show node on the map"
+msgstr "Knoten auf der Karte anzeigen"
+
+msgid "e.g. %s"
+msgstr "z.B. %s"
diff --git a/package/gluon-config-mode-geo-location/i18n/en.po b/package/gluon-config-mode-geo-location/i18n/en.po
new file mode 100644
index 000000000..aaed7e1ae
--- /dev/null
+++ b/package/gluon-config-mode-geo-location/i18n/en.po
@@ -0,0 +1,30 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2015-03-19 01:04+0100\n"
+"Last-Translator: Matthias Schiffer <mschiffer@universe-factory.net>\n"
+"Language-Team: English\n"
+"Language: en\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 ""
+"If you want your node to be displayed on the map, you can enter its "
+"coodinates here."
+msgstr ""
+"If you want your node to be displayed on the map, you can enter its "
+"coodinates here."
+
+msgid "Latitude"
+msgstr "Latitude"
+
+msgid "Longitude"
+msgstr "Longitude"
+
+msgid "Show node on the map"
+msgstr "Show node on the map"
+
+msgid "e.g. %s"
+msgstr "e.g. %s"
diff --git a/package/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot b/package/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot
new file mode 100644
index 000000000..6881b3663
--- /dev/null
+++ b/package/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot
@@ -0,0 +1,19 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid ""
+"If you want your node to be displayed on the map, you can enter its "
+"coodinates here."
+msgstr ""
+
+msgid "Latitude"
+msgstr ""
+
+msgid "Longitude"
+msgstr ""
+
+msgid "Show node on the map"
+msgstr ""
+
+msgid "e.g. %s"
+msgstr ""
-- 
GitLab