summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-10-07 14:38:47 +0200
committerYorhel <git@yorhel.nl>2009-10-07 14:38:47 +0200
commitde09cecb62a56a9dc017876d32c07e1a51f6378d (patch)
tree7548cf6394b2e1c18c7c7ca2727b250eb8aeec74 /util
parent246165b399856e207295773da2c03b135c1ca86a (diff)
L10N: Extracted strings for and improved release list selector on VN pages
Diffstat (limited to 'util')
-rwxr-xr-xutil/jsgen.pl11
-rwxr-xr-xutil/skingen.pl1
2 files changed, 8 insertions, 4 deletions
diff --git a/util/jsgen.pl b/util/jsgen.pl
index eee52c2a..3afb371a 100755
--- a/util/jsgen.pl
+++ b/util/jsgen.pl
@@ -1,13 +1,16 @@
#!/usr/bin/perl
+package VNDB;
+
use strict;
use warnings;
use Encode 'encode_utf8';
use Cwd 'abs_path';
eval { require JavaScript::Minifier::XS; };
-our($ROOT, %O);
+our($ROOT, %S);
BEGIN { ($ROOT = abs_path $0) =~ s{/util/jsgen\.pl$}{}; }
+require $ROOT.'/data/global.pl';
use lib "$ROOT/lib";
use lib "$ROOT/yawf/lib";
@@ -22,7 +25,7 @@ use VNDB::L10N;
my $jskeys = qr{^(?:
_js_.+|
_menu_emptysearch|
- _vnpage_uopt_10?vote|
+ _vnpage_uopt_(?:10?vote|rel.+)|
_rlst_[vr]stat_.+
)$}x;
@@ -70,7 +73,9 @@ sub l10n {
sub jsgen {
# JavaScript::Minifier::XS doesn't correctly handle perl's unicode,
# so just do everything in raw bytes instead.
- my $js = encode_utf8(l10n()) . "\n\n";
+ my $js = encode_utf8(l10n()) . "\n";
+ $js .= sprintf "rlst_rstat = [ %s ];\n", join ', ', map qq{"$_"}, @{$S{rlst_rstat}};
+ $js .= sprintf "rlst_vstat = [ %s ];\n", join ', ', map qq{"$_"}, @{$S{rlst_vstat}};
open my $JS, '<', "$ROOT/data/script.js" or die $!;
$js .= join '', <$JS>;
close $JS;
diff --git a/util/skingen.pl b/util/skingen.pl
index d18f5fde..73e4fdc7 100755
--- a/util/skingen.pl
+++ b/util/skingen.pl
@@ -11,7 +11,6 @@ eval { require CSS::Minifier::XS };
our($ROOT, %O);
BEGIN { ($ROOT = abs_path $0) =~ s{/util/skingen\.pl$}{}; }
-require $ROOT.'/data/global.pl';
if(@ARGV) {