Skip to content
Snippets Groups Projects
Commit c5296c41 authored by root's avatar root
Browse files
parents 80ad74f0 96c37ff5
No related branches found
No related tags found
No related merge requests found
...@@ -11,11 +11,7 @@ msgstr "" ...@@ -11,11 +11,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "gluon-config-mode:zip-help" msgid "gluon-config-mode:zip-help"
"Some nice Text about the ZIP-Code " msgstr "Ein Netter Text warum die PLZ benötigt wird."
"and how it help for subnetting."
msgstr ""
"Ein Netter Text warum die PLZ benötigt "
"wird."
msgid "ZIP-Code" msgid "ZIP-Code"
msgstr "PLZ" msgstr "PLZ"
......
msgid ""
msgstr ""
"Project-Id-Version: gluon-config-mode-zip\n"
"PO-Revision-Date: 2017-02-17 02:18+0100\n"
"Last-Translator: Philippe Käufer <freifunk@philhil.de>\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 "gluon-config-mode:zip-help"
msgstr "Some nice Text about the ZIP-Code "
"and how it help for subnetting."
msgid "ZIP-Code"
msgstr "ZIP-Code"
msgid "e.g. %s"
msgstr "e.g. %s"
...@@ -2,8 +2,6 @@ msgid "" ...@@ -2,8 +2,6 @@ msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8" msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "gluon-config-mode:zip-help" msgid "gluon-config-mode:zip-help"
"Some nice Text about the ZIP-Code "
"and how it help for subnetting."
msgstr "" msgstr ""
msgid "ZIP-Code" msgid "ZIP-Code"
......
...@@ -6,22 +6,26 @@ local M = {} ...@@ -6,22 +6,26 @@ local M = {}
function M.section(form) function M.section(form)
local text = i18n.translate("gluon-config-mode:zip-help") local text = i18n.translate("gluon-config-mode:zip-help")
local fieldlabel = i18n.translate("ZIP-Code")
local s = form:section(cbi.SimpleSection, nil, text) local s = form:section(cbi.SimpleSection, nil, text)
local o = s:option(cbi.Value, "_zip", "ZIP-Code") local o = s:option(cbi.Value, "_zip", fieldlabel)
o.value = uci:get_first("gluon-node-info", "location", "zip") o.value = uci:get_first("gluon-node-info", "location", "zip")
o.rmempty = false o.rmempty = true
o.datatype = "float" o.datatype = "float"
o.description = i18n.translatef("e.g. %s", "70499") o.description = i18n.translatef("e.g. %s", "70499")
end end
function M.handle(data) function M.handle(data)
local sname = uci:get_first("gluon-node-info", "location") local sname = uci:get_first("gluon-node-info", "location")
if data._zip ~= nil then
uci:set("gluon-node-info", sname, "zip", data._zip:trim()) uci:set("gluon-node-info", sname, "zip", data._zip:trim())
else
uci:delete("gluon-node-info", sname, "zip")
end
uci:save("gluon-node-info") uci:save("gluon-node-info")
uci:commit("gluon-node-info") uci:commit("gluon-node-info")
end end
return M return M
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment