From 23ccb76f75433c49c79c7d45f0e7c9716251a4ab Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sat, 15 Aug 2009 15:19:35 +0200 Subject: L10N: Russian TL for site title and main menu Things are looking good so far. --- lib/VNDB/Handler/Misc.pm | 4 ++-- lib/VNDB/L10N.pm | 9 ++++++++- lib/VNDB/Util/LayoutHTML.pm | 22 +++++++++++----------- 3 files changed, 21 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm index 8cbe2ed9..6033b97d 100644 --- a/lib/VNDB/Handler/Misc.pm +++ b/lib/VNDB/Handler/Misc.pm @@ -36,10 +36,10 @@ YAWF::register( sub homepage { my $self = shift; - $self->htmlHeader(title => $self->{site_title}); + $self->htmlHeader(title => mt 'The Visual Novel Database'); div class => 'mainbox'; - h1 $self->{site_title}; + h1 mt 'The Visual Novel Database'; p class => 'description'; lit qq| VNDB.org strives to be a comprehensive database for information about visual novels and diff --git a/lib/VNDB/L10N.pm b/lib/VNDB/L10N.pm index 5540c710..d71a72dc 100644 --- a/lib/VNDB/L10N.pm +++ b/lib/VNDB/L10N.pm @@ -12,6 +12,13 @@ use warnings; # be the same as in the languages hash in global.pl sub languages { ('en', 'ru') } + sub maketext { + my $r = eval { shift->SUPER::maketext(@_) }; + return $r if defined $r; + warn "maketext failed for '@_': $@\n"; + return $_[0]||''; # not quite sure we want this + } + # can be called as either a subroutine or a method sub loadfile { my %lang = ( @@ -60,7 +67,7 @@ use warnings; next; } # something we didn't expect - die "Don't know what to do with line $line\n"; + die "Don't know what to do with line $line\n" unless /^([a-z_-]{2,7})[ *]:/; } close $F; diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm index a932c5a1..7b908ee1 100644 --- a/lib/VNDB/Util/LayoutHTML.pm +++ b/lib/VNDB/Util/LayoutHTML.pm @@ -38,7 +38,7 @@ sub htmlHeader { # %options->{ title, js, noindex, search } div id => 'bgright', ' '; div id => 'header'; h1; - a href => '/', lc $self->{site_title}; + a href => '/', lc mt 'The Visual Novel Database'; end; end; @@ -65,17 +65,17 @@ sub _menu { txt mt 'Menu'; end; div; - a href => '/', 'Home'; br; - a href => '/v/all', 'Visual novels'; br; - a href => '/r', 'Releases'; br; - a href => '/p/all', 'Producers'; br; - a href => '/g', 'Tags'; br; - a href => '/u/all', 'Users'; br; - a href => '/hist', 'Recent changes'; br; - a href => '/t', 'Discussion board'; br; - a href => '/d6', 'FAQ'; br; + a href => '/', mt 'Home'; br; + a href => '/v/all', mt 'Visual novels'; br; + a href => '/r', mt 'Releases'; br; + a href => '/p/all', mt 'Producers'; br; + a href => '/g', mt 'Tags'; br; + a href => '/u/all', mt 'Users'; br; + a href => '/hist', mt 'Recent changes'; br; + a href => '/t', mt 'Discussion board'; br; + a href => '/d6', mt 'FAQ'; br; a href => 'irc://irc.synirc.net/vndb', '#vndb'; - lit ' (webchat)'; + lit ' ('.mt('webchat').')'; end; form action => '/v/all', method => 'get', id => 'search'; fieldset; -- cgit v1.2.3