summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-08-16 14:23:27 +0200
committerYorhel <git@yorhel.nl>2009-08-17 16:27:15 +0200
commit14def396a3f2f148ad48d04740d0f022d80e8cf8 (patch)
treefa3cc984f8fe5f1a1cc922a43c25bc32dd50c8c1 /lib
parenta645b404e49ce4b1d90dc05c7da44eb0e8ffc117 (diff)
L10N: Converted producer and release types
And replaced the ugly release type cssicon class hack. The class is now 'tr'.$type_numer, instead of the first three characters of their English representation in lowercase. No idea why I haven't done it this way in the first place...
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Handler/Producers.pm8
-rw-r--r--lib/VNDB/Handler/Releases.pm17
-rw-r--r--lib/VNDB/Handler/ULists.pm2
-rw-r--r--lib/VNDB/Handler/VNPage.pm2
4 files changed, 14 insertions, 15 deletions
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index f9119b72..57e79490 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -33,7 +33,7 @@ sub page {
if($rev) {
my $prev = $rev && $rev > 1 && $self->dbProducerGet(id => $pid, rev => $rev-1, what => 'changes extended')->[0];
$self->htmlRevision('p', $prev, $p,
- [ type => 'Type', serialize => sub { $self->{producer_types}{$_[0]} } ],
+ [ type => 'Type', serialize => sub { mt "_ptype_$_[0]" } ],
[ name => 'Name (romaji)', diff => 1 ],
[ original => 'Original name', diff => 1 ],
[ alias => 'Aliases', diff => 1 ],
@@ -48,7 +48,7 @@ sub page {
h1 $p->{name};
h2 class => 'alttitle', $p->{original} if $p->{original};
p class => 'center';
- txt mt("_lang_$p->{lang}")." \L$self->{producer_types}{$p->{type}}";
+ txt mt("_lang_$p->{lang}")." ".lc(mt "_ptype_$p->{type}");
txt "\na.k.a. $p->{alias}" if $p->{alias};
if($p->{website}) {
txt "\n";
@@ -101,7 +101,7 @@ sub edit {
if($self->reqMethod eq 'POST') {
$frm = $self->formValidate(
- { name => 'type', enum => [ keys %{$self->{producer_types}} ] },
+ { name => 'type', enum => $self->{producer_types} },
{ name => 'name', maxlength => 200 },
{ name => 'original', required => 0, maxlength => 200, default => '' },
{ name => 'alias', required => 0, maxlength => 500, default => '' },
@@ -134,7 +134,7 @@ sub edit {
$self->htmlEditMessage('p', $p);
$self->htmlForm({ frm => $frm, action => $pid ? "/p$pid/edit" : '/p/new', editsum => 1 }, "General info" => [
[ select => name => 'Type', short => 'type',
- options => [ map [ $_, $self->{producer_types}{$_} ], sort keys %{$self->{producer_types}} ] ],
+ 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.| ],
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm
index 0012faf4..71447626 100644
--- a/lib/VNDB/Handler/Releases.pm
+++ b/lib/VNDB/Handler/Releases.pm
@@ -39,7 +39,7 @@ sub page {
[ vn => 'Relations', join => '<br />', split => sub {
map sprintf('<a href="/v%d" title="%s">%s</a>', $_->{vid}, $_->{original}||$_->{title}, shorten $_->{title}, 50), @{$_[0]};
} ],
- [ type => 'Type', serialize => sub { $self->{release_types}[$_[0]] } ],
+ [ type => 'Type', serialize => sub { mt "_rtype_$_[0]" } ],
[ patch => 'Patch', serialize => sub { $_[0] ? 'Patch' : 'Not a patch' } ],
[ freeware => 'Freeware', serialize => sub { $_[0] ? 'yes' : 'nope' } ],
[ doujin => 'Doujin', serialize => sub { $_[0] ? 'yups' : 'nope' } ],
@@ -117,9 +117,8 @@ sub _infotable {
Tr ++$i % 2 ? (class => 'odd') : ();
td 'Type';
td;
- my $type = $self->{release_types}[$r->{type}];
- cssicon lc(substr $type, 0, 3), $type;
- txt ' '.$type;
+ cssicon "rt$r->{type}", mt "_rtype_$r->{type}";
+ txt ' '.mt "_rtype_$r->{type}";
txt ' patch' if $r->{patch};
end;
end;
@@ -296,7 +295,7 @@ sub edit {
if($self->reqMethod eq 'POST') {
$frm = $self->formValidate(
- { name => 'type', enum => [ 0..$#{$self->{release_types}} ] },
+ { name => 'type', enum => $self->{release_types} },
{ name => 'patch', required => 0, default => 0 },
{ name => 'freeware', required => 0, default => 0 },
{ name => 'doujin', required => 0, default => 0 },
@@ -382,7 +381,7 @@ sub _form {
$self->htmlForm({ frm => $frm, action => $r ? "/r$r->{id}/".($copy ? 'copy' : 'edit') : "/v$v->{id}/add", editsum => 1 },
"General info" => [
[ select => short => 'type', name => 'Type',
- options => [ map [ $_, $self->{release_types}[$_] ], 0..$#{$self->{release_types}} ] ],
+ options => [ map [ $_, mt "_rtype_$_" ], @{$self->{release_types}} ] ],
[ check => short => 'patch', name => 'This release is a patch to another release.' ],
[ check => short => 'freeware', name => 'Freeware (i.e. available at no cost)' ],
[ check => short => 'doujin', name => 'Doujin (self-published / not by a commercial company)' ],
@@ -482,7 +481,7 @@ sub browse {
{ name => 'ln', required => 0, multi => 1, default => '', enum => $self->{languages} },
{ name => 'pl', required => 0, multi => 1, default => '', enum => $self->{platforms} },
{ name => 'me', required => 0, multi => 1, default => '', enum => [ keys %{$self->{media}} ] },
- { name => 'tp', required => 0, default => -1, enum => [ -1..$#{$self->{release_types}} ] },
+ { name => 'tp', required => 0, default => -1, enum => [ -1, @{$self->{release_types}} ] },
{ name => 'pa', required => 0, default => 0, enum => [ 0..2 ] },
{ name => 'fw', required => 0, default => 0, enum => [ 0..2 ] },
{ name => 'do', required => 0, default => 0, enum => [ 0..2 ] },
@@ -546,7 +545,7 @@ sub browse {
td class => 'tc3';
$_ ne 'oth' && cssicon $_, mt "_plat_$_" for (@{$l->{platforms}});
cssicon "lang $_", mt "_lang_$_" for (@{$l->{languages}});
- cssicon lc(substr($self->{release_types}[$l->{type}],0,3)), $self->{release_types}[$l->{type}];
+ cssicon "rt$l->{type}", mt "_rtype_$l->{type}";
end;
td class => 'tc4';
a href => "/r$l->{id}", title => $l->{original}||$l->{title}, shorten $l->{title}, 90;
@@ -615,7 +614,7 @@ sub _filters {
end;
end;
$self->htmlFormPart($f, [ select => short => 'tp', name => 'Release type',
- options => [ [-1, 'All'], map [ $_, $self->{release_types}[$_] ], 0..$#{$self->{release_types}} ]]);
+ options => [ [-1, 'All'], map [ $_, mt "_rtype_$_" ], @{$self->{release_types}} ]]);
$self->htmlFormPart($f, [ select => short => 'pa', name => 'Patch status',
options => [ [0, 'All'], [1, 'Only patches'], [2, 'Only standalone releases']]]);
$self->htmlFormPart($f, [ select => short => 'fw', name => 'Freeware',
diff --git a/lib/VNDB/Handler/ULists.pm b/lib/VNDB/Handler/ULists.pm
index 65e7fc84..3cffb9e6 100644
--- a/lib/VNDB/Handler/ULists.pm
+++ b/lib/VNDB/Handler/ULists.pm
@@ -316,7 +316,7 @@ sub _vnlist_browse {
end;
td class => 'tc2';
cssicon "lang $_", mt "_lang_$_" for @{$_->{languages}};
- cssicon substr(lc $self->{release_types}[$_->{type}], 0, 3), $self->{release_types}[$_->{type}].' release';
+ cssicon "rt$_->{type}", mt("_rtype_$_->{type}").' release';
end;
td class => 'tc3';
a href => "/r$_->{rid}", title => $_->{original}||$_->{title}, shorten $_->{title}, 50;
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index a2d64297..b618f792 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -385,7 +385,7 @@ sub _releases {
next if $_ eq 'oth';
cssicon $_, mt "_plat_$_";
}
- cssicon lc(substr($self->{release_types}[$rel->{type}],0,3)), $self->{release_types}[$rel->{type}];
+ cssicon "rt$rel->{type}", mt "_rtype_$rel->{type}";
end;
td class => 'tc4';
a href => "/r$rel->{id}", title => $rel->{original}||$rel->{title}, $rel->{title};