[gnome-maps/wip/mlundblad/dont-use-offscreen-window] transitArrivalRow: Use utility function to print label



commit 284b4c526f4e2ca086f4cf615a5fdc2663b20725
Author: Marcus Lundblad <ml update uu se>
Date:   Sun Mar 17 22:21:57 2019 +0100

    transitArrivalRow: Use utility function to print label

 po/POTFILES.in           |  1 -
 src/transitArrivalRow.js | 14 +++-----------
 2 files changed, 3 insertions(+), 12 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index f49ebcf..2717864 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -52,7 +52,6 @@ src/sendToDialog.js
 src/shapeLayer.js
 src/sidebar.js
 src/transit.js
-src/transitArrivalRow.js
 src/transitLegRow.js
 src/transitMoreRow.js
 src/transitOptionsPanel.js
diff --git a/src/transitArrivalRow.js b/src/transitArrivalRow.js
index 311089c..4ffa1d8 100644
--- a/src/transitArrivalRow.js
+++ b/src/transitArrivalRow.js
@@ -19,12 +19,12 @@
  * Author: Marcus Lundblad <ml update uu se>
  */
 
-const _ = imports.gettext.gettext;
-
 const Gdk = imports.gi.Gdk;
 const GObject = imports.gi.GObject;
 const Gtk = imports.gi.Gtk;
 
+const Transit = imports.transit;
+
 var TransitArrivalRow = GObject.registerClass({
     Template: 'resource:///org/gnome/Maps/ui/transit-arrival-row.ui',
     InternalChildren: ['arrivalLabel',
@@ -47,15 +47,7 @@ var TransitArrivalRow = GObject.registerClass({
 
         let lastLeg = this._itinerary.legs[this._itinerary.legs.length - 1];
 
-        if (lastLeg.to) {
-            /* Translators: this a format string indicating arriving at the
-             * destination of journey with the arrival address and transit
-             * stop as the format parameter */
-            this._arrivalLabel.label = _("Arrive at %s").format(lastLeg.to);
-        } else {
-            this._arrivalLabel.label = _("Arrive");
-        }
-
+        this._arrivalLabel.label = Transit.getArrivalLabel(lastLeg);
         this._timeLabel.label = lastLeg.prettyPrintArrivalTime();
         this._separator.visible = !this._print;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]