diff --git a/src/route.js b/src/route.js index 6de38df5cd5e1cac6e5d6815c97c4fb09412f698..5d4b94e1f89d5038862c978e802dba55bf6a68fb 100644 --- a/src/route.js +++ b/src/route.js @@ -104,7 +104,8 @@ export class TurnPoint { UTURN: 14, UTURN_LEFT: 15, UTURN_RIGHT: 16, - ELEVATOR: 17 + ELEVATOR: 17, + STAIRS: 18, } constructor({ coordinate, type, distance, instruction, turnAngle }) { @@ -146,7 +147,8 @@ export class TurnPoint { 'maps-direction-u-turn-left-symbolic'; case TurnPoint.Type.UTURN_LEFT: return 'maps-direction-u-turn-left-symbolic'; case TurnPoint.Type.UTURN_RIGHT: return 'maps-direction-u-turn-right-symbolic'; - default: return ''; + case TurnPoint.Type.STAIRS: return 'steps-symbolic'; + default: return ''; } } diff --git a/src/transitplugins/motis2.js b/src/transitplugins/motis2.js index ea172eda9d68a498ccfc8b4fa63e8ebb121fad5e..ec0f50541aab2e3852229db8213c396c5a2eea78 100644 --- a/src/transitplugins/motis2.js +++ b/src/transitplugins/motis2.js @@ -19,6 +19,8 @@ * Author: Marcus Lundblad */ +import gettext from 'gettext'; + import GWeather from 'gi://GWeather'; import GLib from 'gi://GLib'; import Shumate from 'gi://Shumate'; @@ -33,6 +35,8 @@ import * as Time from '../time.js'; import {Itinerary, Leg, RouteType, Stop} from '../transitPlan.js'; import * as Utils from '../utils.js'; +const _ = gettext.gettext; + export class Motis2 { constructor(params) { this._baseUrl = GLib.getenv('MOTIS_BASE_URL') ?? params?.baseUrl; @@ -326,6 +330,10 @@ export class Motis2 { switch (step.relativeDirection) { case 'DEPART': case 'STAIRS': + return [TurnPoint.Type.STAIRS, + step.hasOwnProperty('toLevel') ? + _("Take the stairs to level %s").format(step.toLevel) : + _("Take the stairs")]; case 'CONTINUE': return [TurnPoint.Type.CONTINUE, step.streetName ?