Rename Altitude to Storey
This commit is contained in:
parent
a7c77f6e20
commit
bae9eb7fe9
@ -7,8 +7,9 @@ local M = {}
|
||||
function M.section(form)
|
||||
local s = form:section(cbi.SimpleSection, nil, i18n.translate(
|
||||
'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 only be done if a proper value is known.'))
|
||||
.. 'you can enter its coordinates here. Specifying the storey '
|
||||
.. 'is optional and can be aproximated by an imaginary storey with '
|
||||
.. '3m per storey.'))
|
||||
|
||||
|
||||
local o
|
||||
@ -31,8 +32,8 @@ function M.section(form)
|
||||
o.datatype = "float"
|
||||
o.description = i18n.translatef("e.g. %s", "10.689901")
|
||||
|
||||
o = s:option(cbi.Value, "_altitude", i18n.translate("Altitude"))
|
||||
o.default = uci:get_first("gluon-node-info", "location", "altitude")
|
||||
o = s:option(cbi.Value, "_storey", i18n.translate("Storey"))
|
||||
o.default = uci:get_first("gluon-node-info", "location", "storey")
|
||||
o:depends("_location", "1")
|
||||
o.rmempty = true
|
||||
o.datatype = "float"
|
||||
@ -47,10 +48,10 @@ function M.handle(data)
|
||||
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, "longitude", data._longitude:trim())
|
||||
if data._altitude ~= nil then
|
||||
uci:set("gluon-node-info", sname, "altitude", data._altitude:trim())
|
||||
if data._storey ~= nil then
|
||||
uci:set("gluon-node-info", sname, "storey", data._storey:trim())
|
||||
else
|
||||
uci:delete("gluon-node-info", sname, "altitude")
|
||||
uci:delete("gluon-node-info", sname, "storey")
|
||||
end
|
||||
end
|
||||
uci:save("gluon-node-info")
|
||||
|
@ -12,13 +12,12 @@ msgstr ""
|
||||
|
||||
msgid ""
|
||||
"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 "
|
||||
"only be done if a proper value is known."
|
||||
"enter its coordinates here. Specifying the storey is optional and can be "
|
||||
"aproximated by an imaginary storey with 3m per storey."
|
||||
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. Die "
|
||||
"Höhenangabe ist optional und sollte nur gesetzt werden, wenn ein exakter "
|
||||
"Wert bekannt ist."
|
||||
"Stockwerk ist optional und kann geschätzt werden mit gedachten Stockwerken à 3m Höhe."
|
||||
|
||||
msgid "Latitude"
|
||||
msgstr "Breitengrad"
|
||||
@ -26,8 +25,8 @@ msgstr "Breitengrad"
|
||||
msgid "Longitude"
|
||||
msgstr "Längengrad"
|
||||
|
||||
msgid "Altitude"
|
||||
msgstr "Höhe"
|
||||
msgid "Storey"
|
||||
msgstr "Stockwerk"
|
||||
|
||||
msgid "Show node on the map"
|
||||
msgstr "Knoten auf der Karte anzeigen"
|
||||
|
@ -12,12 +12,11 @@ msgstr ""
|
||||
|
||||
msgid ""
|
||||
"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 "
|
||||
"only be done if a proper value is known."
|
||||
"enter its coordinates here. Specifying the storey is optional and can be "
|
||||
"aproximated by an imaginary storey with 3m per storey."
|
||||
msgstr ""
|
||||
"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 "
|
||||
"et ne devrait que être ajoutée si la valeur exacte est connue. "
|
||||
"Ici vous pouvez entrer sa position. La storey est optionelle. "
|
||||
|
||||
msgid "Latitude"
|
||||
msgstr "Latitude"
|
||||
@ -25,7 +24,7 @@ msgstr "Latitude"
|
||||
msgid "Longitude"
|
||||
msgstr "Longitude"
|
||||
|
||||
msgid "Altitude"
|
||||
msgid "Storey"
|
||||
msgstr "Hauteur"
|
||||
|
||||
msgid "Show node on the map"
|
||||
|
@ -3,8 +3,8 @@ msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
msgid ""
|
||||
"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 "
|
||||
"only be done if a proper value is known."
|
||||
"enter its coordinates here. Specifying the storey is optional and can be "
|
||||
"aproximated by an imaginary storey with 3m per storey."
|
||||
msgstr ""
|
||||
|
||||
msgid "Latitude"
|
||||
@ -13,7 +13,7 @@ msgstr ""
|
||||
msgid "Longitude"
|
||||
msgstr ""
|
||||
|
||||
msgid "Altitude"
|
||||
msgid "Storey"
|
||||
msgstr ""
|
||||
|
||||
msgid "Show node on the map"
|
||||
|
@ -3,7 +3,7 @@ local uci = require('luci.model.uci').cursor()
|
||||
|
||||
local sname = uci:get_first('gluon-node-info', 'location')
|
||||
if sname then
|
||||
local options = {'longitude', 'latitude', 'altitude'}
|
||||
local options = {'longitude', 'latitude', 'storey'}
|
||||
for _, option in ipairs(options) do
|
||||
local value = uci:get('gluon-node-info', sname, option)
|
||||
if value then
|
||||
|
@ -86,9 +86,9 @@ static struct json_object * get_location(struct uci_context *ctx, struct uci_pac
|
||||
if (longitude)
|
||||
json_object_object_add(ret, "longitude", longitude);
|
||||
|
||||
struct json_object *altitude = get_number(ctx, s, "altitude");
|
||||
if (altitude)
|
||||
json_object_object_add(ret, "altitude", altitude);
|
||||
struct json_object *storey = get_number(ctx, s, "storey");
|
||||
if (storey)
|
||||
json_object_object_add(ret, "storey", storey);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user