mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
language option with default 'en'
This commit is contained in:
parent
c80f355d47
commit
0199749a31
8 changed files with 17 additions and 7 deletions
|
@ -28,7 +28,8 @@ With `opt`, you can override the default options, which look like this:
|
||||||
direction: null, // only show departures heading to this station
|
direction: null, // only show departures heading to this station
|
||||||
duration: 10, // show departures for the next n minutes
|
duration: 10, // show departures for the next n minutes
|
||||||
stationLines: false, // parse & expose lines of the station?
|
stationLines: false, // parse & expose lines of the station?
|
||||||
remarks: true // parse & expose hints & warnings?
|
remarks: true, // parse & expose hints & warnings?
|
||||||
|
language: 'en' // language to get results in
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,8 @@ With `opt`, you can override the default options, which look like this:
|
||||||
polylines: false, // return a shape for each leg?
|
polylines: false, // return a shape for each leg?
|
||||||
remarks: true, // parse & expose hints & warnings?
|
remarks: true, // parse & expose hints & warnings?
|
||||||
// Consider walking to nearby stations at the beginning of a journey?
|
// Consider walking to nearby stations at the beginning of a journey?
|
||||||
startWithWalking: true
|
startWithWalking: true,
|
||||||
|
language: 'en' // language to get results in
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ With `opt`, you can override the default options, which look like this:
|
||||||
, addresses: true
|
, addresses: true
|
||||||
, poi: true // points of interest
|
, poi: true // points of interest
|
||||||
, stationLines: false // parse & expose lines of the station?
|
, stationLines: false // parse & expose lines of the station?
|
||||||
|
, language: 'en' // language to get results in
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,8 @@ With `opt`, you can override the default options, which look like this:
|
||||||
distance: null, // maximum walking distance in meters
|
distance: null, // maximum walking distance in meters
|
||||||
poi: false, // return points of interest?
|
poi: false, // return points of interest?
|
||||||
stations: true, // return stations?
|
stations: true, // return stations?
|
||||||
stationLines: false // parse & expose lines of the station?
|
stationLines: false, // parse & expose lines of the station?
|
||||||
|
language: 'en' // language to get results in
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,8 @@ With `opt`, you can override the default options, which look like this:
|
||||||
results: 256, // maximum number of vehicles
|
results: 256, // maximum number of vehicles
|
||||||
duration: 30, // compute frames for the next n seconds
|
duration: 30, // compute frames for the next n seconds
|
||||||
frames: 3, // nr of frames to compute
|
frames: 3, // nr of frames to compute
|
||||||
polylines: false // return a track shape for each vehicle?
|
polylines: false, // return a track shape for each vehicle?
|
||||||
|
language: 'en' // language to get results in
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@ With `opt`, you can override the default options, which look like this:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
stationLines: false // parse & expose lines of the station?
|
stationLines: false, // parse & expose lines of the station?
|
||||||
|
language: 'en' // language to get results in
|
||||||
}
|
}
|
||||||
|
|
||||||
## Response
|
## Response
|
||||||
|
|
|
@ -29,7 +29,8 @@ With `opt`, you can override the default options, which look like this:
|
||||||
when: new Date(),
|
when: new Date(),
|
||||||
stopovers: true, // return stations on the way?
|
stopovers: true, // return stations on the way?
|
||||||
polyline: false, // return a shape for the trip?
|
polyline: false, // return a shape for the trip?
|
||||||
remarks: true // parse & expose hints & warnings?
|
remarks: true, // parse & expose hints & warnings?
|
||||||
|
language: 'en' // language to get results in
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,10 @@ const {fetch} = require('fetch-ponyfill')({Promise})
|
||||||
const md5 = input => createHash('md5').update(input).digest()
|
const md5 = input => createHash('md5').update(input).digest()
|
||||||
|
|
||||||
const request = (profile, opt, data) => {
|
const request = (profile, opt, data) => {
|
||||||
const body = profile.transformReqBody({lang: 'en', svcReqL: [data]})
|
const body = profile.transformReqBody({
|
||||||
|
lang: opt.language || 'en',
|
||||||
|
svcReqL: [data]
|
||||||
|
})
|
||||||
const req = profile.transformReq({
|
const req = profile.transformReq({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
// todo: CORS? referrer policy?
|
// todo: CORS? referrer policy?
|
||||||
|
|
Loading…
Add table
Reference in a new issue