From 67b607d8829d8156ec855bbdce9e98c8fdf01ec0 Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 19 Mar 2015 02:10:08 +0100
Subject: [PATCH] gluon-config-mode-core: add translations

---
 package/gluon-config-mode-core/Makefile       |  2 ++
 .../model/cbi/gluon-config-mode/wizard.lua    |  2 +-
 .../view/gluon-config-mode/cbi/wizard.htm     | 34 ++++---------------
 .../luci/view/gluon-config-mode/reboot.htm    |  2 +-
 package/gluon-config-mode-core/i18n/de.po     | 24 +++++++++++++
 package/gluon-config-mode-core/i18n/en.po     | 24 +++++++++++++
 .../i18n/gluon-config-mode-core.pot           | 14 ++++++++
 7 files changed, 72 insertions(+), 30 deletions(-)
 create mode 100644 package/gluon-config-mode-core/i18n/de.po
 create mode 100644 package/gluon-config-mode-core/i18n/en.po
 create mode 100644 package/gluon-config-mode-core/i18n/gluon-config-mode-core.pot

diff --git a/package/gluon-config-mode-core/Makefile b/package/gluon-config-mode-core/Makefile
index 33ab8a902..510499624 100644
--- a/package/gluon-config-mode-core/Makefile
+++ b/package/gluon-config-mode-core/Makefile
@@ -28,10 +28,12 @@ define Build/Configure
 endef
 
 define Build/Compile
+	$(call GluonBuildI18N,gluon-config-mode-core)
 endef
 
 define Package/gluon-config-mode-core/install
 	$(CP) ./files/* $(1)/
+	$(call GluonInstallI18N,gluon-config-mode-core,$(1))
 endef
 
 define Package/gluon-config-mode-core/postinst
diff --git a/package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua b/package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua
index dd6029b45..706543b23 100644
--- a/package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua
+++ b/package/gluon-config-mode-core/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua
@@ -1,4 +1,5 @@
 local wizard_dir = "/lib/gluon/config-mode/wizard/"
+local i18n = luci.i18n
 local uci = luci.model.uci.cursor()
 local fs = require "luci.fs"
 local f, s
@@ -17,7 +18,6 @@ end
 f = SimpleForm("wizard")
 f.reset = false
 f.template = "gluon-config-mode/cbi/wizard"
-f.submit = "Speichern &amp; Neustarten"
 
 for _, s in ipairs(wizard) do
   s.section(f)
diff --git a/package/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm b/package/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm
index cadfb0069..ee0b2f8ef 100644
--- a/package/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm
+++ b/package/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon-config-mode/cbi/wizard.htm
@@ -4,7 +4,7 @@
 	local template = require 'luci.template'
 -%>
 
-<h2>Willkommen!</h2>
+<h2><%:Welcome!%></h2>
 <p>
 	<%= template.render_string(site.config_mode.msg_welcome, {hostname=hostname, sysconfig=sysconfig}) %>
 </p>
@@ -31,37 +31,15 @@
 <% if not self.embedded then %>
 	<div class="cbi-page-actions">
 <%-
-	if type(self.hidden) == "table" then
-		for k, v in pairs(self.hidden) do
+		if type(self.hidden) == "table" then
+		  for k, v in pairs(self.hidden) do
 -%>
-	<input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
+		<input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
 <%-
+		  end
 		end
-	end
 %>
-<% if redirect then %>
-	<div style="float:left">
-		<input class="cbi-button cbi-button-link" type="button" value="<%:Back to Overview%>" onclick="location.href='<%=pcdata(redirect)%>'" />
-	</div>
-<% end %>
-<%- if self.flow and self.flow.skip then %>
-	<input class="cbi-button cbi-button-skip" type="submit" name="cbi.skip" value="<%:Skip%>" />
-<% end %>
-<%- if self.submit ~= false then %>
-	<input class="cbi-button cbi-button-save" type="submit" value="
-		<%- if not self.submit then -%><%-:Submit-%><%-else-%><%=self.submit%><%end-%>
-	" />
-<% end %>
-<%- if self.reset ~= false then %>
-	<input class="cbi-button cbi-button-reset" type="reset" value="
-		<%- if not self.reset then -%><%-:Reset-%><%-else-%><%=self.reset%><%end-%>
-	" />
-<% end %>
-<%- if self.cancel ~= false and self.on_cancel then %>
-	<input class="cbi-button cbi-button-reset" type="submit" name="cbi.cancel" value="
-		<%- if not self.cancel then -%><%-:Cancel-%><%-else-%><%=self.cancel%><%end-%>
-	" />
-<% end %>
+		<input class="cbi-button cbi-button-save" type="submit" value="<%:Save & restart%>" />
 		<script type="text/javascript">cbi_d_update();</script>
 	</div>
 </form>
diff --git a/package/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm b/package/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm
index dd547f35e..e8f32d995 100644
--- a/package/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm
+++ b/package/gluon-config-mode-core/files/usr/lib/lua/luci/view/gluon-config-mode/reboot.htm
@@ -9,7 +9,7 @@
   <body>
     <div id="maincontainer">
       <div id="maincontent">
-        <h2>Dein Freifunkknoten ist nun fertig eingerichtet.</h2>
+        <h2><%:Your node's setup is now complete.%></h2>
         <% for k, v in ipairs(parts) do v() end %>
       </div>
     </div>
diff --git a/package/gluon-config-mode-core/i18n/de.po b/package/gluon-config-mode-core/i18n/de.po
new file mode 100644
index 000000000..6f852f435
--- /dev/null
+++ b/package/gluon-config-mode-core/i18n/de.po
@@ -0,0 +1,24 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2015-03-19 02:07+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"
+
+#, fuzzy
+msgid "Save & restart"
+msgstr "Speichern & Neustarten"
+
+msgid "Welcome!"
+msgstr "Willkommen!"
+
+msgid "Wizard"
+msgstr "Wizard"
+
+msgid "Your node's setup is now complete."
+msgstr "Dein Freifunkknoten ist nun fertig eingerichtet."
diff --git a/package/gluon-config-mode-core/i18n/en.po b/package/gluon-config-mode-core/i18n/en.po
new file mode 100644
index 000000000..d0758a048
--- /dev/null
+++ b/package/gluon-config-mode-core/i18n/en.po
@@ -0,0 +1,24 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2015-03-19 02:07+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"
+
+#, fuzzy
+msgid "Save & restart"
+msgstr "Save & restart"
+
+msgid "Welcome!"
+msgstr "Welcome!"
+
+msgid "Wizard"
+msgstr "Wizard"
+
+msgid "Your node's setup is now complete."
+msgstr "Your node's setup is now complete."
diff --git a/package/gluon-config-mode-core/i18n/gluon-config-mode-core.pot b/package/gluon-config-mode-core/i18n/gluon-config-mode-core.pot
new file mode 100644
index 000000000..a80d3b973
--- /dev/null
+++ b/package/gluon-config-mode-core/i18n/gluon-config-mode-core.pot
@@ -0,0 +1,14 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+msgid "Save & restart"
+msgstr ""
+
+msgid "Welcome!"
+msgstr ""
+
+msgid "Wizard"
+msgstr ""
+
+msgid "Your node's setup is now complete."
+msgstr ""
-- 
GitLab