summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-28 00:12:23 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-28 00:12:23 -0400
commit5da59ce2fdbe0638cd9b49c4612e81d0e080b402 (patch)
tree6c8107f89e596792cefa3c8f63a211fd6db82402 /tools
parent7f27d2dd52a9582be93b69c9f844250c1650335c (diff)
downloadrockbox-5da59ce2fdbe0638cd9b49c4612e81d0e080b402.tar.gz
rockbox-5da59ce2fdbe0638cd9b49c4612e81d0e080b402.zip
updatelang: more tweaks for master language and sub-languages
Change-Id: I5af62b2f03bb4ee34518592e14c6ded3ccfea4e3
Diffstat (limited to 'tools')
-rwxr-xr-xtools/updatelang41
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'};
213delete $lang{'ORDER'}; 213delete $lang{'ORDER'};
214delete $lang{'HEADER'}; 214delete $lang{'HEADER'};
215 215
216# ork out the missing phrases 216# Extract language names
217my @tmp = split(/\./, basename($ARGV[0]));
218my $f1 = $tmp[0];
219@tmp = split(/\./, basename($ARGV[1]));
220my $f2 = $tmp[0];
221undef @tmp;
222
223# Do we care about notes?
224my $printnotes = 1;
225my $ignoredups = 0;
226
227if ($f1 eq $f2) {
228 # Ignore all notes for master language
229 $printnotes = 0;
230}
231
232if (index($f2, $f1) > -1) {
233 # Ignore duplicates for sub-languages
234 $ignoredups = 1;
235}
236
237# work out the missing phrases
217my %missing; 238my %missing;
218my @missingorder; 239my @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
413my $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
427my $fh; 434my $fh;
428if ($ARGV[2] ne '-') { 435if ($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]");