[gnome-maps/wip/mlundblad/dont-use-offscreen-window: 4/6] transitLegRow: Use utility function to print from label



commit b1dc40bb82a209de289e447f66376cfc84a19f77
Author: Marcus Lundblad <ml update uu se>
Date:   Sun Mar 17 22:09:09 2019 +0100

    transitLegRow: Use utility function to print from label

 src/transitLegRow.js | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)
---
diff --git a/src/transitLegRow.js b/src/transitLegRow.js
index e0f6c3f..ce4138f 100644
--- a/src/transitLegRow.js
+++ b/src/transitLegRow.js
@@ -28,6 +28,7 @@ const Gtk = imports.gi.Gtk;
 const Pango = imports.gi.Pango;
 
 const InstructionRow = imports.instructionRow;
+const Transit = imports.transit;
 const TransitRouteLabel = imports.transitRouteLabel;
 const TransitStopRow = imports.transitStopRow;
 const Utils = imports.utils;
@@ -63,22 +64,7 @@ var TransitLegRow = GObject.registerClass({
         super._init(params);
 
         this._modeImage.icon_name = this._leg.iconName;
-        if (this._start) {
-            if (this._leg.from) {
-                /* Translators: this is a format string indicating instructions
-                 * starting a journey at the address given as the parameter
-                 */
-                this._fromLabel.label = _("Start at %s").format(this._leg.from);
-            } else {
-                /* Translators: this indicates starting a journey at a location
-                 * with no set name (such as when the user started routing from
-                 * an arbitrary point on the map)
-                 */
-                this._fromLabel.label = _("Start");
-            }
-        } else {
-            this._fromLabel.label = this._leg.from;
-        }
+        this._fromLabel.label = Transit.getFromLabel(this._leg, this._start);
 
         if (this._leg.transit) {
             let routeLabel = new TransitRouteLabel.TransitRouteLabel({


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