From f9727660df7590e93d2d929a70fd0dc41dd0ff2f Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sat, 5 Sep 2009 12:54:06 +0200 Subject: L10N: Converted Handler::VNBrowse and Handler::VNEdit --- data/lang.txt | 219 +++++++++++++++++++++++++++++++++++++++++++ lib/VNDB/Handler/VNBrowse.pm | 41 ++++---- lib/VNDB/Handler/VNEdit.pm | 76 ++++++--------- 3 files changed, 270 insertions(+), 66 deletions(-) diff --git a/data/lang.txt b/data/lang.txt index 520f13e2..3d944840 100644 --- a/data/lang.txt +++ b/data/lang.txt @@ -2379,6 +2379,225 @@ ru*: +############################################################################# +## Visual novel pages ## +############################################################################# +# Handler::VNBrowse +# Handler::VNEdit + + +# VN browser (/v/all) + +:_vnbrowse_title +en : Browse visual novels +ru*: + +:_vnbrowse_col_score +en : Score +ru*: + +:_vnbrowse_col_title +en : Title +ru*: + +:_vnbrowse_col_released +en : Released +ru*: + +:_vnbrowse_col_popularity +en : Popularity +ru*: + +:_vnbrowse_tagign_title +en : The following tags were ignored: +ru*: + +:_vnbrowse_tagign_meta +en : can't filter on meta tags +ru*: + +:_vnbrowse_tagign_notfound +en : no such tag found +ru*: + +:_vnbrowse_advsearch +en : advanced search +ru*: + +:_vnbrowse_tags +en : Tag filters +ru*: + +:_vnbrowse_booland +en : boolean and, selecting more gives less results +ru*: + +:_vnbrowse_taginc +en : Tags to include +ru*: + +:_vnbrowse_tagexc +en : Tags to exclude +ru*: + +:_vnbrowse_spoil0 +en : Hide spoilers +ru*: + +:_vnbrowse_spoil1 +en : Show minor spoilers +ru*: + +:_vnbrowse_spoil2 +en : Show major spoilers +ru*: + +:_vnbrowse_lang +en : Languages +ru*: + +:_vnbrowse_boolor +en : boolean or, selecting more gives more results +ru*: + +:_vnbrowse_plat +en : Platforms +ru*: + +:_vnbrowse_apply +en : Apply +ru*: + +:_vnbrowse_clear +en : Clear +ru*: + + +# VN add/edit form (/v+/edit) + +:_vnedit_title_edit +en : Edit [_1] +ru*: + +:_vnedit_title_add +en : Add a new visual novel +ru*: + +:_vnedit_geninfo +en : General info +ru*: + +:_vnedit_frm_title +en : Title (romaji) +ru*: + +:_vnedit_original +en : Original title +ru*: + +:_vnedit_original_msg +en : The original title of this visual novel, leave blank if it already is in the Latin alphabet. +ru*: + +:_vnedit_alias +en : Aliases +ru*: + +:_vnedit_alias_msg +en : Comma seperated list of alternative titles or abbreviations. Can include both official + (japanese/english) titles and unofficial titles used around net.[br] + Titles that are listed in the releases should not be added here! +ru*: + +:_vnedit_desc +en : Description +ru*: + +:_vnedit_desc_msg +en : Short description of the main story. Please do not include spoilers, and don't forget to list + the source in case you didn't write the description yourself. (formatting codes are allowed) +ru*: + +:_vnedit_length +en : Length +ru*: + +:_vnedit_links +en : External links +ru*: + +:_vnedit_anime +en : Anime +ru*: + +:_vnedit_anime_msg +en : Whitespace seperated list of [url,http://anidb.net/,AniDB] anime IDs. + E.g. "1015 3348" will add [url,http://anidb.net/a1015,Shingetsutan Tsukihime] + and [url,http://anidb.net/a3348,Fate/stay night] as related anime.[br] + Note: It can take a few minutes for the anime titles to appear on the VN page. +ru*: + +:_vnedit_image +en : Image +ru*: + +:_vnedit_image_none +en : No image uploaded yet +ru*: + +:_vnedit_image_processing +en : ~[processing image, please return in a few minutes~] +ru*: + +:_vnedit_image_upload +en : Upload new image +ru*: + +:_vnedit_image_upload_msg +en : Preferably the cover of the CD/DVD/package. Image must be in JPEG or PNG format + and at most 500kB. Images larger than 256x400 will automatically be resized. +ru*: + +:_vnedit_image_nsfw +en : NSFW +ru*: + +:_vnedit_image_nsfw_check +en : Not Safe For Work +ru*: + +:_vnedit_image_nsfw_msg +en : Please check this option if the image contains nudity, gore, or is otherwise not safe in a work-friendly environment. +ru*: + +:_vnedit_rel +en : Relations +ru*: + +:_vnedit_rel_sel +en : Selected relations +ru*: + +:_vnedit_rel_add +en : Add relation +ru*: + +:_vnedit_scr +en : Screenshots +ru*: + +:_vnedit_scr_msg +en : Please keep the following in mind when uploading screenshots:[br] + - Screenshots have to be in the native resolution of the game,[br] + - Remove any window borders and make sure the image is unmarked,[br] + - Don't only upload event CGs.[br] + Please read the [url,/d2#6,guidelines] for more information.[br] + Make sure to submit the form after the upload has finished! +ru*: + + + + ############################################################################# ## Misc. messages ## ############################################################################# diff --git a/lib/VNDB/Handler/VNBrowse.pm b/lib/VNDB/Handler/VNBrowse.pm index e11a2942..ab3d02b2 100644 --- a/lib/VNDB/Handler/VNBrowse.pm +++ b/lib/VNDB/Handler/VNBrowse.pm @@ -70,7 +70,7 @@ sub list { $self->resRedirect('/v'.$list->[0]{id}, 'temp') if $f->{q} && @$list == 1; - $self->htmlHeader(title => 'Browse visual novels', search => $f->{q}, js => 'forms'); + $self->htmlHeader(title => mt('_vnbrowse_title'), search => $f->{q}, js => 'forms'); _filters($self, $f, $char, \@ignored); my $url = "/v/$char?q=$f->{q};ti=$f->{ti};te=$f->{te}"; @@ -84,12 +84,12 @@ sub list { pageurl => "$url;o=$f->{o};s=$f->{s}", sorturl => $url, header => [ - @ti ? [ 'Score', 'tagscore', undef, 'tc_s' ] : (), - [ 'Title', 'title', undef, @ti ? 'tc_t' : 'tc1' ], - [ '', 0, undef, 'tc2' ], - [ '', 0, undef, 'tc3' ], - [ 'Released', 'rel', undef, 'tc4' ], - [ 'Popularity', 'pop', undef, 'tc5' ], + @ti ? [ mt('_vnbrowse_col_score'), 'tagscore', undef, 'tc_s' ] : (), + [ mt('_vnbrowse_col_title'), 'title', undef, @ti ? 'tc_t' : 'tc1' ], + [ '', 0, undef, 'tc2' ], + [ '', 0, undef, 'tc3' ], + [ mt('_vnbrowse_col_released'), 'rel', undef, 'tc4' ], + [ mt('_vnbrowse_col_popularity'), 'pop', undef, 'tc5' ], ], row => sub { my($s, $n, $l) = @_; @@ -126,7 +126,7 @@ sub _filters { form action => '/v/all', 'accept-charset' => 'UTF-8', method => 'get'; div class => 'mainbox'; - h1 'Browse visual novels'; + h1 mt '_vnbrowse_title'; $self->htmlSearchBox('v', $f->{q}); p class => 'browseopts'; for ('all', 'a'..'z', 0) { @@ -136,29 +136,31 @@ sub _filters { if(@$ign) { div class => 'warning'; - h2 'The following tags were ignored:'; + h2 mt '_vnbrowse_tagign_title'; ul; - li $_->[0].' ('.($_->[1]?"can't filter on meta tags":"no such tag found").')' for @$ign; + li $_->[0].' ('.mt('_vnbrowse_tagign_'.($_->[1]?'meta':'notfound')).')' for @$ign; end; end; } a id => 'advselect', href => '#'; - lit ' advanced search'; + lit ' '.mt('_vnbrowse_advsearch'); end; div id => 'advoptions', class => 'hidden vnoptions'; h2; - lit 'Tag filters (boolean and, selecting more gives less results)'; + txt mt '_vnbrowse_tags'; + b ' ('.mt('_vnbrowse_booland').')'; end; table class => 'formtable', style => 'margin-left: 0'; - $self->htmlFormPart($f, [ input => short => 'ti', name => 'Tags to include', width => 350 ]); - $self->htmlFormPart($f, [ radio => short => 'sp', name => '', options => [[0,'Hide spoilers'],[1,'Show minor spoilers'],[2,'Show major spoilers']]]); - $self->htmlFormPart($f, [ input => short => 'te', name => 'Tags to exclude', width => 350 ]); + $self->htmlFormPart($f, [ input => short => 'ti', name => mt('_vnbrowse_taginc'), width => 350 ]); + $self->htmlFormPart($f, [ radio => short => 'sp', name => '', options => [map [$_, mt '_vnbrowse_spoil'.$_], 0..2]]); + $self->htmlFormPart($f, [ input => short => 'te', name => mt('_vnbrowse_tagexc'), width => 350 ]); end; h2; - lit 'Languages (boolean or, selecting more gives more results)'; + txt mt '_vnbrowse_lang'; + b ' ('.mt('_vnbrowse_boolor').')'; end; for my $i (sort @{$self->dbLanguages}) { span; @@ -172,7 +174,8 @@ sub _filters { } h2; - lit 'Platforms (boolean or, selecting more gives more results)'; + txt mt '_vnbrowse_plat'; + b ' ('.mt('_vnbrowse_boolor').')'; end; for my $i (sort @{$self->{platforms}}) { next if $i eq 'oth'; @@ -187,8 +190,8 @@ sub _filters { } div style => 'text-align: center; clear: left;'; - input type => 'submit', value => 'Apply', class => 'submit'; - input type => 'reset', value => 'Clear', class => 'submit', onclick => 'location.href="/v/all"'; + input type => 'submit', value => mt('_vnbrowse_apply'), class => 'submit'; + input type => 'reset', value => mt('_vnbrowse_clear'), class => 'submit', onclick => 'location.href="/v/all"'; end; end; end; diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm index f718fbfa..fdd892c1 100644 --- a/lib/VNDB/Handler/VNEdit.pm +++ b/lib/VNDB/Handler/VNEdit.pm @@ -4,6 +4,7 @@ package VNDB::Handler::VNEdit; use strict; use warnings; use YAWF ':html', ':xml'; +use VNDB::Func; YAWF::register( @@ -95,7 +96,7 @@ sub edit { !exists $frm->{$_} && ($frm->{$_} = $b4{$_}) for (keys %b4); $frm->{editsum} = sprintf 'Reverted to revision v%d.%d', $vid, $rev if $rev && !defined $frm->{editsum}; - my $title = $vid ? "Edit $v->{title}" : 'Add a new visual novel'; + my $title = $vid ? mt('_vnedit_title_edit', $v->{title}) : mt '_vnedit_title_add'; $self->htmlHeader(js => 'forms', title => $title, noindex => 1); $self->htmlMainTabs('v', $v, 'edit') if $vid; $self->htmlEditMessage('v', $v, $title); @@ -140,72 +141,60 @@ sub _form { my($self, $v, $frm) = @_; my $r = $v ? $self->dbReleaseGet(vid => $v->{id}) : []; $self->htmlForm({ frm => $frm, action => $v ? "/v$v->{id}/edit" : '/v/new', editsum => 1, upload => 1 }, - vn_geninfo => [ 'General info', - [ input => short => 'title', name => 'Title (romaji)' ], - [ input => short => 'original', name => 'Original title' ], - [ static => content => 'The original title of this visual novel, leave blank if it already is in the Latin alphabet.' ], - [ textarea => short => 'alias', name => 'Aliases', rows => 4 ], - [ static => content => q| - Comma seperated list of alternative titles or abbreviations. Can include both official - (japanese/english) titles and unofficial titles used around net.
- Titles that are listed in the releases do not have to be added here. - |], - [ textarea => short => 'desc', name => 'Description', rows => 10 ], - [ static => content => q| - Short description of the main story. Please do not include spoilers, and don't forget to list - the source in case you didn't write the description yourself. (formatting codes are allowed) - |], - [ select => short => 'length', name => 'Length', width => 300, options => + vn_geninfo => [ mt('_vnedit_geninfo'), + [ input => short => 'title', name => mt '_vnedit_frm_title' ], + [ input => short => 'original', name => mt '_vnedit_original' ], + [ static => content => mt '_vnedit_original_msg' ], + [ textarea => short => 'alias', name => mt('_vnedit_alias'), rows => 4 ], + [ static => content => mt '_vnedit_alias_msg' ], + [ textarea => short => 'desc', name => mt('_vnedit_desc'), rows => 10 ], + [ static => content => mt '_vnedit_desc_msg' ], + [ select => short => 'length', name => mt('_vnedit_length'), width => 300, options => [ map [ $_ => $self->{vn_lengths}[$_][0].($_ ? " ($self->{vn_lengths}[$_][2])" : '') ], 0..$#{$self->{vn_lengths}} ] ], - [ input => short => 'l_wp', name => 'External links', pre => 'http://en.wikipedia.org/wiki/' ], + [ input => short => 'l_wp', name => mt('_vnedit_links'), pre => 'http://en.wikipedia.org/wiki/' ], [ input => short => 'l_encubed', pre => 'http://novelnews.net/tag/', post => '/' ], [ input => short => 'l_renai', pre => 'http://renai.us/game/', post => '.shtml' ], [ input => short => 'l_vnn', pre => 'http://visual-novels.net/vn/index.php?option=com_content&task=view&id=', width => 40 ], - [ input => short => 'anime', name => 'Anime' ], - [ static => content => q| - Whitespace seperated list of AniDB anime IDs. - E.g. "1015 3348" will add Shingetsutan Tsukihime - and Fate/stay night as related anime.
- Note: It can take a few minutes for the anime titles to appear on the VN page. - |], + [ input => short => 'anime', name => mt '_vnedit_anime' ], + [ static => content => mt '_vnedit_anime_msg' ], ], - vn_img => [ 'Image', + vn_img => [ mt('_vnedit_image'), [ static => nolabel => 1, content => sub { div class => 'img'; - p 'No image uploaded yet' if !$v || !$v->{image}; - p '[processing image, please return in a few minutes]' if $v && $v->{image} < 0; + p mt '_vnedit_image_none' if !$v || !$v->{image}; + p mt '_vnedit_image_processing' if $v && $v->{image} < 0; img src => sprintf("%s/cv/%02d/%d.jpg", $self->{url_static}, $v->{image}%100, $v->{image}), alt => $v->{title} if $v && $v->{image} > 0; end; div; - h2 'Upload new image'; + h2 mt '_vnedit_image_upload'; input type => 'file', class => 'text', name => 'img', id => 'img'; - p 'Preferably the cover of the CD/DVD/package. Image must be in JPEG or PNG format' - ." and at most 500kB. Images larger than 256x400 will automatically be resized.\n\n\n"; + p mt('_vnedit_image_upload_msg')."\n\n\n"; - h2 'NSFW'; + h2 mt '_vnedit_image_nsfw'; input type => 'checkbox', class => 'checkbox', id => 'img_nsfw', name => 'img_nsfw', $frm->{img_nsfw} ? (checked => 'checked') : (); - label class => 'checkbox', for => 'img_nsfw', "Not Safe For Work.\n"; - p 'Please check this option if the image contains nudity, gore, or is otherwise not safe in a work-friendly environment.'; + label class => 'checkbox', for => 'img_nsfw', mt '_vnedit_image_nsfw_check'; + p "\n".mt '_vnedit_image_nsfw_msg'; end; }], ], - vn_rel => [ 'Relations', + vn_rel => [ mt('_vnedit_rel'), [ hidden => short => 'relations' ], [ static => nolabel => 1, content => sub { - h2 'Selected relations'; + h2 mt '_vnedit_rel_sel'; table; tbody id => 'relation_tbl'; # to be filled using javascript end; end; - h2 'Add relation'; + h2 mt '_vnedit_rel_add'; + # TODO: localize JS relartion selector table; Tr id => 'relation_new'; td class => 'tc1'; @@ -227,21 +216,14 @@ sub _form { }], ], - !@$r ? () : ( vn_scr => [ 'Screenshots', + !@$r ? () : ( vn_scr => [ mt('_vnedit_scr'), [ hidden => short => 'screenshots' ], [ static => nolabel => 1, content => sub { div class => 'warning'; - b 'Please keep the following in mind when uploading screenshots:'; - ul; - li 'Screenshots have to be in the native resolution of the game,'; - li 'Remove any window borders and make sure the image is unmarked,'; - li 'Don\'t only upload event CGs.'; - end; - lit 'Please read the guidelines for more information.'; - br; - b 'Make sure to submit the form after the upload has finished!'; + lit mt '_vnedit_scr_msg'; end; br; + # TODO: localize screenshot uploader table; tbody id => 'scr_table', ''; end; -- cgit v1.2.3