summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/HAFAS.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-10-29 14:09:50 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2023-10-29 14:09:50 +0100
commita60779e8b19a1db11a65467163e6be1ccfd8005b (patch)
treed8875fa34395e5b63e1634c03dbc06c25486bbdb /lib/Travel/Status/DE/HAFAS.pm
parent6560d248393cde5fbff0451bcddb03435c4a7f08 (diff)
allow users to specify the request language
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS.pm')
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm11
1 files changed, 11 insertions, 0 deletions
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<mot1>,
I<mot2>, ... will be returned. The supported modes depend on B<service>, use
B<get_services> or B<get_service> to get the supported values.
+=item B<language> => I<language>
+
+Request text messages to be provided in I<language>. Supported languages depend
+on B<service>, use B<get_services> or B<get_service> to get the supported
+values. Providing an unsupported or invalid value may lead to garbage output.
+
=item B<lookahead> => I<int> (station)
Request arrivals/departures that occur up to I<int> minutes after the specified datetime.