summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Handler/Producers.pm38
-rw-r--r--lib/VNDB/Util/CommonHTML.pm7
2 files changed, 23 insertions, 22 deletions
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;