summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-10-07 13:35:34 +0200
committerYorhel <git@yorhel.nl>2009-10-07 13:38:17 +0200
commitde8d188a37b651a59a6460c0ead0e7aa4edab858 (patch)
treeca4ad19d682e98c797108ec820aff8e111973a2f /util
parent2c7b95fb3dc6bb25ac4b4171fb881f9f587bd62f (diff)
L10N: Extracted some common Javascript strings
Diffstat (limited to 'util')
-rwxr-xr-xutil/jsgen.pl8
-rwxr-xr-xutil/vndb.pl3
2 files changed, 8 insertions, 3 deletions
diff --git a/util/jsgen.pl b/util/jsgen.pl
index 894fa1b9..3ae63157 100755
--- a/util/jsgen.pl
+++ b/util/jsgen.pl
@@ -19,8 +19,11 @@ use LangFile;
use VNDB::L10N;
-my $jskeys = qr{^_menu_emptysearch$};
-
+my $jskeys = qr{^(?:
+ _js_.+|
+ _menu_emptysearch|
+ _vnpage_uopt_10?vote
+ )$}x;
sub l10n {
# Using JSON::XS or something may be shorter and less error prone,
@@ -47,6 +50,7 @@ sub l10n {
$lang{$l->[0]} = 1 if $type eq 'tl';
if($type eq 'tl' && $cur) {
my($lang, $sync, $val) = @$l;
+ next if !$val;
$val =~ s/"/\\"/g;
$val =~ s/\n/\\n/g;
$r[$#r] .= ',' if $cur == 2;
diff --git a/util/vndb.pl b/util/vndb.pl
index 609d47a8..f3c3036c 100755
--- a/util/vndb.pl
+++ b/util/vndb.pl
@@ -120,8 +120,9 @@ sub readskins {
sub checkjs {
my $script = "$ROOT/static/f/script.js";
+ my $lastmod = [stat $script]->[9];
system "$ROOT/util/jsgen.pl" if
(!-e $script && -x "$ROOT/static/f")
- || (-e $script && -w $script && [stat $script]->[9] < [stat "$ROOT/data/script.js"]->[9]);
+ || (-e $script && -w $script && $lastmod < [stat "$ROOT/data/script.js"]->[9] || $lastmod < [stat "$ROOT/data/lang.txt"]->[9]);
}