summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-12-03 12:37:51 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2023-12-03 12:37:51 +0100
commit39ffb2c653c4940a9cc12fcd15500e53a90772ae (patch)
treeefdb2106ffeaf741fe7aa8dff6ba8a7cd6010475 /lib/DBInfoscreen.pm
parenta702051aef4b32fca7fd516a34415fcbb1e8c871 (diff)
add language switcher
Diffstat (limited to 'lib/DBInfoscreen.pm')
-rw-r--r--lib/DBInfoscreen.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm
index c8960c9..4bf1eea 100644
--- a/lib/DBInfoscreen.pm
+++ b/lib/DBInfoscreen.pm
@@ -61,7 +61,19 @@ sub startup {
for my $cookie ( @{ $self->req->cookies } ) {
if ( $cookie->name eq 'theme' ) {
$self->session( theme => $cookie->value );
- return;
+ say 'found 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);
}
}
}