[gnome-maps/wip/mlundblad/negative-altitudes: 2/2] placeView: Format 0 and negative altitudes nicer
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/negative-altitudes: 2/2] placeView: Format 0 and negative altitudes nicer
- Date: Sat, 15 May 2021 21:42:46 +0000 (UTC)
commit 3606de43e82807aefd6a0f1b2bdc9757e855d209
Author: Marcus Lundblad <ml update uu se>
Date: Mon May 10 22:16:16 2021 +0200
placeView: Format 0 and negative altitudes nicer
Instead of just showing 0 or a value with a - sign,
show the altitudes as "At sea level" and
"%s below sea level" which looks a bit less
"techichal".
src/placeView.js | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/src/placeView.js b/src/placeView.js
index e623388b..41db0119 100644
--- a/src/placeView.js
+++ b/src/placeView.js
@@ -455,9 +455,29 @@ var PlaceView = GObject.registerClass({
* compare to an impossibly low altitude to see if one is set */
if (place.location.altitude > -1000000000.0) {
let alt = place.location.altitude;
+ let info;
+
+ if (alt > 0) {
+ info = Utils.prettyDistance(alt, true);
+ } else if (alt < 0) {
+ /**
+ * Translators: this is a label indicating an altitude below
+ * sea level, where the %s placeholder is the altitude relative
+ * to mean sea level in the "negative direction"
+ */
+ info = _("%s below sea level").
+ format(Utils.prettyDistance(-alt, true));
+ } else {
+ /**
+ * Translators: this indicates a place is located at (or very
+ * close to) mean sea level
+ */
+ info = _("At sea level");
+ }
+
content.push({ label: _("Altitude"),
icon: 'mountain-symbolic',
- info: Utils.prettyDistance(alt, true) });
+ info: info });
}
if (place.religion) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]