summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-11-27 14:45:25 +0100
committerYorhel <git@yorhel.nl>2010-11-27 14:45:25 +0100
commitc31bc7978b302c898e9c9b34abc14fd3249beaa7 (patch)
tree00f297653c259da5d8914f33af1f03ec25864757 /util
parent107414db80313f551e55a185c06d16331164b21b (diff)
VN Filter Selector: Added length field filter
Has been requested quite often, now finally implemented.
Diffstat (limited to 'util')
-rwxr-xr-xutil/jsgen.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/jsgen.pl b/util/jsgen.pl
index 4b24cd86..03b79ab5 100755
--- a/util/jsgen.pl
+++ b/util/jsgen.pl
@@ -69,6 +69,7 @@ sub l10n {
my $val = $lang{$lang}{$key} || $lang{'en'}{$key};
$val =~ s/"/\\"/g;
$val =~ s/\n/\\n/g;
+ $val =~ s/\[index,.+$// if $key =~ /^_vnlength_/; # special casing the VN lengths, since the JS mt() doesn't handle [index]
$r .= sprintf qq| %s: "%s"|, $key !~ /^[a-z0-9_]+$/ ? "'$key'" : $key, $val;
}
$r .= "\n};";
@@ -111,6 +112,7 @@ sub jsgen {
$common .= sprintf "release_types = [ %s ];\n", join ', ', map qq{"$_"}, @{$S{release_types}};
$common .= sprintf "animated = [ %s ];\n", join ', ', @{$S{animated}};
$common .= sprintf "voiced = [ %s ];\n", join ', ', @{$S{voiced}};
+ $common .= sprintf "vn_lengths = [ %s ];\n", join ', ', @{$S{vn_lengths}};
$common .= sprintf "L10N_LANG = [ %s ];\n", join(', ', map qq{"$_"}, VNDB::L10N::languages());
open my $JS, '<:utf8', "$ROOT/data/script.js" or die $!;