diff options
author | Yorhel <git@yorhel.nl> | 2009-08-17 20:59:06 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-08-17 20:59:06 +0200 |
commit | e7a73f04525ad18b0bd2be8996431ecaf8eff330 (patch) | |
tree | fe900a76138d12bf9453316debb03901ee74752a | |
parent | 990cab1ec8acd0f5f776336b492d5abcd067423c (diff) |
L10N: Converted Handler::Producers
Hmmm, I think I'll need to update some of the utility functions to take
more functionality from the Handler pages in regard to getting text
strings. Using mt() on everything that is essentially already passed to
other functions with a unique string for identification is a bit double.
So far I've updated htmlRevision to do this. (The name argument is
still present but currently ignored, to preserve backwards compatility,
the rest of the code will be updated soon.) Other utility functions like
htmlForm should probably do something like that as well.
-rw-r--r-- | data/lang.txt | 129 | ||||
-rw-r--r-- | lib/VNDB/Handler/Producers.pm | 38 | ||||
-rw-r--r-- | lib/VNDB/Util/CommonHTML.pm | 7 |
3 files changed, 152 insertions, 22 deletions
diff --git a/data/lang.txt b/data/lang.txt index 31d8cf5f..dd954c3d 100644 --- a/data/lang.txt +++ b/data/lang.txt @@ -945,6 +945,135 @@ ru*: +############################################################################# +## Producer pages (/p/*) ## +############################################################################# +# Handler::Producers + + +# Producer page (/p+) + +# 1 = Language, 2 = Type, so '[_1] [_2]' => 'Japanese company' +# if this doesn't work in other languages, be creative :-) +:_prodpage_langtype +en : [_1] [_2] +ru*: + +:_prodpage_aliases +en : a.k.a. [_1] +ru*: + +:_prodpage_vnrel +en : Visual Novel Relations +ru*: + +:_prodpage_norel +en : We have currently no visual novels by this producer. +ru*: + + +# producer diff fields + +:_revfield_p_type +en : Type +ru*: + +:_revfield_p_name +en : Name (romaji) +ru*: + +:_revfield_p_original +en : Original name +ru*: + +:_revfield_p_alias +en : Aliases +ru*: + +:_revfield_p_lang +en : Language +ru*: + +:_revfield_p_website +en : Website +ru*: + +:_revfield_p_desc +en : Description +ru*: + + +# Add/Edit producer + +:_pedit_title_edit +en : Edit [_1] +ru*: + +:_pedit_title_add +en : Add new producer +ru*: + +:_pedit_form_generalinfo +en : General info +ru*: + +:_pedit_form_type +en : Type +ru*: + +:_pedit_form_name +en : Name (romaji) +ru*: + +:_pedit_form_original +en : Original name +ru*: + +:_pedit_form_original_note +en : The original name of the producer, leave blank if it is already in the Latin alphabet. +ru*: + +:_pedit_form_alias +en : Aliases +ru*: + +:_pedit_form_alias_note +en : (Un)official aliases, separated by a comma. +ru*: + +:_pedit_form_lang +en : Primary language +ru*: + +:_pedit_form_website +en : Website +ru*: + +:_pedit_form_desc +en : Description +ru*: + + +# Browse/search producers + +:_pbrowse_title +en : Browse producers +ru*: + +:_pbrowse_searchres +en : Search results +ru*: + +:_pbrowse_list +en : Producer list +ru*: + +:_pbrowse_noresults +en : No results found +ru*: + + + ############################################################################# ## Misc. messages ## diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm index cc7e1324..1b192e2d 100644 --- a/lib/VNDB/Handler/Producers.pm +++ b/lib/VNDB/Handler/Producers.pm @@ -48,8 +48,8 @@ sub page { h1 $p->{name}; h2 class => 'alttitle', $p->{original} if $p->{original}; p class => 'center'; - txt mt("_lang_$p->{lang}")." ".lc(mt "_ptype_$p->{type}"); - txt "\na.k.a. $p->{alias}" if $p->{alias}; + txt mt '_prodpage_langtype', mt("_lang_$p->{lang}"), mt "_ptype_$p->{type}"; + txt "\n".mt '_progpage_aliases', $p->{alias} if $p->{alias}; if($p->{website}) { txt "\n"; a href => $p->{website}, $p->{website}; @@ -64,9 +64,9 @@ sub page { end; div class => 'mainbox producerpage'; - h1 'Visual Novel Relations'; + h1 mt '_prodpage_vnrel'; if(!@{$p->{vn}}) { - p 'We have currently no visual novels related to this producer.'; + p mt '_prodpage_norel'; } else { ul; for (@{$p->{vn}}) { @@ -129,22 +129,22 @@ sub edit { $frm->{lang} = 'ja' if !$pid && !defined $frm->{lang}; $frm->{editsum} = sprintf 'Reverted to revision p%d.%d', $pid, $rev if $rev && !defined $frm->{editsum}; - my $title = $pid ? 'Edit '.$p->{name} : 'Add new producer'; + my $title = mt $pid ? ('_pedit_title_edit', $p->{name}) : '_pedit_title_add'; $self->htmlHeader(title => $title, noindex => 1); $self->htmlMainTabs('p', $p, 'edit') if $pid; $self->htmlEditMessage('p', $p, $title); - $self->htmlForm({ frm => $frm, action => $pid ? "/p$pid/edit" : '/p/new', editsum => 1 }, "General info" => [ - [ select => name => 'Type', short => 'type', + $self->htmlForm({ frm => $frm, action => $pid ? "/p$pid/edit" : '/p/new', editsum => 1 }, mt('_pedit_form_generalinfo') => [ + [ select => name => mt('_pedit_form_type'), short => 'type', options => [ map [ $_, mt "_ptype_$_" ], sort @{$self->{producer_types}} ] ], - [ input => name => 'Name (romaji)', short => 'name' ], - [ input => name => 'Original name', short => 'original' ], - [ static => content => q|The original name of the producer, leave blank if it is already in the Latin alphabet.| ], - [ input => name => 'Aliases', short => 'alias', width => 400 ], - [ static => content => q|(Un)official aliases, separated by a comma.| ], - [ select => name => 'Primary language', short => 'lang', + [ input => name => mt('_pedit_form_name'), short => 'name' ], + [ input => name => mt('_pedit_form_original'), short => 'original' ], + [ static => content => mt('_pedit_form_original_note') ], + [ input => name => mt('_pedit_form_alias'), short => 'alias', width => 400 ], + [ static => content => mt('_pedit_form_alias_note') ], + [ select => name => mt('_pedit_form_lang'), short => 'lang', options => [ map [ $_, "$_ (".mt("_lang_$_").')' ], sort @{$self->{languages}} ] ], - [ input => name => 'Website', short => 'website' ], - [ text => name => 'Description', short => 'desc', rows => 6 ], + [ input => name => mt('_pedit_form_website'), short => 'website' ], + [ text => name => mt('_pedit_form_desc'), short => 'desc', rows => 6 ], ]); $self->htmlFooter; } @@ -166,10 +166,10 @@ sub list { page => $f->{p} ); - $self->htmlHeader(title => 'Browse producers'); + $self->htmlHeader(title => mt '_pbrowse_title'); div class => 'mainbox'; - h1 'Browse producers'; + h1 mt '_pbrowse_title'; form action => '/p/all', 'accept-charset' => 'UTF-8', method => 'get'; $self->htmlSearchBox('p', $f->{q}); end; @@ -183,9 +183,9 @@ sub list { my $pageurl = "/p/$char" . ($f->{q} ? "?q=$f->{q}" : ''); $self->htmlBrowseNavigate($pageurl, $f->{p}, $np, 't'); div class => 'mainbox producerbrowse'; - h1 $f->{q} ? 'Search results' : 'Producer list'; + h1 mt $f->{q} ? '_pbrowse_searchres' : '_pbrowse_list'; if(!@$list) { - p 'No results found'; + p mt '_pbrowse_noresults'; } else { # spread the results over 3 equivalent-sized lists my $perlist = @$list/3 < 1 ? 1 : @$list/3; diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm index d44669e2..66b79494 100644 --- a/lib/VNDB/Util/CommonHTML.pm +++ b/lib/VNDB/Util/CommonHTML.pm @@ -302,7 +302,7 @@ sub htmlRevision { end; end; my $i = 1; - revdiff(\$i, $old, $new, @$_) for (@fields); + revdiff(\$i, $type, $old, $new, @$_) for (@fields); end; } end; @@ -319,7 +319,8 @@ sub revheader { # type, obj } sub revdiff { - my($i, $old, $new, $short, $name, %o) = @_; + my($i, $type, $old, $new, $short, $name, %o) = @_; + # TODO: remove $name, it won't be used $o{serialize} ||= $o{htmlize}; $o{diff}++ if $o{split}; @@ -355,7 +356,7 @@ sub revdiff { $ser2 = mt '_revision_emptyfield' if !$ser2 && $ser2 ne '0'; Tr $$i++ % 2 ? (class => 'odd') : (); - td $name; + td mt "_revfield_${type}_$short"; td class => 'tcval'; lit $ser1; end; td class => 'tcval'; lit $ser2; end; end; |