1
0
Fork 0
forked from len0rd/rockbox

updatelang: more tweaks for master language and sub-languages

Change-Id: I5af62b2f03bb4ee34518592e14c6ded3ccfea4e3
This commit is contained in:
Solomon Peachy 2020-07-28 00:12:23 -04:00
parent 7f27d2dd52
commit 5da59ce2fd

View file

@ -213,7 +213,28 @@ delete $english{'HEADER'};
delete $lang{'ORDER'}; delete $lang{'ORDER'};
delete $lang{'HEADER'}; delete $lang{'HEADER'};
# ork out the missing phrases # Extract language names
my @tmp = split(/\./, basename($ARGV[0]));
my $f1 = $tmp[0];
@tmp = split(/\./, basename($ARGV[1]));
my $f2 = $tmp[0];
undef @tmp;
# Do we care about notes?
my $printnotes = 1;
my $ignoredups = 0;
if ($f1 eq $f2) {
# Ignore all notes for master language
$printnotes = 0;
}
if (index($f2, $f1) > -1) {
# Ignore duplicates for sub-languages
$ignoredups = 1;
}
# work out the missing phrases
my %missing; my %missing;
my @missingorder; my @missingorder;
@ -353,7 +374,7 @@ foreach my $id (@langorder) {
# print "#!! '$id:$tgt' dest not blank ('$lp{$tgt}' vs '$ep{$tgt}')\n"; # print "#!! '$id:$tgt' dest not blank ('$lp{$tgt}' vs '$ep{$tgt}')\n";
$lang{$id}{'dest'}{$tgt} = $english{$id}{'dest'}{$tgt}; $lang{$id}{'dest'}{$tgt} = $english{$id}{'dest'}{$tgt};
} }
} elsif ($lp{$tgt} ne 'none' && $lp{$tgt} ne '' && not_ignorelist($id) && !$lang{$id}{'new'}) { } elsif ($lp{$tgt} ne 'none' && $lp{$tgt} ne '' && not_ignorelist($id) && !$lang{$id}{'new'} && !$ignoredups) {
$lang{$id}{'notes'} .= "### The <dest> section for '$id:$tgt' is identical to english!\n"; $lang{$id}{'notes'} .= "### The <dest> section for '$id:$tgt' is identical to english!\n";
# print "#!! '$id:$tgt' dest identical ('$lp{$tgt}')\n"; # print "#!! '$id:$tgt' dest identical ('$lp{$tgt}')\n";
} }
@ -402,7 +423,7 @@ foreach my $id (@langorder) {
# print "#!! '$id:$tgt' voice not blank ('$lp{$tgt}' vs '$ep{$tgt}')\n"; # print "#!! '$id:$tgt' voice not blank ('$lp{$tgt}' vs '$ep{$tgt}')\n";
$lang{$id}{'voice'}{$tgt} = $english{$id}{'voice'}{$tgt}; $lang{$id}{'voice'}{$tgt} = $english{$id}{'voice'}{$tgt};
} }
} elsif ($lp{$tgt} ne 'none' && $lp{$tgt} ne '' && not_ignorelist($id) && !$lang{$id}{'new'}) { } elsif ($lp{$tgt} ne 'none' && $lp{$tgt} ne '' && not_ignorelist($id) && !$lang{$id}{'new'} && !$ignoredups) {
$lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is identical to english!\n"; $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is identical to english!\n";
# print "#!! '$id:$tgt' voice identical ('$lp{$tgt}')\n"; # print "#!! '$id:$tgt' voice identical ('$lp{$tgt}')\n";
} }
@ -410,20 +431,6 @@ foreach my $id (@langorder) {
} }
########## Write new language file ########## Write new language file
my $printnotes = 1;
#my @tmp = split(/\./, basename($ARGV[0]));
#my $f1 = $tmp[0];
#@tmp = split(/\./, basename($ARGV[1]));
#my $f2 = $tmp[0];
#
#if (index($f2, $f1) > -1) {
# $printnotes = 0;
#}
#undef $f1;
#undef $f2;
#undef @tmp;
my $fh; my $fh;
if ($ARGV[2] ne '-') { if ($ARGV[2] ne '-') {
open(FH, ">$ARGV[2]") || die ("Can't open $ARGV[2]"); open(FH, ">$ARGV[2]") || die ("Can't open $ARGV[2]");