diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/updatelang | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/tools/updatelang b/tools/updatelang index 5c2139f34f..1e6ae59269 100755 --- a/tools/updatelang +++ b/tools/updatelang | |||
@@ -213,7 +213,28 @@ delete $english{'HEADER'}; | |||
213 | delete $lang{'ORDER'}; | 213 | delete $lang{'ORDER'}; |
214 | delete $lang{'HEADER'}; | 214 | delete $lang{'HEADER'}; |
215 | 215 | ||
216 | # ork out the missing phrases | 216 | # Extract language names |
217 | my @tmp = split(/\./, basename($ARGV[0])); | ||
218 | my $f1 = $tmp[0]; | ||
219 | @tmp = split(/\./, basename($ARGV[1])); | ||
220 | my $f2 = $tmp[0]; | ||
221 | undef @tmp; | ||
222 | |||
223 | # Do we care about notes? | ||
224 | my $printnotes = 1; | ||
225 | my $ignoredups = 0; | ||
226 | |||
227 | if ($f1 eq $f2) { | ||
228 | # Ignore all notes for master language | ||
229 | $printnotes = 0; | ||
230 | } | ||
231 | |||
232 | if (index($f2, $f1) > -1) { | ||
233 | # Ignore duplicates for sub-languages | ||
234 | $ignoredups = 1; | ||
235 | } | ||
236 | |||
237 | # work out the missing phrases | ||
217 | my %missing; | 238 | my %missing; |
218 | my @missingorder; | 239 | my @missingorder; |
219 | 240 | ||
@@ -353,7 +374,7 @@ foreach my $id (@langorder) { | |||
353 | # print "#!! '$id:$tgt' dest not blank ('$lp{$tgt}' vs '$ep{$tgt}')\n"; | 374 | # print "#!! '$id:$tgt' dest not blank ('$lp{$tgt}' vs '$ep{$tgt}')\n"; |
354 | $lang{$id}{'dest'}{$tgt} = $english{$id}{'dest'}{$tgt}; | 375 | $lang{$id}{'dest'}{$tgt} = $english{$id}{'dest'}{$tgt}; |
355 | } | 376 | } |
356 | } elsif ($lp{$tgt} ne 'none' && $lp{$tgt} ne '' && not_ignorelist($id) && !$lang{$id}{'new'}) { | 377 | } elsif ($lp{$tgt} ne 'none' && $lp{$tgt} ne '' && not_ignorelist($id) && !$lang{$id}{'new'} && !$ignoredups) { |
357 | $lang{$id}{'notes'} .= "### The <dest> section for '$id:$tgt' is identical to english!\n"; | 378 | $lang{$id}{'notes'} .= "### The <dest> section for '$id:$tgt' is identical to english!\n"; |
358 | # print "#!! '$id:$tgt' dest identical ('$lp{$tgt}')\n"; | 379 | # print "#!! '$id:$tgt' dest identical ('$lp{$tgt}')\n"; |
359 | } | 380 | } |
@@ -402,7 +423,7 @@ foreach my $id (@langorder) { | |||
402 | # print "#!! '$id:$tgt' voice not blank ('$lp{$tgt}' vs '$ep{$tgt}')\n"; | 423 | # print "#!! '$id:$tgt' voice not blank ('$lp{$tgt}' vs '$ep{$tgt}')\n"; |
403 | $lang{$id}{'voice'}{$tgt} = $english{$id}{'voice'}{$tgt}; | 424 | $lang{$id}{'voice'}{$tgt} = $english{$id}{'voice'}{$tgt}; |
404 | } | 425 | } |
405 | } elsif ($lp{$tgt} ne 'none' && $lp{$tgt} ne '' && not_ignorelist($id) && !$lang{$id}{'new'}) { | 426 | } elsif ($lp{$tgt} ne 'none' && $lp{$tgt} ne '' && not_ignorelist($id) && !$lang{$id}{'new'} && !$ignoredups) { |
406 | $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is identical to english!\n"; | 427 | $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is identical to english!\n"; |
407 | # print "#!! '$id:$tgt' voice identical ('$lp{$tgt}')\n"; | 428 | # print "#!! '$id:$tgt' voice identical ('$lp{$tgt}')\n"; |
408 | } | 429 | } |
@@ -410,20 +431,6 @@ foreach my $id (@langorder) { | |||
410 | } | 431 | } |
411 | 432 | ||
412 | ########## Write new language file | 433 | ########## Write new language file |
413 | my $printnotes = 1; | ||
414 | |||
415 | #my @tmp = split(/\./, basename($ARGV[0])); | ||
416 | #my $f1 = $tmp[0]; | ||
417 | #@tmp = split(/\./, basename($ARGV[1])); | ||
418 | #my $f2 = $tmp[0]; | ||
419 | # | ||
420 | #if (index($f2, $f1) > -1) { | ||
421 | # $printnotes = 0; | ||
422 | #} | ||
423 | #undef $f1; | ||
424 | #undef $f2; | ||
425 | #undef @tmp; | ||
426 | |||
427 | my $fh; | 434 | my $fh; |
428 | if ($ARGV[2] ne '-') { | 435 | if ($ARGV[2] ne '-') { |
429 | open(FH, ">$ARGV[2]") || die ("Can't open $ARGV[2]"); | 436 | open(FH, ">$ARGV[2]") || die ("Can't open $ARGV[2]"); |