summaryrefslogtreecommitdiff
path: root/lib/VNDB
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VNDB')
-rw-r--r--lib/VNDB/Handler/Producers.pm10
-rw-r--r--lib/VNDB/Handler/Releases.pm18
-rw-r--r--lib/VNDB/Handler/Tags.pm2
-rw-r--r--lib/VNDB/Handler/ULists.pm2
-rw-r--r--lib/VNDB/Handler/Users.pm2
-rw-r--r--lib/VNDB/Handler/VNBrowse.pm12
-rw-r--r--lib/VNDB/Handler/VNPage.pm8
-rw-r--r--lib/VNDB/Util/Auth.pm2
-rw-r--r--lib/VNDB/Util/LayoutHTML.pm4
9 files changed, 30 insertions, 30 deletions
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index aa010e6e..f9119b72 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -37,7 +37,7 @@ sub page {
[ name => 'Name (romaji)', diff => 1 ],
[ original => 'Original name', diff => 1 ],
[ alias => 'Aliases', diff => 1 ],
- [ lang => 'Language', serialize => sub { "$_[0] ($self->{languages}{$_[0]})" } ],
+ [ lang => 'Language', serialize => sub { "$_[0] (".mt("_lang_$_[0]").')' } ],
[ website => 'Website', diff => 1 ],
[ desc => 'Description', diff => 1 ],
);
@@ -48,7 +48,7 @@ sub page {
h1 $p->{name};
h2 class => 'alttitle', $p->{original} if $p->{original};
p class => 'center';
- txt "$self->{languages}{$p->{lang}} \L$self->{producer_types}{$p->{type}}";
+ txt mt("_lang_$p->{lang}")." \L$self->{producer_types}{$p->{type}}";
txt "\na.k.a. $p->{alias}" if $p->{alias};
if($p->{website}) {
txt "\n";
@@ -105,7 +105,7 @@ sub edit {
{ name => 'name', maxlength => 200 },
{ name => 'original', required => 0, maxlength => 200, default => '' },
{ name => 'alias', required => 0, maxlength => 500, default => '' },
- { name => 'lang', enum => [ keys %{$self->{languages}} ] },
+ { name => 'lang', enum => $self->{languages} },
{ name => 'website', required => 0, template => 'url', default => '' },
{ name => 'desc', required => 0, maxlength => 5000, default => '' },
{ name => 'editsum', maxlength => 5000 },
@@ -141,7 +141,7 @@ sub edit {
[ input => name => 'Aliases', short => 'alias', width => 400 ],
[ static => content => q|(Un)official aliases, separated by a comma.| ],
[ select => name => 'Primary language', short => 'lang',
- options => [ map [ $_, "$_ ($self->{languages}{$_})" ], sort keys %{$self->{languages}} ] ],
+ options => [ map [ $_, "$_ (".mt("_lang_$_").')' ], sort @{$self->{languages}} ] ],
[ input => name => 'Website', short => 'website' ],
[ text => name => 'Description', short => 'desc', rows => 6 ],
]);
@@ -192,7 +192,7 @@ sub list {
ul;
for ($perlist*$c..($perlist*($c+1))-1) {
li;
- cssicon 'lang '.$list->[$_]{lang}, $self->{languages}{$list->[$_]{lang}};
+ cssicon 'lang '.$list->[$_]{lang}, mt "_lang_$list->[$_]{lang}";
a href => "/p$list->[$_]{id}", title => $list->[$_]{original}, $list->[$_]{name};
end;
}
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm
index db234aea..a64d6f27 100644
--- a/lib/VNDB/Handler/Releases.pm
+++ b/lib/VNDB/Handler/Releases.pm
@@ -47,7 +47,7 @@ sub page {
[ original => 'Original title', diff => 1 ],
[ gtin => 'JAN/UPC/EAN', serialize => sub { $_[0]||'[none]' } ],
[ catalog => 'Catalog number', serialize => sub { $_[0]||'[none]' } ],
- [ languages => 'Language', join => ', ', split => sub { map $self->{languages}{$_}, @{$_[0]} } ],
+ [ languages => 'Language', join => ', ', split => sub { map mt("_lang_$_"), @{$_[0]} } ],
[ website => 'Website', ],
[ released => 'Release date', htmlize => sub { datestr $_[0] } ],
[ minage => 'Age rating', serialize => sub { $self->{age_ratings}{$_[0]}[0] } ],
@@ -128,8 +128,8 @@ sub _infotable {
td 'Language';
td;
for (@{$r->{languages}}) {
- cssicon "lang $_", $self->{languages}{$_};
- txt ' '.$self->{languages}{$_};
+ cssicon "lang $_", mt "_lang_$_";
+ txt ' '.mt("_lang_$_");
br if $_ ne $r->{languages}[$#{$r->{languages}}];
}
end;
@@ -305,7 +305,7 @@ sub edit {
{ name => 'gtin', required => 0, default => '0',
func => [ \&gtintype, 'Not a valid JAN/UPC/EAN code' ] },
{ name => 'catalog', required => 0, default => '', maxlength => 50 },
- { name => 'languages', multi => 1, enum => [ keys %{$self->{languages}} ] },
+ { name => 'languages', multi => 1, enum => $self->{languages} },
{ name => 'website', required => 0, default => '', template => 'url' },
{ name => 'released', required => 0, default => 0, template => 'int' },
{ name => 'minage' , required => 0, default => -1, enum => [ keys %{$self->{age_ratings}} ] },
@@ -390,7 +390,7 @@ sub _form {
[ input => short => 'original', name => 'Original title', width => 300 ],
[ static => content => 'The original title of this release, leave blank if it already is in the Latin alphabet.' ],
[ select => short => 'languages', name => 'Language(s)', multi => 1,
- options => [ map [ $_, "$_ ($self->{languages}{$_})" ], sort keys %{$self->{languages}} ] ],
+ options => [ map [ $_, "$_ (".mt("_lang_$_").')' ], sort @{$self->{languages}} ] ],
[ input => short => 'gtin', name => 'JAN/UPC/EAN' ],
[ input => short => 'catalog', name => 'Catalog number' ],
[ input => short => 'website', name => 'Official website' ],
@@ -479,7 +479,7 @@ sub browse {
{ name => 's', required => 0, default => 'title', enum => [qw|released minage title|] },
{ name => 'o', required => 0, default => 'a', enum => ['a', 'd'] },
{ name => 'q', required => 0, default => '', maxlength => 500 },
- { name => 'ln', required => 0, multi => 1, default => '', enum => [ keys %{$self->{languages}} ] },
+ { name => 'ln', required => 0, multi => 1, default => '', enum => $self->{languages} },
{ name => 'pl', required => 0, multi => 1, default => '', enum => [ keys %{$self->{platforms}} ] },
{ name => 'me', required => 0, multi => 1, default => '', enum => [ keys %{$self->{media}} ] },
{ name => 'tp', required => 0, default => -1, enum => [ -1..$#{$self->{release_types}} ] },
@@ -545,7 +545,7 @@ sub browse {
td class => 'tc2', $l->{minage} > -1 ? $self->{age_ratings}{$l->{minage}}[0] : '';
td class => 'tc3';
$_ ne 'oth' && cssicon $_, $self->{platforms}{$_} for (@{$l->{platforms}});
- cssicon "lang $_", $self->{languages}{$_} for (@{$l->{languages}});
+ cssicon "lang $_", mt "_lang_$_" for (@{$l->{languages}});
cssicon lc(substr($self->{release_types}[$l->{type}],0,3)), $self->{release_types}[$l->{type}];
end;
td class => 'tc4';
@@ -633,8 +633,8 @@ sub _filters {
span;
input type => 'checkbox', name => 'ln', value => $i, id => "lang_$i", grep($_ eq $i, @{$f->{ln}}) ? (checked => 'checked') : ();
label for => "lang_$i";
- cssicon "lang $i", $self->{languages}{$i};
- txt $self->{languages}{$i};
+ cssicon "lang $i", mt "_lang_$i";
+ txt mt "_lang_$i";
end;
end;
}
diff --git a/lib/VNDB/Handler/Tags.pm b/lib/VNDB/Handler/Tags.pm
index 68244f89..ce3ac0ed 100644
--- a/lib/VNDB/Handler/Tags.pm
+++ b/lib/VNDB/Handler/Tags.pm
@@ -213,7 +213,7 @@ sub _vnlist {
for (sort split /\//, $l->{c_platforms});
end;
td class => 'tc4';
- cssicon "lang $_", $self->{languages}{$_}
+ cssicon "lang $_", mt "_lang_$_"
for (reverse sort split /\//, $l->{c_languages});
end;
td class => 'tc5';
diff --git a/lib/VNDB/Handler/ULists.pm b/lib/VNDB/Handler/ULists.pm
index 2d8e0e0d..65e7fc84 100644
--- a/lib/VNDB/Handler/ULists.pm
+++ b/lib/VNDB/Handler/ULists.pm
@@ -315,7 +315,7 @@ sub _vnlist_browse {
lit datestr $_->{released};
end;
td class => 'tc2';
- cssicon "lang $_", $self->{languages}{$_} for @{$_->{languages}};
+ cssicon "lang $_", mt "_lang_$_" for @{$_->{languages}};
cssicon substr(lc $self->{release_types}[$_->{type}], 0, 3), $self->{release_types}[$_->{type}].' release';
end;
td class => 'tc3';
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index 4dee6105..ca5719e1 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -368,7 +368,7 @@ sub edit {
$self->authCan('usermod') ? (
[ input => short => 'usrname', name => 'Username' ],
[ select => short => 'rank', name => 'Rank', options => [
- map [ $_, $self->{user_ranks}[$_][0] ], 1..$#{$self->{user_ranks}} ] ],
+ map [ $_, mt '_urank_'.$_ ], 1..$#{$self->{user_ranks}} ] ],
[ check => short => 'ign_votes', name => 'Ignore votes in VN statistics' ],
) : (
[ static => label => 'Username', content => $frm->{usrname} ],
diff --git a/lib/VNDB/Handler/VNBrowse.pm b/lib/VNDB/Handler/VNBrowse.pm
index 5a22bccc..d3d503dc 100644
--- a/lib/VNDB/Handler/VNBrowse.pm
+++ b/lib/VNDB/Handler/VNBrowse.pm
@@ -21,7 +21,7 @@ sub list {
{ name => 'p', required => 0, default => 1, template => 'int' },
{ name => 'q', required => 0, default => '' },
{ name => 'sq', required => 0, default => '' },
- { name => 'ln', required => 0, multi => 1, enum => [ keys %{$self->{languages}} ], default => '' },
+ { name => 'ln', required => 0, multi => 1, enum => $self->{languages}, default => '' },
{ name => 'pl', required => 0, multi => 1, enum => [ keys %{$self->{platforms}} ], default => '' },
{ name => 'ti', required => 0, default => '', maxlength => 200 },
{ name => 'te', required => 0, default => '', maxlength => 200 },
@@ -34,9 +34,9 @@ sub list {
return $self->resRedirect('/'.$1.$2.(!$3 ? '' : $1 eq 'd' ? '#'.$3 : '.'.$3), 'temp')
if $f->{q} =~ /^([gvrptud])([0-9]+)(?:\.([0-9]+))?$/;
- # for URL compatibilty with older versions
+ # for URL compatibilty with older versions (ugly hack to get English strings)
my @lang;
- $f->{q} =~ s/\s*$self->{languages}{$_}\s*//&&push @lang, $_ for (keys %{$self->{languages}});
+ $f->{q} =~ s/\s*$VNDB::L10N::en::Lexicon{"_lang_$_"}\s*//&&push @lang, $_ for (@{$self->{languages}});
$f->{ln} = $f->{ln}[0] ? [ @{$f->{ln}}, @lang ] : \@lang;
}
@@ -107,7 +107,7 @@ sub list {
for (sort split /\//, $l->{c_platforms});
end;
td class => 'tc3';
- cssicon "lang $_", $self->{languages}{$_}
+ cssicon "lang $_", mt "_lang_$_"
for (reverse sort split /\//, $l->{c_languages});
end;
td class => 'tc4';
@@ -165,8 +165,8 @@ sub _filters {
input type => 'checkbox', name => 'ln', value => $i, id => "lang_$i",
(scalar grep $_ eq $i, @{$f->{ln}}) ? (checked => 'checked') : ();
label for => "lang_$i";
- cssicon "lang $i", $self->{languages}{$i};
- txt $self->{languages}{$i};
+ cssicon "lang $i", mt "_lang_$i";
+ txt mt "_lang_$i";
end;
end;
}
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index 751fc5cc..a3b56fe2 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -237,7 +237,7 @@ sub _producers {
my %p = map { $_->{id} => $_ } map @{$_->{producers}}, grep grep($_ eq $l, @{$_->{languages}}), @$r;
my @p = values %p;
next if !@p;
- cssicon "lang $l", $self->{languages}{$l};
+ cssicon "lang $l", mt "_lang_$l";
for (@p) {
a href => "/p$_->{id}", title => $_->{original}||$_->{name}, shorten $_->{name}, 30;
txt ' & ' if $_ != $p[$#p];
@@ -372,8 +372,8 @@ sub _releases {
for my $l (@lang) {
Tr class => 'lang';
td colspan => 6;
- cssicon "lang $l", $self->{languages}{$l};
- txt $self->{languages}{$l};
+ cssicon "lang $l", mt "_lang_$l";
+ txt mt "_lang_$l";
end;
end;
for my $rel (grep grep($_ eq $l, @{$_->{languages}}), @$r) {
@@ -438,7 +438,7 @@ sub _screenshots {
next if !@scr;
Tr class => 'rel';
td colspan => 5;
- cssicon "lang $_", $self->{languages}{$_} for (@{$rel->{languages}});
+ cssicon "lang $_", mt "_lang_$_" for (@{$rel->{languages}});
txt $rel->{title};
end;
end;
diff --git a/lib/VNDB/Util/Auth.pm b/lib/VNDB/Util/Auth.pm
index ad225d92..c4daffd9 100644
--- a/lib/VNDB/Util/Auth.pm
+++ b/lib/VNDB/Util/Auth.pm
@@ -83,7 +83,7 @@ sub authInfo {
sub authCan {
my($self, $act) = @_;
my $r = $self->{_auth}{rank}||0;
- return scalar grep $_ eq $act, @{$self->{user_ranks}[$r]}[1..$#{$self->{user_ranks}[$r]}];
+ return scalar grep $_ eq $act, @{$self->{user_ranks}[$r]}[0..$#{$self->{user_ranks}[$r]}];
}
diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm
index e0333b93..8bc08a1f 100644
--- a/lib/VNDB/Util/LayoutHTML.pm
+++ b/lib/VNDB/Util/LayoutHTML.pm
@@ -58,7 +58,7 @@ sub _menu {
span;
for (grep $self->{l10n}->language_tag() ne $_, $self->{l10n}->languages()) {
a href => "?l10n=$_";
- cssicon "lang $_", $self->{languages}{$_};
+ cssicon "lang $_", mt "_lang_$_"; # NOTE: should actually be in the destination language...
end;
}
end;
@@ -92,7 +92,7 @@ sub _menu {
h2;
a href => $uid, ucfirst $self->authInfo->{username};
# note: user ranks aren't TL'ed (but might be in the future, hmm)
- txt ' ('.$self->{user_ranks}[$self->authInfo->{rank}][0].')';
+ txt ' ('.mt('_urank_'.$self->authInfo->{rank}).')';
end;
div;
a href => "$uid/edit", mt '_menu_myprofile'; br;