gluon-config-mode-geo-location: revise altitude label overrides

As already done with other config mode texts, the altitude field now has
default texts that are used when they are not set in the site i18n files.
The altitude-help text has been removed from site i18n; instead, the
geo-location-help text now overrides the whole section description
including the part that mentions the altitude.
This commit is contained in:
Matthias Schiffer 2018-08-19 20:58:26 +02:00
parent b4346ff9e6
commit a72cf0b86b
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
9 changed files with 66 additions and 51 deletions

View File

@ -60,14 +60,6 @@ msgstr ""
"Mode neustarten.</p>"
"<p>Viel Spaß mit deinem Knoten und der Erkundung von Freifunk!</p>"
msgid "gluon-config-mode:altitude-label"
msgstr "Höhe"
msgid "gluon-config-mode:altitude-help"
msgstr ""
"Die Höhenangabe ist optional und sollte nur gesetzt werden, wenn ein "
"exakter Wert bekannt ist."
# Leave empty to use the default text, which can be found in:
# package/gluon-config-mode-hostname/i18n/
msgid "gluon-config-mode:hostname-help"
@ -78,6 +70,9 @@ msgstr ""
msgid "gluon-config-mode:geo-location-help"
msgstr ""
msgid "gluon-config-mode:altitude-label"
msgstr ""
# Leave empty to use the default text, which can be found in:
# package/gluon-config-mode-contact-info/i18n/
msgid "gluon-config-mode:contact-help"

View File

@ -55,14 +55,6 @@ msgstr ""
"mode.</p>"
"<p>Have fun with your node and exploring of the Freifunk network!</p>"
msgid "gluon-config-mode:altitude-label"
msgstr "Altitude"
msgid "gluon-config-mode:altitude-help"
msgstr ""
"Specifying the altitude is optional and should only be done if a proper "
"value is known."
# Leave empty to use the default text, which can be found in:
# package/gluon-config-mode-hostname/i18n/
msgid "gluon-config-mode:hostname-help"
@ -73,6 +65,9 @@ msgstr ""
msgid "gluon-config-mode:geo-location-help"
msgstr ""
msgid "gluon-config-mode:altitude-label"
msgstr ""
# Leave empty to use the default text, which can be found in:
# package/gluon-config-mode-contact-info/i18n/
msgid "gluon-config-mode:contact-help"

View File

@ -55,14 +55,6 @@ msgstr ""
"redémarer en mode configuration.</p> "
"<p>Profitez votre de nœud et amusez vous à découvrir le réseau Freifunk!</p>"
msgid "gluon-config-mode:altitude-label"
msgstr "Hauteur"
msgid "gluon-config-mode:altitude-help"
msgstr ""
"La altitude est optionelle et ne devrait que être ajoutée si la valeur "
"exacte est connue."
# Leave empty to use the default text, which can be found in:
# package/gluon-config-mode-hostname/i18n/
msgid "gluon-config-mode:hostname-help"
@ -73,6 +65,9 @@ msgstr ""
msgid "gluon-config-mode:geo-location-help"
msgstr ""
msgid "gluon-config-mode:altitude-label"
msgstr ""
# Leave empty to use the default text, which can be found in:
# package/gluon-config-mode-contact-info/i18n/
msgid "gluon-config-mode:contact-help"

View File

@ -19,10 +19,13 @@ msgstr ""
msgid "gluon-config-mode:reboot"
msgstr ""
msgid "gluon-config-mode:altitude-label"
msgid "gluon-config-mode:hostname-help"
msgstr ""
msgid "gluon-config-mode:altitude-help"
msgid "gluon-config-mode:geo-location-help"
msgstr ""
msgid "gluon-config-mode:altitude-label"
msgstr ""
msgid "gluon-config-mode:contact-help"
@ -30,9 +33,3 @@ msgstr ""
msgid "gluon-config-mode:contact-note"
msgstr ""
msgid "gluon-config-mode:hostname-help"
msgstr ""
msgid "gluon-config-mode:geo-location-help"
msgstr ""

View File

@ -403,10 +403,9 @@ config_mode \: optional
and the node's primary MAC address is assigned. Manually setting a hostname
can be enforced by setting *hostname.optional* to *false*.
By default, no altitude fields are shown by the *gluon-config-mode-geo-location*
package. If *geo_location.show_altitude* is set to *true*, the *gluon-config-mode:altitude-label*
and *gluon-config-mode:altitude-help* strings must be provided in the site i18n
data as well.
By default, no altitude field is shown by the *gluon-config-mode-geo-location*
package. Set *geo_location.show_altitude* to *true* if you want the altitude
field to be visible.
The remote login page only shows SSH key configuration by default. A
password form can be displayed by setting *remote_login.show_password_form*
@ -580,12 +579,6 @@ gluon-config-mode:pubkey
gluon-config-mode:novpn
Information shown on the reboot page, if the mesh VPN was not selected.
gluon-config-mode:altitude-label
Label for the ``altitude`` field
gluon-config-mode:altitude-help
Description for the usage of the ``altitude`` field
gluon-config-mode:contact-help
Description for the usage of the ``contact`` field
@ -596,7 +589,10 @@ gluon-config-mode:hostname-help
Description for the usage of the ``hostname`` field
gluon-config-mode:geo-location-help
Description for the usage of the longitude/latitude fields
Description for the usage of the longitude/latitude fields (and altitude, if shown)
gluon-config-mode:altitude-label
Label for the ``altitude`` field
gluon-config-mode:reboot
General information shown on the reboot page.

View File

@ -10,6 +10,9 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "Altitude"
msgstr "Höhe"
msgid ""
"If you want the location of your node to be displayed on the map, you can "
"enter its coordinates here."
@ -26,5 +29,12 @@ msgstr "Längengrad"
msgid "Show node on the map"
msgstr "Knoten auf der Karte anzeigen"
msgid ""
"Specifying the altitude is optional; it should only be filled in if a "
"accurate value is known."
msgstr ""
"Die Höhenangabe ist optional und sollte nur gesetzt werden, wenn ein "
"exakter Wert bekannt ist."
msgid "e.g. %s"
msgstr "z.B. %s"

View File

@ -1,15 +1,18 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-08-12 23:30+0100\n"
"Last-Translator:Tobias Bernot <tqbs@airmail.cc>\n"
"Language-Team: French\n"
"Language: fr\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 "Altitude"
msgstr "Hauteur"
msgid ""
"If you want the location of your node to be displayed on the map, you can "
"enter its coordinates here."
@ -26,5 +29,12 @@ msgstr "Longitude"
msgid "Show node on the map"
msgstr "Afficher le nœud sur la carte"
msgid ""
"Specifying the altitude is optional; it should only be filled in if a "
"accurate value is known."
msgstr ""
"La altitude est optionelle et ne devrait que être ajoutée si la valeur "
"exacte est connue."
msgid "e.g. %s"
msgstr "Ex: %s"

View File

@ -1,6 +1,9 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Altitude"
msgstr ""
msgid ""
"If you want the location of your node to be displayed on the map, you can "
"enter its coordinates here."
@ -15,5 +18,10 @@ msgstr ""
msgid "Show node on the map"
msgstr ""
msgid ""
"Specifying the altitude is optional; it should only be filled in if a "
"accurate value is known."
msgstr ""
msgid "e.g. %s"
msgstr ""

View File

@ -8,12 +8,18 @@ return function(form, uci)
local show_altitude = site.config_mode.geo_location.show_altitude(false)
local text = site_i18n._translate("gluon-config-mode:geo-location-help") or pkg_i18n.translate(
'If you want the location of your node to ' ..
'be displayed on the map, you can enter its coordinates here.'
)
if show_altitude then
text = text .. ' ' .. site_i18n.translate("gluon-config-mode:altitude-help")
local text = site_i18n._translate("gluon-config-mode:geo-location-help")
if not text then
text = pkg_i18n.translate(
'If you want the location of your node to ' ..
'be displayed on the map, you can enter its coordinates here.'
)
if show_altitude then
text = text .. ' ' .. pkg_i18n.translate(
'Specifying the altitude is optional; it should only be filled in if a accurate ' ..
'value is known.'
)
end
end
local s = form:section(Section, nil, text)
@ -48,7 +54,10 @@ return function(form, uci)
end
if show_altitude then
o = s:option(Value, "altitude", site_i18n.translate("gluon-config-mode:altitude-label"), pkg_i18n.translatef("e.g. %s", "11.51"))
o = s:option(Value, "altitude",
site_i18n._translate("gluon-config-mode:altitude-label") or pkg_i18n.translate("Altitude"),
pkg_i18n.translatef("e.g. %s", "11.51")
)
o.default = uci:get("gluon-node-info", location, "altitude")
o:depends(share_location, true)
o.datatype = "float"