summaryrefslogtreecommitdiff
path: root/tools/updatelang
diff options
context:
space:
mode:
Diffstat (limited to 'tools/updatelang')
-rwxr-xr-xtools/updatelang21
1 files changed, 14 insertions, 7 deletions
diff --git a/tools/updatelang b/tools/updatelang
index a05011e645..ff4ce340e0 100755
--- a/tools/updatelang
+++ b/tools/updatelang
@@ -158,7 +158,7 @@ sub reduceformat($) {
158################## 158##################
159 159
160if($#ARGV != 2) { 160if($#ARGV != 2) {
161 print "Usage: updatelang <english.lang> <otherlang> <outfile|->\n"; 161 print "Usage: [ENGLISHORDER=1] updatelang <english.lang> <otherlang> <outfile|->\n";
162 exit; 162 exit;
163} 163}
164 164
@@ -402,9 +402,9 @@ foreach my $id (@langorder) {
402 402
403 my $sane = $lang{$id}{'dest'}{$tgt}; 403 my $sane = $lang{$id}{'dest'}{$tgt};
404 $sane =~ s/^~?(.*)/$1/; # Strip off leading ~ if it's there as it's not a legal character otherwise 404 $sane =~ s/^~?(.*)/$1/; # Strip off leading ~ if it's there as it's not a legal character otherwise
405 if ($sane =~ tr/"~//) { 405 if ($sane =~ tr/"~<>//) {
406 # If it has suspicious characters that are not allowed 406 # If it has suspicious characters that are not allowed
407 $lang{$id}{'notes'} .= "### The <dest> section for '$id:$tgt' has some suspicious characters (eg '~'), please double-check!\n"; 407 $lang{$id}{'notes'} .= "### The <dest> section for '$id:$tgt' has some suspicious characters (eg \",~,<,>), please double-check!\n";
408# print "#!! '$id:$tgt' suspicious characters\n"; 408# print "#!! '$id:$tgt' suspicious characters\n";
409 } 409 }
410 } 410 }
@@ -476,9 +476,9 @@ foreach my $id (@langorder) {
476 } 476 }
477 my $sane = $lang{$id}{'voice'}{$tgt}; 477 my $sane = $lang{$id}{'voice'}{$tgt};
478 $sane =~ s/^~?(.*)/$1/; # Strip off leading ~ if it's there as it's not a legal character otherwise 478 $sane =~ s/^~?(.*)/$1/; # Strip off leading ~ if it's there as it's not a legal character otherwise
479 if ($sane =~ tr/%"~//) { 479 if ($sane =~ tr/%"~:\[\]<>{}\|//) {
480 # If it has suspicious characters that are not normally voiced.. 480 # Suspicious characters that are not typically voiced..
481 $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' has some suspicious characters (eg '%' or '~'), please double-check!\n"; 481 $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' has some suspicious characters (eg %,\",~,:,<,>,[,],{,},|), please correct!\n";
482# print "#!! '$id:$tgt' suspicious characters\n"; 482# print "#!! '$id:$tgt' suspicious characters\n";
483 } 483 }
484 if ($lang{$id}{'voice'}{$tgt} =~ /\.\.\./) { 484 if ($lang{$id}{'voice'}{$tgt} =~ /\.\.\./) {
@@ -502,7 +502,14 @@ foreach (@langheader) {
502 print $fh $_; 502 print $fh $_;
503} 503}
504 504
505my @finalorder = @langorder; # TODO make configurable vs @englishorder 505my @finalorder;
506
507if ($ENV{'ENGLISHORDER'}) {
508 @finalorder = @englishorder;
509} else {
510 @finalorder = @langorder;
511}
512
506foreach my $id (@finalorder) { 513foreach my $id (@finalorder) {
507 if (!defined($english{$id})) { 514 if (!defined($english{$id})) {
508 next; 515 next;