diff options
author | Yorhel <git@yorhel.nl> | 2016-01-19 20:29:40 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2016-01-20 21:16:55 +0100 |
commit | a6836df277867d73a71c55797984c947449772cc (patch) | |
tree | c72a326dd844c3c23a932dc76dc159200c1dfcdb /lib/VNDB/Util | |
parent | 0caed2e7674e8ee7419365e76f86d06c33b8c8aa (diff) |
L10N: Intern all VNDB::Util::* stuff
With some related edits in other parts of the code, mostly due to
interface changes to htmlRevision() and htmlFormError().
Trivial replacements were automated by a super awesome script.
Diffstat (limited to 'lib/VNDB/Util')
-rw-r--r-- | lib/VNDB/Util/Auth.pm | 10 | ||||
-rw-r--r-- | lib/VNDB/Util/BrowseHTML.pm | 26 | ||||
-rw-r--r-- | lib/VNDB/Util/CommonHTML.pm | 157 | ||||
-rw-r--r-- | lib/VNDB/Util/FormHTML.pm | 64 | ||||
-rw-r--r-- | lib/VNDB/Util/LayoutHTML.pm | 84 |
5 files changed, 183 insertions, 158 deletions
diff --git a/lib/VNDB/Util/Auth.pm b/lib/VNDB/Util/Auth.pm index 9c742dc7..6e1dfa5d 100644 --- a/lib/VNDB/Util/Auth.pm +++ b/lib/VNDB/Util/Auth.pm @@ -87,10 +87,6 @@ sub authLogout { $self->resRedirect('/', 'temp'); $self->resCookie(auth => undef); - - # set l10n cookie if the user has a preferred language set - my $l10n = $self->authPref('l10n'); - $self->resCookie(l10n => $l10n, expires => time()+31536000) if $l10n; # keep 1 year } @@ -204,12 +200,12 @@ sub authCheckCode { sub _incorrectcode { my $self = shift; $self->resInit; - $self->htmlHeader(title => mt '_formcode_title', noindex => 1); + $self->htmlHeader(title => 'Validation code expired', noindex => 1); div class => 'mainbox'; - h1 mt '_formcode_title'; + h1 'Validation code expired'; div class => 'warning'; - p mt '_formcode_msg'; + p 'Please hit the back-button of your browser, refresh the page and try again.'; end; end; diff --git a/lib/VNDB/Util/BrowseHTML.pm b/lib/VNDB/Util/BrowseHTML.pm index faa9ea3c..c3115017 100644 --- a/lib/VNDB/Util/BrowseHTML.pm +++ b/lib/VNDB/Util/BrowseHTML.pm @@ -107,16 +107,16 @@ sub htmlBrowseNavigate { my $nc = 5; # max. number of buttons on each side ul class => 'maintabs browsetabs ' . ($al eq 't' ? 'notfirst' : 'bottom'); - $p > 2 and ref $np and $tab->(1, 1, '« '.mt '_browse_first'); + $p > 2 and ref $np and $tab->(1, 1, '« first'); $p > $nc+1 and ref $np and $ell->(1); $p > $_ and ref $np and $tab->(1, $p-$_, $p-$_) for (reverse 2..($nc>$p-2?$p-2:$nc-1)); - $p > 1 and $tab->(1, $p-1, '‹ '.mt '_browse_previous'); + $p > 1 and $tab->(1, $p-1, '‹ previous'); my $l = ceil($cnt/$pp)-$p+1; - $l > 2 and $tab->(0, $l+$p-1, mt('_browse_last').' »'); + $l > 2 and $tab->(0, $l+$p-1, 'last »'); $l > $nc+1 and $ell->(0); $l > $_ and $tab->(0, $p+$_, $p+$_) for (reverse 2..($nc>$l-2?$l-2:$nc-1)); - $l > 1 and $tab->(0, $p+1, mt('_browse_next').' ›'); + $l > 1 and $tab->(0, $p+1, 'next ›'); end 'ul'; } @@ -130,10 +130,10 @@ sub htmlBrowseHist { pageurl => $url, class => 'history', header => [ - sub { td class => 'tc1_1', mt '_hist_col_rev'; td class => 'tc1_2', ''; }, - [ mt '_hist_col_date' ], - [ mt '_hist_col_user' ], - [ mt '_hist_col_page' ], + sub { td class => 'tc1_1', 'Rev.'; td class => 'tc1_2', ''; }, + [ 'Date' ], + [ 'User' ], + [ 'Page' ], ], row => sub { my($s, $n, $i) = @_; @@ -170,15 +170,15 @@ sub htmlBrowseVN { pageurl => "$url;o=$f->{o};s=$f->{s}", sorturl => $url, header => [ - $tagscore ? [ mt('_vnbrowse_col_score'), 'tagscore', undef, 'tc_s' ] : (), - [ mt('_vnbrowse_col_title'), 'title', undef, $tagscore ? 'tc_t' : 'tc1' ], + $tagscore ? [ 'Score', 'tagscore', undef, 'tc_s' ] : (), + [ 'Title', 'title', undef, $tagscore ? 'tc_t' : 'tc1' ], $f->{vnlist} ? [ '', 0, undef, 'tc7' ] : (), $f->{wish} ? [ '', 0, undef, 'tc8' ] : (), [ '', 0, undef, 'tc2' ], [ '', 0, undef, 'tc3' ], - [ mt('_vnbrowse_col_released'), 'rel', undef, 'tc4' ], - [ mt('_vnbrowse_col_popularity'), 'pop', undef, 'tc5' ], - [ mt('_vnbrowse_col_rating'), 'rating', undef, 'tc6' ], + [ 'Released', 'rel', undef, 'tc4' ], + [ 'Popularity', 'pop', undef, 'tc5' ], + [ 'Rating', 'rating', undef, 'tc6' ], ], row => sub { my($s, $n, $l) = @_; diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm index cacbae93..e8561e3c 100644 --- a/lib/VNDB/Util/CommonHTML.pm +++ b/lib/VNDB/Util/CommonHTML.pm @@ -29,46 +29,46 @@ sub htmlMainTabs { ul class => 'maintabs'; if($type =~ /[uvrpcs]/) { li $sel eq 'hist' ? (class => 'tabselected') : (); - a href => "/$id/hist", mt '_mtabs_hist'; + a href => "/$id/hist", 'history'; end; } if($type =~ /[uvp]/) { my $cnt = $self->dbThreadCount($type, $obj->{id}); li $sel eq 'disc' ? (class => 'tabselected') : (); - a href => "/t/$id", mt '_mtabs_discuss', $cnt; + a href => "/t/$id", "discussions ($cnt)"; end; } if($type eq 'u') { li $sel eq 'posts' ? (class => 'tabselected') : (); - a href => "/$id/posts", mt '_mtabs_posts'; + a href => "/$id/posts", 'posts'; end; } if($type eq 'u' && (!($obj->{hide_list} || $obj->{prefs}{hide_list}) || ($self->authInfo->{id} && $self->authInfo->{id} == $obj->{id}) || $self->authCan('usermod'))) { li $sel eq 'wish' ? (class => 'tabselected') : (); - a href => "/$id/wish", mt '_mtabs_wishlist'; + a href => "/$id/wish", 'wishlist'; end; li $sel eq 'votes' ? (class => 'tabselected') : (); - a href => "/$id/votes", mt '_mtabs_votes'; + a href => "/$id/votes", 'votes'; end; li $sel eq 'list' ? (class => 'tabselected') : (); - a href => "/$id/list", mt '_mtabs_list'; + a href => "/$id/list", 'list'; end; } if($type eq 'v' && $self->authCan('tag') && !$obj->{hidden}) { li $sel eq 'tagmod' ? (class => 'tabselected') : (); - a href => "/$id/tagmod", mt '_mtabs_tagmod'; + a href => "/$id/tagmod", 'modify tags'; end; } if(($type =~ /[rc]/ && $self->authCan('edit')) && $self->authInfo->{c_changes} > 0) { li $sel eq 'copy' ? (class => 'tabselected') : (); - a href => "/$id/copy", mt '_mtabs_copy'; + a href => "/$id/copy", 'copy'; end; } @@ -77,25 +77,25 @@ sub htmlMainTabs { || $type =~ /[gi]/ && $self->authCan('tagmod') ) { li $sel eq 'edit' ? (class => 'tabselected') : (); - a href => "/$id/edit", mt '_mtabs_edit'; + a href => "/$id/edit", 'edit'; end; } if($type eq 'u' && $self->authCan('usermod')) { li $sel eq 'del' ? (class => 'tabselected') : (); - a href => "/$id/del", mt '_js_remove'; + a href => "/$id/del", 'remove'; end; } if($type eq 'v') { li $sel eq 'releases' ? (class => 'tabselected') : (); - a href => "/$id/releases", mt '_mtabs_releases'; + a href => "/$id/releases", 'releases'; end; } if($type =~ /[vp]/ && $obj->{rgraph}) { li $sel eq 'rg' ? (class => 'tabselected') : (); - a href => "/$id/rg", mt '_mtabs_relations'; + a href => "/$id/rg", 'relations'; end; } @@ -109,16 +109,16 @@ sub htmlMainTabs { # generates a full error page, including header and footer sub htmlDenied { my $self = shift; - $self->htmlHeader(title => mt '_denied_title'); + $self->htmlHeader(title => 'Access Denied'); div class => 'mainbox'; - h1 mt '_denied_title'; + h1 'Access Denied'; div class => 'warning'; if(!$self->authInfo->{id}) { - h2 mt '_denied_needlogin_title'; - p; lit mt '_denied_needlogin_msg'; end; + h2 'You need to be logged in to perform this action.'; + p; lit 'Please <a href="/u/login">login</a>, or <a href="/u/register">create an account</a> if you don\'t have one yet.'; end; } else { - h2 mt '_denied_noaccess_title'; - p mt '_denied_noaccess_msg'; + h2 'You are not allowed to perform this action.'; + p 'It seems you don\'t have the proper rights to perform the action you wanted to perform...'; } end; end 'div'; @@ -142,9 +142,9 @@ sub htmlHiddenMessage { div class => 'mainbox'; h1 $obj->{title}||$obj->{name}; div class => 'warning'; - h2 mt '_hiddenmsg_title'; + h2 'Item deleted'; p; - lit mt '_hiddenmsg_msg', "/t/$board"; + lit 'This item has been deleted from the database. File a request on the <a href="/t/'.$board.'">discussion board</a> to undelete this page.'; br; br; lit bb2html $editsum; end; @@ -168,22 +168,20 @@ sub htmlHiddenMessage { sub htmlRevision { my($self, $type, $old, $new, @fields) = @_; div class => 'mainbox revision'; - h1 mt '_revision_title', $new->{rev}; + h1 "Revision $new->{rev}"; # character information may be rather spoilerous if($type eq 'c') { div class => 'warning'; - h2 mt '_revision_spoil_title'; - lit mt '_revision_spoil_msg', "/c$new->{id}"; + h2 'SPOILER WARNING!'; + lit 'This revision page may contain major spoilers. You may want to view the <a href="/c'.$new->{id}.'">final page</a> instead.'; end; br;br; } # previous/next revision links - a class => 'prev', href => sprintf('/%s%d.%d', $type, $new->{id}, $new->{rev}-1), '<- '.mt '_revision_previous' - if $new->{rev} > 1; - a class => 'next', href => sprintf('/%s%d.%d', $type, $new->{id}, $new->{rev}+1), mt('_revision_next').' ->' - if !$new->{lastrev}; + a class => 'prev', href => sprintf('/%s%d.%d', $type, $new->{id}, $new->{rev}-1), '<- earlier revision' if $new->{rev} > 1; + a class => 'next', href => sprintf('/%s%d.%d', $type, $new->{id}, $new->{rev}+1), 'later revision ->' if !$new->{lastrev}; p class => 'center'; a href => "/$type$new->{id}", "$type$new->{id}"; end; @@ -193,7 +191,7 @@ sub htmlRevision { div class => 'rev'; revheader($self, $type, $new); br; - b mt '_revision_new_summary'; + b 'Edit summary'; br; br; lit bb2html($new->{comments})||'-'; end; @@ -211,15 +209,15 @@ sub htmlRevision { Tr; td; lit ' '; end; td colspan => 2; - b mt '_revision_edit_summary', $new->{rev}; + b "Edit summary of revision $new->{rev}:"; br; br; lit bb2html($new->{comments})||'-'; end; end; end; revdiff($type, $old, $new, @$_) for ( - [ ihid => serialize => sub { mt $_[0] ? '_revision_yes' : '_revision_no' } ], - [ ilock => serialize => sub { mt $_[0] ? '_revision_yes' : '_revision_no' } ], + [ ihid => 'Deleted', serialize => sub { $_[0] ? 'Yes' : 'No' } ], + [ ilock => 'Locked', serialize => sub { $_[0] ? 'Yes' : 'No' } ], @fields ); end 'table'; @@ -229,16 +227,19 @@ sub htmlRevision { sub revheader { # type, obj my($self, $type, $obj) = @_; - b mt '_revision_title', $obj->{rev}; + b "Revision $obj->{rev}"; txt ' ('; - a href => "/$type$obj->{id}.$obj->{rev}/edit", mt '_mtabs_edit'; + a href => "/$type$obj->{id}.$obj->{rev}/edit", 'edit'; txt ')'; br; - lit mt '_revision_user_date', $obj, $obj->{added}; + txt 'By '; + lit fmtuser $obj; + txt ' on '; + txt fmtdate $obj->{added}, 'full'; } sub revdiff { - my($type, $old, $new, $short, %o) = @_; + my($type, $old, $new, $short, $display, %o) = @_; $o{serialize} ||= $o{htmlize}; $o{diff} = 1 if $o{split}; @@ -270,11 +271,11 @@ sub revdiff { $ser2 = html_escape $ser2; } - $ser1 = mt '_revision_empty' if !$ser1 && $ser1 ne '0'; - $ser2 = mt '_revision_empty' if !$ser2 && $ser2 ne '0'; + $ser1 = '[empty]' if !$ser1 && $ser1 ne '0'; + $ser2 = '[empty]' if !$ser2 && $ser2 ne '0'; Tr; - td mt $short eq 'ihid' || $short eq 'ilock' ? "_revfield_$short" : "_revfield_${type}_$short"; + td $display; td class => 'tcval'; lit $ser1; end; td class => 'tcval'; lit $ser2; end; end; @@ -285,35 +286,53 @@ sub revdiff { # Arguments: v/r/p, obj sub htmlEditMessage { my($self, $type, $obj, $title, $copy) = @_; - my $num = {v => 0, r => 1, p => 2, c => 3, 's' => 4}->{$type}; + my $typename = {v => 'visual novel', r => 'release', p => 'producer', c => 'character', s => 'person'}->{$type}; my $guidelines = {v => 2, r => 3, p => 4, c => 12, 's' => 16}->{$type}; div class => 'mainbox'; h1 $title; if($copy) { div class => 'warning'; - h2 mt '_editmsg_copy_title'; + h2 'You\'re not editing an entry!'; p; - lit mt '_editmsg_copy_msg', sprintf '<a href="/%s%d">%s</a>', $type, $obj->{id}, xml_escape $obj->{title}||$obj->{name}; + txt 'You\'re about to insert a new entry into the database with information based on '; + a href => "/$type$obj->{id}", $obj->{title}||$obj->{name}; + txt '.'; + br; + txt 'Hit the \'edit\' tab on the right-top if you intended to edit the entry instead of creating a new one.'; end; end; } div class => 'notice'; - h2 mt '_editmsg_msg_title'; + h2 'Before editing:'; ul; - li; lit mt '_editmsg_msg_guidelines', "/d$guidelines"; end; + li; + txt "Read the "; + a href=> "/d$guidelines", 'guidelines'; + txt '!'; + end; if($obj) { - li; lit mt '_editmsg_msg_discuss', $type =~ /[cs]/ ? '/t/db' : $type eq 'r' ? "/t/v$obj->{vn}[0]{vid}" : "/t/$type$obj->{id}"; end; - li; lit mt '_editmsg_msg_history', "/$type$obj->{id}/hist"; end; + li; + txt 'Check for any existing discussions on the '; + a href => $type =~ /[cs]/ ? '/t/db' : $type eq 'r' ? "/t/v$obj->{vn}[0]{vid}" : "/t/$type$obj->{id}", 'discussion board'; + end; + li; + txt 'Browse the '; + a href => "/$type$obj->{id}/hist", 'edit history'; + txt ' for any recent changes related to what you want to change.'; + end; } elsif($type ne 'r') { - li; lit mt '_editmsg_msg_search', "/$type/all", $num; end; + li; + a href => "/$type/all", 'Search the database'; + txt " to see if we already have information about this $typename."; + end; } end; end; if($obj && !$obj->{lastrev}) { div class => 'warning'; - h2 mt '_editmsg_revert_title'; - p mt '_editmsg_revert_msg', $num; + h2 'Reverting'; + p "You are editing an old revision of this $typename. If you save it, all changes made after this revision will be reverted!"; end; } end 'div'; @@ -328,9 +347,9 @@ sub htmlItemMessage { # $type isn't being used at all... oh well. if($obj->{locked}) { - p class => 'locked', mt '_itemmsg_locked'; + p class => 'locked', 'Locked for editing'; } elsif($self->authInfo->{id} && !$self->authCan('edit')) { - p class => 'locked', mt '_itemmsg_denied'; + p class => 'locked', 'You are not allowed to edit this page'; } } @@ -348,11 +367,11 @@ sub htmlVoteStats { div class => 'votestats'; table class => 'votegraph'; thead; Tr; - td colspan => 2, mt '_votestats_title'; + td colspan => 2, 'Vote stats'; end; end; tfoot; Tr; - td colspan => 2, mt('_votestats_sum', $count, sprintf('%.2f', $total/$count/10)) - .($type eq 'v' ? ' ('.mt('_vote_'.(ceil($total/$count/10-1)||1)).')' : ''); + td colspan => 2, sprintf '%d vote%s total, average %.2f%s', $count, $count == 1 ? '' : 's', $total/$count/10, + $type eq 'v' ? ' ('.fmtrating(ceil($total/$count/10-1)||1).')' : ''; end; end; for (reverse 0..$#$stats) { Tr; @@ -376,10 +395,10 @@ sub htmlVoteStats { table class => 'recentvotes stripe'; thead; Tr; td colspan => 3; - txt mt '_votestats_recent'; + txt 'Recent votes'; b; txt '('; - a href => "/$type$obj->{id}/votes", mt '_votestats_allvotes'; + a href => "/$type$obj->{id}/votes", 'show all'; txt ')'; end; end; @@ -403,9 +422,9 @@ sub htmlVoteStats { clearfloat; if($type eq 'v' && $obj->{c_votecount}) { div; - h3 mt '_votestats_rank_title'; - p mt '_votestats_rank_pop', $obj->{p_ranking}, sprintf '%.2f', ($obj->{c_popularity}||0)*100; - p mt '_votestats_rank_rat', $obj->{r_ranking}, sprintf '%.2f', $obj->{c_rating}/10; + h3 'Ranking'; + p sprintf 'Popularity: ranked #%d with a score of %.2f', $obj->{p_ranking}, ($obj->{c_popularity}||0)*100; + p sprintf 'Bayesian rating: ranked #%d with a rating of %.2f', $obj->{r_ranking}, $obj->{c_rating}/10; end; } end 'div'; @@ -417,17 +436,17 @@ sub htmlSearchBox { fieldset class => 'search'; p id => 'searchtabs'; - a href => '/v/all', $sel eq 'v' ? (class => 'sel') : (), mt '_searchbox_vn'; - a href => '/r', $sel eq 'r' ? (class => 'sel') : (), mt '_searchbox_releases'; - a href => '/p/all', $sel eq 'p' ? (class => 'sel') : (), mt '_searchbox_producers'; - a href => '/s/all', $sel eq 's' ? (class => 'sel') : (), mt '_searchbox_staff'; - a href => '/c/all', $sel eq 'c' ? (class => 'sel') : (), mt '_searchbox_chars'; - a href => '/g', $sel eq 'g' ? (class => 'sel') : (), mt '_searchbox_tags'; - a href => '/i', $sel eq 'i' ? (class => 'sel') : (), mt '_searchbox_traits'; - a href => '/u/all', $sel eq 'u' ? (class => 'sel') : (), mt '_searchbox_users'; + a href => '/v/all', $sel eq 'v' ? (class => 'sel') : (), 'Visual novels'; + a href => '/r', $sel eq 'r' ? (class => 'sel') : (), 'Releases'; + a href => '/p/all', $sel eq 'p' ? (class => 'sel') : (), 'Producers'; + a href => '/s/all', $sel eq 's' ? (class => 'sel') : (), 'Staff'; + a href => '/c/all', $sel eq 'c' ? (class => 'sel') : (), 'Characters'; + a href => '/g', $sel eq 'g' ? (class => 'sel') : (), 'Tags'; + a href => '/i', $sel eq 'i' ? (class => 'sel') : (), 'Traits'; + a href => '/u/all', $sel eq 'u' ? (class => 'sel') : (), 'Users'; end; input type => 'text', name => 'q', id => 'q', class => 'text', value => $v; - input type => 'submit', class => 'submit', value => mt '_searchbox_submit'; + input type => 'submit', class => 'submit', value => 'Search!'; end 'fieldset'; } @@ -442,8 +461,8 @@ sub htmlRGHeader { div class => 'mainbox'; h1 $title; div class => 'warning'; - h2 mt '_rg_notsupp'; - p mt '_rg_notsupp_msg'; + h2 'Not supported'; + p 'Your browser sucks, it doesn\'t have the functionality to render our nice relation graphs.'; end; end; $self->htmlFooter; diff --git a/lib/VNDB/Util/FormHTML.pm b/lib/VNDB/Util/FormHTML.pm index cca2b150..51d5a4f6 100644 --- a/lib/VNDB/Util/FormHTML.pm +++ b/lib/VNDB/Util/FormHTML.pm @@ -20,37 +20,41 @@ sub htmlFormError { return if !$frm->{_err}; if($mainbox) { div class => 'mainbox'; - h1 mt '_formerr_title'; + h1 'Error'; } div class => 'warning'; - h2 mt '_formerr_subtitle'; + h2 'Form could not be sent:'; ul; for my $e (@{$frm->{_err}}) { if(!ref $e) { - li; lit mt '_formerr_e_'.$e; end; + li $e; next; } - my($field, $type, $rule) = @$e; - if($type eq 'required') { - li; lit mt $field eq 'editsum' ?'_formerr_tpl_editsum' : '_formerr_required', $field; end; + if(ref $e eq 'SCALAR') { + li; lit $$e; end; + next; } - li mt '_formerr_mincount', $field, $rule if $type eq 'mincount'; - li mt '_formerr_maxcount', $field, $rule if $type eq 'maxcount'; - li mt '_formerr_minlength', $field, $rule if $type eq 'minlength'; - li mt '_formerr_maxlength', $field, $rule if $type eq 'maxlength'; - li mt '_formerr_enum', $field, join ', ', @$rule if $type eq 'enum'; - li mt '_formerr_wrongboard', $rule if $type eq 'wrongboard'; - li mt '_formerr_existingalias', $rule if $type eq 'existingalias'; + my($field, $type, $rule) = @$e; + ($type, $rule) = ('template', 'editsum') if $type eq 'required' && $field eq 'editsum'; + + li "$field is a required field" if $type eq 'required';; + li "$field: minimum number of values is $rule" if $type eq 'mincount'; + li "$field: maximum number of values is $rule" if $type eq 'maxcount'; + li "$field: should have at least $rule characters" if $type eq 'minlength'; + li "$field: only $rule characters allowed" if $type eq 'maxlength'; + li "$field must be one of the following: ".join(', ', @$rule) if $type eq 'enum'; li $rule->[1] if $type eq 'func' || $type eq 'regex'; if($type eq 'template') { - $rule = 'int' if $rule eq 'num' || $rule eq 'uint' || $rule eq 'page' || $rule eq 'id'; - li; lit mt "_formerr_tpl_$rule", $field; end; - } - if($type eq 'tagexists') { - li; lit mt '_formerr_tagexists', "/g$rule->{id}", $rule->{name}; end; - } - if($type eq 'traitexists') { - li; lit mt '_formerr_traitexists', "/i$rule->{id}", $rule->{name}; end; + li "$field: Invalid number" if $rule eq 'int' || $rule eq 'num' || $rule eq 'uint' || $rule eq 'page' || $rule eq 'id'; + li "$field: Invalid URL" if $rule eq 'weburl'; + li "$field: only ASCII characters allowed" if $rule eq 'ascii'; + li "Invalid email address" if $rule eq 'email'; + li "$field may only contain lowercase alphanumeric characters and a hyphen" if $rule eq 'uname'; + li 'Invalid JAN/UPC/EAN' if $rule eq 'gtin'; + li "$field: Malformed data or invalid input" if $rule eq 'json'; + if($rule eq 'editsum') { + li; lit 'Please read <a href="/d5.4">the guidelines</a> on how to use the edit summary.'; end; + } } } end; @@ -209,7 +213,7 @@ sub htmlForm { end; } li class => 'left'; - a href => '#all', id => 'jt_sel_all', mt '_form_tab_all'; + a href => '#all', id => 'jt_sel_all', 'All items'; end; end 'ul'; } @@ -238,26 +242,26 @@ sub htmlForm { if($self->authCan('dbmod')) { input type => 'checkbox', name => 'ihid', id => 'ihid', value => 1, tabindex => 10, $options->{frm}{ihid} ? (checked => 'checked') : (); - label for => 'ihid', mt '_form_ihid'; + label for => 'ihid', 'Deleted'; input type => 'checkbox', name => 'ilock', id => 'ilock', value => 1, tabindex => 10, $options->{frm}{ilock} ? (checked => 'checked') : (); - label for => 'ilock', mt '_form_ilock'; - br; txt mt('_form_hidlock_note'); br; + label for => 'ilock', 'Locked'; + br; txt 'Note: edit summary of the last edit should indicate the reason for the deletion.'; br; } # edit summary h2; - txt mt '_form_editsum'; - b class => 'standout', ' ('.mt('_inenglish').')'; + txt 'Edit summary'; + b class => 'standout', ' (English please!)'; end; textarea name => 'editsum', id => 'editsum', rows => 4, cols => 50, tabindex => 10, $options->{frm}{editsum}||''; br; } if(!$options->{continue}) { - input type => 'submit', value => mt('_form_submit'), class => 'submit', tabindex => 10; + input type => 'submit', value => 'Submit', class => 'submit', tabindex => 10; } else { - input type => 'submit', value => mt('_form_continue'), class => 'submit', tabindex => 10; - input type => 'submit', name => 'continue_ign', value => mt('_form_continue_ign'), + input type => 'submit', value => 'Continue', class => 'submit', tabindex => 10; + input type => 'submit', name => 'continue_ign', value => 'Continue and ignore duplicates', class => 'submit', style => 'width: auto', tabindex => 10 if $options->{continue} == 2; } end; diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm index 36fa9937..c06e0204 100644 --- a/lib/VNDB/Util/LayoutHTML.pm +++ b/lib/VNDB/Util/LayoutHTML.pm @@ -36,7 +36,7 @@ sub htmlHeader { # %options->{ title, noindex, search, feeds, svg } div id => 'bgright', ' '; div id => 'header'; h1; - a href => '/', lc mt '_site_title'; + a href => '/', 'the visual novel database'; end; end; @@ -53,27 +53,27 @@ sub _menu { div class => 'menubox'; h2; - txt mt '_menu'; + txt 'Menu'; end; div; - a href => '/', mt '_menu_home'; br; - a href => '/v/all', mt '_menu_vn'; br; - b class => 'grayedout', '> '; a href => '/g', mt '_menu_tags'; br; - a href => '/r', mt '_menu_releases'; br; - a href => '/p/all', mt '_menu_producers'; br; - a href => '/s/all', mt '_menu_staff'; br; - a href => '/c/all', mt '_menu_characters'; br; - b class => 'grayedout', '> '; a href => '/i', mt '_menu_traits'; br; - a href => '/u/all', mt '_menu_users'; br; - a href => '/hist', mt '_menu_recent_changes'; br; - a href => '/t', mt '_menu_discussion_board'; br; - a href => '/d6', mt '_menu_faq'; br; - a href => '/v/rand', mt '_menu_randvn'; + a href => '/', 'Home'; br; + a href => '/v/all', 'Visual novels'; br; + b class => 'grayedout', '> '; a href => '/g', 'Tags'; br; + a href => '/r', 'Releases'; br; + a href => '/p/all', 'Producers'; br; + a href => '/s/all', 'Staff'; br; + a href => '/c/all', 'Characters'; br; + b class => 'grayedout', '> '; a href => '/i', 'Traits'; 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 => '/v/rand','Random visual novel'; end; form action => '/v/all', method => 'get', id => 'search'; fieldset; legend 'Search'; - input type => 'text', class => 'text', id => 'sq', name => 'sq', value => $o{search}||'', placeholder => mt('_menu_emptysearch'); + input type => 'text', class => 'text', id => 'sq', name => 'sq', value => $o{search}||'', placeholder => 'search'; input type => 'submit', class => 'submit', value => 'Search'; end; end; @@ -87,42 +87,48 @@ sub _menu { a href => $uid, ucfirst $self->authInfo->{username}; end; div; - a href => "$uid/edit", mt '_menu_myprofile'; br; - a href => "$uid/list", mt '_menu_myvnlist'; br; - a href => "$uid/votes",mt '_menu_myvotes'; br; - a href => "$uid/wish", mt '_menu_mywishlist'; br; - a href => "$uid/notifies", $nc ? (class => 'notifyget') : (), mt('_menu_mynotifications').($nc?" ($nc)":''); br; - a href => "$uid/hist", mt '_menu_mychanges'; br; - a href => '/g/links?u='.$self->authInfo->{id}, mt '_menu_mytags'; br; + a href => "$uid/edit", 'My Profile'; br; + a href => "$uid/list", 'My Visual Novel List'; br; + a href => "$uid/votes",'My Votes'; br; + a href => "$uid/wish", 'My Wishlist'; br; + a href => "$uid/notifies", $nc ? (class => 'notifyget') : (), 'My Notifications'.($nc?" ($nc)":''); br; + a href => "$uid/hist", 'My Recent Changes'; br; + a href => '/g/links?u='.$self->authInfo->{id}, 'My Tags'; br; br; if($self->authCan('edit')) { - a href => '/v/add', mt '_menu_addvn'; br; - a href => '/p/new', mt '_menu_addproducer'; br; - a href => '/s/new', mt '_menu_addstaff'; br; - a href => '/c/new', mt '_menu_addcharacter'; br; + a href => '/v/add', 'Add Visual Novel'; br; + a href => '/p/new', 'Add Producer'; br; + a href => '/s/new', 'Add Staff'; br; + a href => '/c/new', 'Add Character'; br; } br; - a href => "$uid/logout", mt '_menu_logout'; + a href => "$uid/logout", 'Logout'; end; } else { - h2 mt '_menu_user'; + h2 'User menu'; div; my $ref = uri_escape $self->reqPath().$self->reqQuery(); - a href => "/u/login?ref=$ref", mt '_menu_login'; br; - a href => '/u/newpass', mt '_menu_newpass'; br; - a href => '/u/register', mt '_menu_register'; br; + a href => "/u/login?ref=$ref", 'Login'; br; + a href => '/u/newpass', 'Password reset'; br; + a href => '/u/register', 'Register'; br; end; } end 'div'; # /menubox div class => 'menubox'; - h2 mt '_menu_dbstats'; + h2 'Database Statistics'; div; dl; - for (qw|vn releases producers chars staff tags traits users threads posts|) { - dt mt "_menu_stat_$_"; - dd $self->{stats}{$_}; - } + dt 'Visual Novels'; dd $self->{stats}{vn}; + dt 'Releases'; dd $self->{stats}{releases}; + dt 'Producers'; dd $self->{stats}{producers}; + dt 'Characters'; dd $self->{stats}{chars}; + dt 'Staff'; dd $self->{stats}{staff}; + dt 'VN Tags'; dd $self->{stats}{tags}; + dt 'Character Traits';dd $self->{stats}{traits}; + dt 'Users'; dd $self->{stats}{users}; + dt 'Threads'; dd $self->{stats}{threads}; + dt 'Posts'; dd $self->{stats}{posts}; end; clearfloat; end; @@ -144,13 +150,13 @@ sub htmlFooter { # %options => { pref_code => 1 } } txt "vndb $self->{version} | "; - a href => '/d7', mt '_footer_aboutus'; + a href => '/d7', 'about us'; txt ' | '; a href => 'irc://irc.synirc.net/vndb', '#vndb'; txt ' | '; a href => "mailto:$self->{admin_email}", $self->{admin_email}; txt ' | '; - a href => $self->{source_url}, mt '_footer_source'; + a href => $self->{source_url}, 'source'; end; end 'div'; # /maincontent |