summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-01-16 11:52:22 +0100
committerYorhel <git@yorhel.nl>2016-01-16 15:11:36 +0100
commit6313653b01652affded23d682d136e5e6ee42799 (patch)
tree528263a90a2c336c3ab6226c211a1abeccffacb3 /util
parentca1a9c48c24a436babd30ad9e315db2781364879 (diff)
L10N: Intern languages/platforms/resolutions/media/ptype/rtype/vnlength
Diffstat (limited to 'util')
-rwxr-xr-xutil/jsgen.pl19
1 files changed, 8 insertions, 11 deletions
diff --git a/util/jsgen.pl b/util/jsgen.pl
index 36adea0d..ba18b983 100755
--- a/util/jsgen.pl
+++ b/util/jsgen.pl
@@ -101,19 +101,17 @@ sub l10n {
# screen resolution information, suitable for usage in filFSelect()
sub resolutions {
- my $ln = shift;
my $cat = '';
my @r;
my $push = \@r;
for my $i (0..$#{$S{resolutions}}) {
my $r = $S{resolutions}[$i];
if($cat ne $r->[1]) {
- push @r, [$r->[1] =~ /^_/ ? l10nstr($ln, $r->[1]) : $r->[1]];
+ push @r, [$r->[1]];
$cat = $r->[1];
$push = $r[$#r];
}
- my $n = $r->[0] =~ /^_/ ? l10nstr($ln, $r->[0]) : $r->[0];
- push @$push, [$i, $n];
+ push @$push, [$i, $r->[0]];
}
\@r
}
@@ -125,19 +123,18 @@ sub vars {
rlist_status => [ map l10nstr($lang, $_?"_rlist_status_$_":'_unknown'), @{$S{rlist_status}} ],
cookie_prefix => $O{cookie_prefix},
age_ratings => [ map [ $_, l10nstr($lang, $_ == -1 ? ('_unknown') : $_ == 0 ? ('_minage_all') : ('_minage_age', $_)) ], @{$S{age_ratings}} ],
- languages => [ map [ $_, l10nstr($lang, "_lang_$_") ], @{$S{languages}} ],
- platforms => [ map [ $_, l10nstr($lang, "_plat_$_") ], @{$S{platforms}} ],
+ languages => [ map [ $_, $S{languages}{$_} ], sort keys %{$S{languages}} ],
+ platforms => [ map [ $_, $S{platforms}{$_} ], sort keys %{$S{platforms}} ],
char_roles => [ map [ $_, l10nstr($lang, "_charrole_$_") ], @{$S{char_roles}} ],
- media => [ map [ $_, l10nstr($lang, "_med_$_"), $S{media}{$_} ], sort keys %{$S{media}} ],
- release_types => [ map [ $_, l10nstr($lang, "_rtype_$_") ], @{$S{release_types}} ],
+ media => [ map [ $_, $S{media}{$_}[1], $S{media}{$_}[0] ], sort keys %{$S{media}} ],
+ release_types => [ map [ $_, ucfirst $_ ], @{$S{release_types}} ],
animated => [ map [ 1*$_, l10nstr($lang, $_?"_animated_$_":'_unknown' ) ], @{$S{animated}} ],
voiced => [ map [ 1*$_, l10nstr($lang, $_?"_voiced_$_":'_unknown' ) ], @{$S{voiced}} ],
- vn_lengths => [ map [ 1*$_, l10nstr($lang, $_?"_vnlength_$_":'_unknown' ) ], @{$S{vn_lengths}} ],
+ vn_lengths => [ map [ $_, $S{vn_lengths}[$_][0] ], 0..$#{$S{vn_lengths}} ],
blood_types => [ map [ $_, l10nstr($lang, $_ eq 'unknown' ? '_unknown' : "_bloodt_$_") ], @{$S{blood_types}} ],
genders => [ map [ $_, l10nstr($lang, "_gender_$_") ], @{$S{genders}} ],
staff_roles => [ map [ $_, l10nstr($lang, "_credit_$_") ], @{$S{staff_roles}} ],
- resolutions => scalar resolutions($lang),
- l10n_lang => [ map [ $_, l10nstr($_, "_lang_$_") ], VNDB::L10N::languages() ],
+ resolutions => scalar resolutions(),
l10n_str => $l10n,
);
JSON::XS->new->encode(\%vars);