Commit ca75a4ac authored by Volker Krause's avatar Volker Krause
Browse files

Specify desired locale in OTP journey queries

This has no effect on alert messages (those are always provided in all
available languages), but it does impact locations and/or navigation
instructions. The supported languages of both sets also can differ,
the former depends on what it fed into the system while the latter
seems to be rather based on OTP/Digitransit's translation catalogs.
parent a2d1b289
Pipeline #52861 passed with stage
in 22 seconds
......@@ -138,6 +138,7 @@ bool OpenTripPlannerGraphQLBackend::queryJourney(const JourneyRequest &req, Jour
gqlReq.setVariable(QStringLiteral("dateTime"), dt.toString(Qt::ISODate));
gqlReq.setVariable(QStringLiteral("arriveBy"), req.dateTimeMode() == JourneyRequest::Arrival);
gqlReq.setVariable(QStringLiteral("maxResults"), req.maximumResults());
gqlReq.setVariable(QStringLiteral("lang"), preferredLanguage());
QJsonArray modes;
QJsonObject walkMode;
......
......@@ -10,7 +10,8 @@ query journeys(
$time: String!,
$arriveBy: Boolean!,
$modes: [TransportMode]!,
$maxResults: Int!
$maxResults: Int!,
$lang: String!
) {
plan (
from: { lat: $fromLat, lon: $fromLon }
......@@ -20,6 +21,7 @@ query journeys(
arriveBy: $arriveBy
numItineraries: $maxResults
transportModes: $modes
locale: $lang
) {
itineraries {
legs {
......
......@@ -91,6 +91,7 @@
"CARPOOL"
]
},
"supportedLanguages": [ "de" ],
"timezone": "Europe/Berlin",
"type": {
"otpGraphQl": true
......
......@@ -94,6 +94,7 @@
"CARPOOL"
]
},
"supportedLanguages": [ "de" ],
"timezone": "Europe/Berlin",
"type": {
"otpGraphQl": true
......
......@@ -91,6 +91,7 @@
}
}
},
"supportedLanguages": [ "de", "en", "fi", "fr", "sv" ],
"timezone": "Europe/Helsinki",
"type": {
"otpGraphQl": true
......
......@@ -75,6 +75,7 @@
"options": {
"endpoint": "https://api.digitransit.fi/routing/v1/routers/finland/"
},
"supportedLanguages": [ "de", "en", "fi", "fr", "sv" ],
"timezone": "Europe/Helsinki",
"type": {
"otpGraphQl": true
......
......@@ -74,6 +74,7 @@
"options": {
"endpoint": "https://api.digitransit.fi/routing/v1/routers/waltti/"
},
"supportedLanguages": [ "de", "en", "fi", "fr", "sv" ],
"timezone": "Europe/Helsinki",
"type": {
"otpGraphQl": true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment