From 6c552af10823c69dc740fea696622d543e297a1e Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 27 Mar 2024 18:43:31 +0100 Subject: Remove I18N for now. It's incompatible with caching proxy setups. --- lib/DBInfoscreen.pm | 18 ------------------ lib/DBInfoscreen/Controller/Stationboard.pm | 12 ++++++------ lib/DBInfoscreen/Controller/Wagenreihung.pm | 6 +++--- 3 files changed, 9 insertions(+), 27 deletions(-) (limited to 'lib') diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm index a3f22bf..c33a703 100644 --- a/lib/DBInfoscreen.pm +++ b/lib/DBInfoscreen.pm @@ -38,12 +38,6 @@ sub startup { chomp $self->config->{version}; $self->defaults( version => $self->config->{version} // 'UNKNOWN' ); - $self->plugin( - I18N => { - default => 'de', - }, - ); - # Generally, the reverse proxy handles compression. # Also, Mojolicious compression breaks legacy callback-based JSON endpoints # for some clients. @@ -62,18 +56,6 @@ sub startup { if ( $cookie->name eq 'theme' ) { $self->session( theme => $cookie->value ); } - elsif ( $cookie->name eq 'lang' ) { - my $l = $cookie->value; - if ( $l eq 'de' or $l eq 'en' ) { - $self->languages($l); - } - } - } - - if ( my $l = $self->param('lang') ) { - if ( $l eq 'de' or $l eq 'en' ) { - $self->languages($l); - } } } ); diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 757790d..cff1ff8 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -833,9 +833,9 @@ sub render_train { my %opt = ( train => $result ); - if ( $self->languages =~ m{^en} ) { - $opt{language} = 'en'; - } + #if ( $self->languages =~ m{^en} ) { + # $opt{language} = 'en'; + #} $self->hafas->get_route_p(%opt)->then( sub { @@ -1117,9 +1117,9 @@ sub train_details { $opt{service} = $hafas; } - if ( $self->languages =~ m{^en} ) { - $opt{language} = 'en'; - } + #if ( $self->languages =~ m{^en} ) { + # $opt{language} = 'en'; + #} if ( my $date = $self->param('date') ) { if ( $date diff --git a/lib/DBInfoscreen/Controller/Wagenreihung.pm b/lib/DBInfoscreen/Controller/Wagenreihung.pm index 35df7a2..1708285 100644 --- a/lib/DBInfoscreen/Controller/Wagenreihung.pm +++ b/lib/DBInfoscreen/Controller/Wagenreihung.pm @@ -225,15 +225,15 @@ sub wagen { ); } - my $title = $self->l('Wagen ') . $wagon_id; + my $title = 'Wagen ' . $wagon_id; if ( $wref->{tt} and $wref->{tn} ) { $title = sprintf( '%s %s', $wref->{tt}, $wref->{tn} ); if ($wagon_no) { - $title .= ' ' . $self->l('Wagen ') . $wagon_no; + $title .= ' Wagen ' . $wagon_no; } else { - $title .= ' ' . $self->l('Wagen ') . $wagon_id; + $title .= ' Wagen ' . $wagon_id; } } -- cgit v1.2.3