Rename Altitude to Storey

This commit is contained in:
rubo77 2016-08-30 14:39:33 +02:00
parent a7c77f6e20
commit bae9eb7fe9
6 changed files with 24 additions and 25 deletions

View File

@ -7,8 +7,9 @@ local M = {}
function M.section(form) function M.section(form)
local s = form:section(cbi.SimpleSection, nil, i18n.translate( local s = form:section(cbi.SimpleSection, nil, i18n.translate(
'If you want the location of your node to be displayed on the map, ' 'If you want the location of your node to be displayed on the map, '
.. 'you can enter its coordinates here. Specifying the altitude ' .. 'you can enter its coordinates here. Specifying the storey '
.. 'is optional and should only be done if a proper value is known.')) .. 'is optional and can be aproximated by an imaginary storey with '
.. '3m per storey.'))
local o local o
@ -31,8 +32,8 @@ function M.section(form)
o.datatype = "float" o.datatype = "float"
o.description = i18n.translatef("e.g. %s", "10.689901") o.description = i18n.translatef("e.g. %s", "10.689901")
o = s:option(cbi.Value, "_altitude", i18n.translate("Altitude")) o = s:option(cbi.Value, "_storey", i18n.translate("Storey"))
o.default = uci:get_first("gluon-node-info", "location", "altitude") o.default = uci:get_first("gluon-node-info", "location", "storey")
o:depends("_location", "1") o:depends("_location", "1")
o.rmempty = true o.rmempty = true
o.datatype = "float" o.datatype = "float"
@ -47,10 +48,10 @@ function M.handle(data)
if data._location and data._latitude ~= nil and data._longitude ~= nil then if data._location and data._latitude ~= nil and data._longitude ~= nil then
uci:set("gluon-node-info", sname, "latitude", data._latitude:trim()) uci:set("gluon-node-info", sname, "latitude", data._latitude:trim())
uci:set("gluon-node-info", sname, "longitude", data._longitude:trim()) uci:set("gluon-node-info", sname, "longitude", data._longitude:trim())
if data._altitude ~= nil then if data._storey ~= nil then
uci:set("gluon-node-info", sname, "altitude", data._altitude:trim()) uci:set("gluon-node-info", sname, "storey", data._storey:trim())
else else
uci:delete("gluon-node-info", sname, "altitude") uci:delete("gluon-node-info", sname, "storey")
end end
end end
uci:save("gluon-node-info") uci:save("gluon-node-info")

View File

@ -12,13 +12,12 @@ msgstr ""
msgid "" msgid ""
"If you want the location of your node to be displayed on the map, you can " "If you want the location of your node to be displayed on the map, you can "
"enter its coordinates here. Specifying the altitude is optional and should " "enter its coordinates here. Specifying the storey is optional and can be "
"only be done if a proper value is known." "aproximated by an imaginary storey with 3m per storey."
msgstr "" msgstr ""
"Um deinen Knoten auf der Karte anzeigen zu können, benötigen wir seine " "Um deinen Knoten auf der Karte anzeigen zu können, benötigen wir seine "
"Koordinaten. Hier hast du die Möglichkeit, diese zu hinterlegen. Die " "Koordinaten. Hier hast du die Möglichkeit, diese zu hinterlegen. Die "
"Höhenangabe ist optional und sollte nur gesetzt werden, wenn ein exakter " "Stockwerk ist optional und kann geschätzt werden mit gedachten Stockwerken à 3m Höhe."
"Wert bekannt ist."
msgid "Latitude" msgid "Latitude"
msgstr "Breitengrad" msgstr "Breitengrad"
@ -26,8 +25,8 @@ msgstr "Breitengrad"
msgid "Longitude" msgid "Longitude"
msgstr "Längengrad" msgstr "Längengrad"
msgid "Altitude" msgid "Storey"
msgstr "Höhe" msgstr "Stockwerk"
msgid "Show node on the map" msgid "Show node on the map"
msgstr "Knoten auf der Karte anzeigen" msgstr "Knoten auf der Karte anzeigen"

View File

@ -12,12 +12,11 @@ msgstr ""
msgid "" msgid ""
"If you want the location of your node to be displayed on the map, you can " "If you want the location of your node to be displayed on the map, you can "
"enter its coordinates here. Specifying the altitude is optional and should " "enter its coordinates here. Specifying the storey is optional and can be "
"only be done if a proper value is known." "aproximated by an imaginary storey with 3m per storey."
msgstr "" msgstr ""
"Pour Afficher votre nœud sur la Carte nous avons besoin de ses coordonnées. " "Pour Afficher votre nœud sur la Carte nous avons besoin de ses coordonnées. "
"Ici vous pouvez entrer sa position. La altitude est optionelle " "Ici vous pouvez entrer sa position. La storey est optionelle. "
"et ne devrait que être ajoutée si la valeur exacte est connue. "
msgid "Latitude" msgid "Latitude"
msgstr "Latitude" msgstr "Latitude"
@ -25,7 +24,7 @@ msgstr "Latitude"
msgid "Longitude" msgid "Longitude"
msgstr "Longitude" msgstr "Longitude"
msgid "Altitude" msgid "Storey"
msgstr "Hauteur" msgstr "Hauteur"
msgid "Show node on the map" msgid "Show node on the map"

View File

@ -3,8 +3,8 @@ msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "" msgid ""
"If you want the location of your node to be displayed on the map, you can " "If you want the location of your node to be displayed on the map, you can "
"enter its coordinates here. Specifying the altitude is optional and should " "enter its coordinates here. Specifying the storey is optional and can be "
"only be done if a proper value is known." "aproximated by an imaginary storey with 3m per storey."
msgstr "" msgstr ""
msgid "Latitude" msgid "Latitude"
@ -13,7 +13,7 @@ msgstr ""
msgid "Longitude" msgid "Longitude"
msgstr "" msgstr ""
msgid "Altitude" msgid "Storey"
msgstr "" msgstr ""
msgid "Show node on the map" msgid "Show node on the map"

View File

@ -3,7 +3,7 @@ local uci = require('luci.model.uci').cursor()
local sname = uci:get_first('gluon-node-info', 'location') local sname = uci:get_first('gluon-node-info', 'location')
if sname then if sname then
local options = {'longitude', 'latitude', 'altitude'} local options = {'longitude', 'latitude', 'storey'}
for _, option in ipairs(options) do for _, option in ipairs(options) do
local value = uci:get('gluon-node-info', sname, option) local value = uci:get('gluon-node-info', sname, option)
if value then if value then

View File

@ -86,9 +86,9 @@ static struct json_object * get_location(struct uci_context *ctx, struct uci_pac
if (longitude) if (longitude)
json_object_object_add(ret, "longitude", longitude); json_object_object_add(ret, "longitude", longitude);
struct json_object *altitude = get_number(ctx, s, "altitude"); struct json_object *storey = get_number(ctx, s, "storey");
if (altitude) if (storey)
json_object_object_add(ret, "altitude", altitude); json_object_object_add(ret, "storey", storey);
return ret; return ret;
} }