[gnome-maps/wip/mlundblad/dont-use-offscreen-window: 8/15] transitArrivalRow: Use utility function to print label
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/dont-use-offscreen-window: 8/15] transitArrivalRow: Use utility function to print label
- Date: Wed, 27 Mar 2019 21:17:30 +0000 (UTC)
commit f4b09ba31abf1b3e6824ba4c8bb410221f80d112
Author: Marcus Lundblad <ml update uu se>
Date: Sun Mar 17 22:21:57 2019 +0100
transitArrivalRow: Use utility function to print label
Fixes #78
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]