From a60779e8b19a1db11a65467163e6be1ccfd8005b Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 29 Oct 2023 14:09:50 +0100 Subject: allow users to specify the request language --- lib/Travel/Status/DE/HAFAS.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib') diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index 780d89f..cd9e9f2 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -33,6 +33,7 @@ my %hafas_instance = ( name => 'Deutsche Bahn', productbits => [qw[ice ic_ec d regio s bus ferry u tram ondemand]], salt => 'bdI8UVj4' . '0K5fvxwf', + languages => [qw[de en fr es]], request => { client => { id => 'DB', @@ -339,6 +340,10 @@ sub new { }; } + if ( $conf{language} ) { + $req->{lang} = $conf{language}; + } + $self->{strptime_obj} //= DateTime::Format::Strptime->new( pattern => '%Y%m%dT%H%M%S', time_zone => 'Europe/Berlin', @@ -986,6 +991,12 @@ If this option is set, only the modes of transport appearing in I, I, ... will be returned. The supported modes depend on B, use B or B to get the supported values. +=item B => I + +Request text messages to be provided in I. Supported languages depend +on B, use B or B to get the supported +values. Providing an unsupported or invalid value may lead to garbage output. + =item B => I (station) Request arrivals/departures that occur up to I minutes after the specified datetime. -- cgit v1.2.3