From 5684e4821c0e0bdffa523e886e6644649e8f519a Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sun, 16 Aug 2009 09:48:29 +0200 Subject: L10N: Converted homepage and history pages There are a few things left hardcoded, though: The 'expand' link is also in Javascript, that will probably need some mechanism for TL as well. The format of the items on the homepage might need to change depending on the language, I can imagine that not every language uses the 'title by name' construct. Especially the age() function needs a localized version. --- data/lang.txt | 146 +++++++++++++++++++++++++++++++++++++++++++- lib/VNDB/Handler/Misc.pm | 57 ++++++++--------- lib/VNDB/Util/CommonHTML.pm | 8 +-- 3 files changed, 173 insertions(+), 38 deletions(-) diff --git a/data/lang.txt b/data/lang.txt index 1a46fe97..dcbcf6de 100644 --- a/data/lang.txt +++ b/data/lang.txt @@ -40,9 +40,12 @@ indicate that it has been checked. /intro + + ############################################################################# ## Main website layout ## ############################################################################# +# Util::LayoutHTML # Main title of the site, used on header of each page and as title on the homepage @@ -101,7 +104,6 @@ en : search ru*: - # User menu :_menu_myprofile @@ -195,3 +197,145 @@ en : source ru*: + + +############################################################################# +## Home page (/) ## +############################################################################# +# Handler::Misc::home + + +# HTML +:_home_intro +en : VNDB.org strives to be a comprehensive database for information about visual novels and eroge.
+ This website is built as a wiki, meaning that anyone can freely add and contribute information + to the database, allowing us to create the largest, most accurate and most up-to-date visual novel + database on the web.
+ Registered users are also able to keep track of a personal list of games they want to play or have finished + and they can vote on all visual novels.

+ Feel free to browse around, register an account + or to participate in the discussions about visual novels or VNDB on our discussion board. +ru*: + + +:_home_recentchanges +en : Recent Changes +ru*: + +:_home_announcements +en : Announcements +ru*: + +:_home_newsarchive +en : News Archive +ru*: + +:_home_recentposts +en : Recent Posts +ru*: + +:_home_randomvn +en : Random vsual novels +ru*: + +:_home_upcoming +en : Upcoming releases +ru*: + +:_home_justreleased +en : Just released +ru*: + + + + +############################################################################# +## History browser (/*/hist) ## +############################################################################# +# Handler::Misc::history and Util::CommonHTML::htmlHistory + + +:_hist_title +en : Recent changes +ru*: + +:_hist_title_item +en : Edit history of [_1] +ru*: + + +# the filter buttons + +:_hist_filter_showauto +en : Show automated edits +ru*: + +:_hist_filter_hideauto +en : Hide automated edits +ru*: + +:_hist_filter_hidedel +en : Hide deleted items +ru*: + +:_hist_filter_showdel +en : Show deleted items +ru*: + +:_hist_filter_alltypes +en : Show all items +ru*: + +:_hist_filter_onlyvn +en : Only visual novels +ru*: + +:_hist_filter_onlyreleases +en : Only releases +ru*: + +:_hist_filter_onlyproducers +en : Only producers +ru*: + +:_hist_filter_allactions +en : Show all changes +ru*: + +:_hist_filter_onlyedits +en : Only edits +ru*: + +:_hist_filter_onlynew +en : Only newly created pages +ru*: + +:_hist_filter_exrel +en : Exclude edits of releases +ru*: + +:_hist_filter_increl +en : Include edits of releases +ru*: + + +# column headers + +# Short version of 'Revision' +:_hist_col_rev +en : Rev. +ru*: + +:_hist_col_date +en : Date +ru*: + +:_hist_col_user +en : User +ru*: + +:_hist_col_page +en : Page +ru*: + + diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm index 6033b97d..24bb53a4 100644 --- a/lib/VNDB/Handler/Misc.pm +++ b/lib/VNDB/Handler/Misc.pm @@ -41,18 +41,7 @@ sub homepage { div class => 'mainbox'; 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 - eroge.
- This website is built as a wiki, meaning that anyone can freely add and contribute information - to the database, allowing us to create the largest, most accurate and most up-to-date visual novel - database on the web.
- Registered users are also able to keep track of a personal list of games they want to play or have finished - and they can vote on all visual novels.
-
- Feel free to browse around, register an account - or to participate in the discussions about visual novels or VNDB on our discussion board. - |; + lit mt '_home_intro'; end; my $scr = $self->dbScreenshotRandom; @@ -69,8 +58,9 @@ sub homepage { Tr; # Recent changes + # TODO: localized item format td; - h1 'Recent changes'; + h1 mt '_home_recentchanges'; my $changes = $self->dbRevisionGet(what => 'item user', results => 10, auto => 1, hidden => 1); ul; for (@$changes) { @@ -88,8 +78,8 @@ sub homepage { # Announcements td; my $an = $self->dbThreadGet(type => 'an', order => 't.id DESC', results => 2); - a class => 'right', href => '/t/an', 'News archive'; - h1 'Announcements'; + a class => 'right', href => '/t/an', mt '_home_newsarchive'; + h1 mt '_home_announcements'; for (@$an) { my $post = $self->dbPostGet(tid => $_->{id}, num => 1)->[0]; h2; @@ -102,8 +92,9 @@ sub homepage { end; # Recent posts + # TODO: localized item format td; - h1 'Recent posts'; + h1 mt '_home_recentposts'; my $posts = $self->dbThreadGet(what => 'lastpost boardtitles', results => 10, order => 'tpl.date DESC', notusers => 1); ul; for (@$posts) { @@ -123,7 +114,7 @@ sub homepage { # Random visual novels td; - h1 'Random visual novels'; + h1 mt '_home_randomvn'; my $random = $self->dbVNGet(results => 10, order => 'RANDOM()'); ul; for (@$random) { @@ -136,7 +127,7 @@ sub homepage { # Upcoming releases td; - h1 'Upcoming releases'; + h1 mt '_home_upcoming'; my $upcoming = $self->dbReleaseGet(results => 10, unreleased => 1, what => 'platforms'); ul; for (@$upcoming) { @@ -153,7 +144,7 @@ sub homepage { # Just released td; - h1 'Just released'; + h1 mt '_home_justreleased'; my $justrel = $self->dbReleaseGet(results => 10, order => 'rr.released DESC', unreleased => 0, what => 'platforms'); ul; for (@$justrel) { @@ -195,7 +186,7 @@ sub history { $type eq 'p' ? $self->dbProducerGet(id => $id)->[0] : $type eq 'r' ? $self->dbReleaseGet(id => $id)->[0] : $type eq 'v' ? $self->dbVNGet(id => $id)->[0] : undef; - my $title = $type ? 'Edit history of '.($obj->{title} || $obj->{name} || $obj->{username}) : 'Recent changes'; + my $title = mt $type ? ('_hist_title_item', $obj->{title} || $obj->{name} || $obj->{username}) : '_hist_title'; return 404 if $type && !$obj->{id}; # get the edit history @@ -232,33 +223,33 @@ sub history { h1 $title; if($type ne 'u') { p class => 'browseopts'; - a !$f->{m} ? (class => 'optselected') : (), href => $u->(m => 0), 'Show automated edits'; - a $f->{m} ? (class => 'optselected') : (), href => $u->(m => 1), 'Hide automated edits'; + a !$f->{m} ? (class => 'optselected') : (), href => $u->(m => 0), mt '_hist_filter_showauto'; + a $f->{m} ? (class => 'optselected') : (), href => $u->(m => 1), mt '_hist_filter_hideauto'; end; } if(!$type || $type eq 'u') { if($self->authCan('del')) { p class => 'browseopts'; - a $f->{h} == 1 ? (class => 'optselected') : (), href => $u->(h => 1), 'Hide deleted items'; - a $f->{h} == -1 ? (class => 'optselected') : (), href => $u->(h => -1), 'Show deleted items'; + a $f->{h} == 1 ? (class => 'optselected') : (), href => $u->(h => 1), mt '_hist_filter_hidedel'; + a $f->{h} == -1 ? (class => 'optselected') : (), href => $u->(h => -1), mt '_hist_filter_showdel'; end; } p class => 'browseopts'; - a !$f->{t} ? (class => 'optselected') : (), href => $u->(t => ''), 'Show all items'; - a $f->{t} eq 'v' ? (class => 'optselected') : (), href => $u->(t => 'v'), 'Only visual novels'; - a $f->{t} eq 'r' ? (class => 'optselected') : (), href => $u->(t => 'r'), 'Only releases'; - a $f->{t} eq 'p' ? (class => 'optselected') : (), href => $u->(t => 'p'), 'Only producers'; + a !$f->{t} ? (class => 'optselected') : (), href => $u->(t => ''), mt '_hist_filter_alltypes'; + a $f->{t} eq 'v' ? (class => 'optselected') : (), href => $u->(t => 'v'), mt '_hist_filter_onlyvn'; + a $f->{t} eq 'r' ? (class => 'optselected') : (), href => $u->(t => 'r'), mt '_hist_filter_onlyreleases'; + a $f->{t} eq 'p' ? (class => 'optselected') : (), href => $u->(t => 'p'), mt '_hist_filter_onlyproducers'; end; p class => 'browseopts'; - a !$f->{e} ? (class => 'optselected') : (), href => $u->(e => 0), 'Show all changes'; - a $f->{e} == 1 ? (class => 'optselected') : (), href => $u->(e => 1), 'Only edits'; - a $f->{e} == -1 ? (class => 'optselected') : (), href => $u->(e => -1), 'Only newly created pages'; + a !$f->{e} ? (class => 'optselected') : (), href => $u->(e => 0), mt '_hist_filter_allactions'; + a $f->{e} == 1 ? (class => 'optselected') : (), href => $u->(e => 1), mt '_hist_filter_onlyedits'; + a $f->{e} == -1 ? (class => 'optselected') : (), href => $u->(e => -1), mt '_hist_filter_onlynew'; end; } if($type eq 'v') { p class => 'browseopts'; - a !$f->{r} ? (class => 'optselected') : (), href => $u->(r => 0), 'Exclude edits of releases'; - a $f->{r} ? (class => 'optselected') : (), href => $u->(r => 1), 'Include edits of releases'; + a !$f->{r} ? (class => 'optselected') : (), href => $u->(r => 0), mt '_hist_filter_exrel'; + a $f->{r} ? (class => 'optselected') : (), href => $u->(r => 1), mt '_hist_filter_increl'; end; } end; diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm index 84436c8d..5bfaf94c 100644 --- a/lib/VNDB/Util/CommonHTML.pm +++ b/lib/VNDB/Util/CommonHTML.pm @@ -507,10 +507,10 @@ sub htmlHistory { pageurl => $url, class => 'history', header => [ - sub { td colspan => 2, class => 'tc1', 'Rev.' }, - [ 'Date' ], - [ 'User' ], - sub { td; a href => '#', id => 'history_comments', 'expand'; txt 'Page'; end; } + sub { td colspan => 2, class => 'tc1', mt '_hist_col_rev' }, + [ mt '_hist_col_date' ], + [ mt '_hist_col_user' ], + sub { td; a href => '#', id => 'history_comments', 'expand'; txt mt '_hist_col_page'; end; } ], row => sub { my($s, $n, $i) = @_; -- cgit v1.2.3