summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/DBInfoscreen.pm14
-rw-r--r--templates/layouts/app.html.ep3
2 files changed, 14 insertions, 3 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);
}
}
}
diff --git a/templates/layouts/app.html.ep b/templates/layouts/app.html.ep
index 7e8e38a..6d18f8b 100644
--- a/templates/layouts/app.html.ep
+++ b/templates/layouts/app.html.ep
@@ -294,14 +294,13 @@ Theme:
<a onClick="javascript:setTheme('light')">light</a>
·
<a onClick="javascript:setTheme('default')">device theme</a>
-<!--<br/>
+<br/>
Language:
<a onClick="javascript:setLang('de')">DE</a>
·
<a onClick="javascript:setLang('en')">EN</a>
·
<a onClick="javascript:setLang('default')">system language</a>
-<br/>-->
</div>
<div class="about">
<a href="_about">DBF</a> v<%= stash('version') // '???' %>