Unverified Commit 6c552af1 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Remove I18N for now. It's incompatible with caching proxy setups.

parent 1d9f62e1
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@ requires 'List::UtilsBy';
requires 'LWP::UserAgent';
requires 'LWP::Protocol::https';
requires 'Mojolicious';
requires 'Mojolicious::Plugin::I18N';
requires 'Travel::Status::DE::DBWagenreihung', '0.06';
requires 'Travel::Status::DE::HAFAS', '>= 5.03';
requires 'Travel::Status::DE::IRIS';
+0 −18
Original line number Diff line number Diff line
@@ -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);
				}
			}
		}
	);
+6 −6
Original line number Diff line number Diff line
@@ -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
+3 −3
Original line number Diff line number Diff line
@@ -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;
		}
	}

+17 −17
Original line number Diff line number Diff line
@@ -4,40 +4,40 @@ data-req="<%= stash('ajax_req') =~ s{#}{%23}gr %>"
data-route="<%= stash('ajax_route') %>"
data-poly="<%= stash('ajax_polyline') %>"
>
	%= l 'Fahrt'
	Fahrt
	% if (stash('train_no')) {
		<strong><%= stash('train_no') %></strong>
	% }
	<%= l 'von' %> <strong><%= stash('origin')->{name} %></strong>
	<%= l 'nach' %> <strong><%= stash('destination')->{name} %></strong>
	von <strong><%= stash('origin')->{name} %></strong>
	nach <strong><%= stash('destination')->{name} %></strong>
</div>
% if (my $next = stash('next_stop')) {
	<div class="nextstop">
	% if ($next->{type} eq 'present' and $next->{station}{dep} and $next->{station}{arr}) {
		<%= l 'Aufenthalt in' %> <strong><%= $next->{station}->loc->name %></strong>
		Aufenthalt in <strong><%= $next->{station}->loc->name %></strong>
		% if ($next->{station}{platform}) {
			<%= l 'an Gleis' %> <strong><%= $next->{station}{platform} %></strong>
			an Gleis <strong><%= $next->{station}{platform} %></strong>
		% }
		<%= l 'bis' %> <strong><%= $next->{station}{dep}->strftime('%H:%M') %></strong>
		bis <strong><%= $next->{station}{dep}->strftime('%H:%M') %></strong>
		% if ($next->{station}{dep_delay}) {
			%= sprintf('(%+d)', $next->{station}{dep_delay})
		% }
	% }
	% elsif ($next->{type} eq 'present' and $next->{station}{dep}) {
		<%= l 'Abfahrt in' %> <strong><%= $next->{station}->loc->name %></strong>
		Abfahrt in <strong><%= $next->{station}->loc->name %></strong>
		% if ($next->{station}{platform}) {
			<%= l 'von Gleis' %> <strong><%= $next->{station}{platform} %></strong>
			von Gleis <strong><%= $next->{station}{platform} %></strong>
		% }
		<%= l 'um' %> <strong><%= $next->{station}{dep}->strftime('%H:%M') %></strong>
		um <strong><%= $next->{station}{dep}->strftime('%H:%M') %></strong>
		% if ($next->{station}{dep_delay}) {
			%= sprintf('(%+d)', $next->{station}{dep_delay})
		% }
	% }
	% elsif ($next->{type} eq 'present' and $next->{station}{arr}) {
		%= l 'Endstation erreicht um'
		Endstation erreicht um
		<strong><%= $next->{station}{arr}->strftime('%H:%M') %></strong>
		% if ($next->{station}{platform}) {
			<%= l 'auf Gleis' %> <strong><%= $next->{station}{platform} %></strong>
			auf Gleis <strong><%= $next->{station}{platform} %></strong>
		% }
		% if ($next->{station}{arr_delay}) {
			%= sprintf('(%+d)', $next->{station}{arr_delay})
@@ -47,25 +47,25 @@ data-poly="<%= stash('ajax_polyline') %>"
		Zug steht in
		<strong><%= $next->{station}{arr}->strftime('%H:%M') %></strong>
		% if ($next->{station}{platform}) {
			<%= l 'auf Gleis' %> <strong><%= $next->{station}{platform} %></strong>
			auf Gleis <strong><%= $next->{station}{platform} %></strong>
		% }
	% }
	% elsif ($next->{type} eq 'next' and $next->{station}{arr}) {
		%= l 'Nächster Halt:'
		Nächster Halt:
		<strong><%= $next->{station}->loc->name %></strong>
		<%= l 'um' %> <strong><%= $next->{station}{arr}->strftime('%H:%M') %></strong>
		um <strong><%= $next->{station}{arr}->strftime('%H:%M') %></strong>
		% if ($next->{station}{arr_delay}) {
			%= sprintf('(%+d)', $next->{station}{arr_delay})
		% }
		% if ($next->{station}{platform}) {
			<%= l 'auf Gleis' %> <strong><%= $next->{station}{platform} %></strong>
			auf Gleis <strong><%= $next->{station}{platform} %></strong>
		% }
	% }
	% elsif ($next->{type} eq 'next') {
		%= l 'Nächster Halt:'
		Nächster Halt:
		<strong><%= $next->{station}->loc->name %></strong>
		% if ($next->{station}{platform}) {
			<%= l 'auf Gleis' %> <strong><%= $next->{station}{platform} %></strong>
			auf Gleis <strong><%= $next->{station}{platform} %></strong>
		% }
	% }
	</div>
Loading