1
0
Fork 0
forked from len0rd/rockbox

lang: Add a special flag to differentiate "intentionally identical to english"

We normally treat "same as English" as a translation errors that needs to be
corrected.  However, many languages effectively use english words as-is, so
we need a way of distinguishing the "intentionally the same" situations with
our tools "automatically copying missing translated strings from English" to
avoid blank or missing UI strings.

The solution is to make sure these "intentionally same as english"
strings are actually different.  This will be accomplished by prepending
'~' to the these strings.  This special character is stripped from the
binary data files used by the player and the voice generation tools.

Change-Id: I90088cbd74de0e5cb9d65f75f26afe04f7e301bf
This commit is contained in:
Solomon Peachy 2024-05-15 13:12:43 -04:00
parent 9d3b012ac0
commit 3a6ed727d4
2 changed files with 6 additions and 2 deletions

View file

@ -470,6 +470,10 @@ while(<LANG>) {
$idnum = $idcount[$user]++;
}
# Strip out the magic "Same as english" flag
$dest =~ s/^("?)~/$1/;
$voice =~ s/^("?)~/$1/;
$id{$idstr} = $idnum;
$idnum[$user][$idnum]=$idstr;

View file

@ -360,7 +360,7 @@ foreach my $id (@langorder) {
$lang{$id}{'dest'}{$tgt} = $english{$id}{'dest'}{$tgt};
}
} 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! (correct or prefix with ~)\n";
# print "#!! '$id:$tgt' dest identical ('$lp{$tgt}')\n";
}
if ($id eq 'LANG_VOICED_DATE_FORMAT') {
@ -466,7 +466,7 @@ foreach my $id (@langorder) {
$lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is identical to english, copying translated <dest>\n";
$lang{$id}{'voice'}{$tgt} = $lang{$id}{'dest'}{$tgt};
} else {
$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! (correct or prefix with ~)\n";
}
}
if (defined($lp{$tgt}) && ($lp{$tgt} =~ /%"/)) {