From a72cf0b86b836ce2a4e846a97df94ddaea48bd21 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer <mschiffer@universe-factory.net> Date: Sun, 19 Aug 2018 20:58:26 +0200 Subject: [PATCH] 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. --- docs/site-example/i18n/de.po | 11 +++------ docs/site-example/i18n/en.po | 11 +++------ docs/site-example/i18n/fr.po | 11 +++------ docs/site-example/i18n/gluon-site.pot | 13 ++++------- docs/user/site.rst | 18 ++++++--------- .../gluon-config-mode-geo-location/i18n/de.po | 10 ++++++++ .../gluon-config-mode-geo-location/i18n/fr.po | 12 +++++++++- .../i18n/gluon-config-mode-geo-location.pot | 8 +++++++ .../config-mode/wizard/0400-geo-location.lua | 23 +++++++++++++------ 9 files changed, 66 insertions(+), 51 deletions(-) diff --git a/docs/site-example/i18n/de.po b/docs/site-example/i18n/de.po index 3a16b5b50..2d56ceedf 100644 --- a/docs/site-example/i18n/de.po +++ b/docs/site-example/i18n/de.po @@ -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" diff --git a/docs/site-example/i18n/en.po b/docs/site-example/i18n/en.po index c31043a27..23f1c77d0 100644 --- a/docs/site-example/i18n/en.po +++ b/docs/site-example/i18n/en.po @@ -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" diff --git a/docs/site-example/i18n/fr.po b/docs/site-example/i18n/fr.po index 5a591ee57..f3fd4efa0 100644 --- a/docs/site-example/i18n/fr.po +++ b/docs/site-example/i18n/fr.po @@ -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" diff --git a/docs/site-example/i18n/gluon-site.pot b/docs/site-example/i18n/gluon-site.pot index 032c6931f..b06b126b7 100644 --- a/docs/site-example/i18n/gluon-site.pot +++ b/docs/site-example/i18n/gluon-site.pot @@ -19,20 +19,17 @@ msgstr "" msgid "gluon-config-mode:reboot" msgstr "" -msgid "gluon-config-mode:altitude-label" -msgstr "" - -msgid "gluon-config-mode:altitude-help" +msgid "gluon-config-mode:hostname-help" msgstr "" -msgid "gluon-config-mode:contact-help" +msgid "gluon-config-mode:geo-location-help" msgstr "" -msgid "gluon-config-mode:contact-note" +msgid "gluon-config-mode:altitude-label" msgstr "" -msgid "gluon-config-mode:hostname-help" +msgid "gluon-config-mode:contact-help" msgstr "" -msgid "gluon-config-mode:geo-location-help" +msgid "gluon-config-mode:contact-note" msgstr "" diff --git a/docs/user/site.rst b/docs/user/site.rst index 0e763ef83..29ef966cd 100644 --- a/docs/user/site.rst +++ b/docs/user/site.rst @@ -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. diff --git a/package/gluon-config-mode-geo-location/i18n/de.po b/package/gluon-config-mode-geo-location/i18n/de.po index c8bc906ab..70d955c90 100644 --- a/package/gluon-config-mode-geo-location/i18n/de.po +++ b/package/gluon-config-mode-geo-location/i18n/de.po @@ -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" diff --git a/package/gluon-config-mode-geo-location/i18n/fr.po b/package/gluon-config-mode-geo-location/i18n/fr.po index d3d7c6e80..e632d29f7 100644 --- a/package/gluon-config-mode-geo-location/i18n/fr.po +++ b/package/gluon-config-mode-geo-location/i18n/fr.po @@ -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" diff --git a/package/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot b/package/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot index 7acf7f28c..5baa748b7 100644 --- a/package/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot +++ b/package/gluon-config-mode-geo-location/i18n/gluon-config-mode-geo-location.pot @@ -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 "" diff --git a/package/gluon-config-mode-geo-location/luasrc/lib/gluon/config-mode/wizard/0400-geo-location.lua b/package/gluon-config-mode-geo-location/luasrc/lib/gluon/config-mode/wizard/0400-geo-location.lua index 456458d27..0d99bef59 100644 --- a/package/gluon-config-mode-geo-location/luasrc/lib/gluon/config-mode/wizard/0400-geo-location.lua +++ b/package/gluon-config-mode-geo-location/luasrc/lib/gluon/config-mode/wizard/0400-geo-location.lua @@ -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" -- GitLab