summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/L10N.pm4
-rw-r--r--lib/VNDB/Util/LayoutHTML.pm11
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/VNDB/L10N.pm b/lib/VNDB/L10N.pm
index cbf6a239..5540c710 100644
--- a/lib/VNDB/L10N.pm
+++ b/lib/VNDB/L10N.pm
@@ -8,6 +8,10 @@ use warnings;
sub fallback_languages { ('en') };
+ # used for the language switch interface, language tags must
+ # be the same as in the languages hash in global.pl
+ sub languages { ('en', 'ru') }
+
# can be called as either a subroutine or a method
sub loadfile {
my %lang = (
diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm
index b5813330..a932c5a1 100644
--- a/lib/VNDB/Util/LayoutHTML.pm
+++ b/lib/VNDB/Util/LayoutHTML.pm
@@ -54,7 +54,16 @@ sub _menu {
div id => 'menulist';
div class => 'menubox';
- h2 'Menu';
+ h2;
+ span;
+ for (grep $self->{l10n}->language_tag() ne $_, $self->{l10n}->languages()) {
+ a href => "?l10n=$_";
+ cssicon "lang $_", $self->{languages}{$_};
+ end;
+ }
+ end;
+ txt mt 'Menu';
+ end;
div;
a href => '/', 'Home'; br;
a href => '/v/all', 'Visual novels'; br;