languages: Prefer translated <dest> over untranslated english <voice>

When a prase is translated but the voice is not, default to using
the translated phrase over the untranslated English voice

Change-Id: Ie2cb1c6d0c370f450586b8a4653f1a073f8aec9d
This commit is contained in:
Solomon Peachy 2021-09-29 10:07:51 -04:00
parent 2ebe69b67a
commit 757766e807
1 changed files with 10 additions and 2 deletions

View File

@ -366,9 +366,17 @@ foreach my $id (@langorder) {
} elsif ($lp{$tgt} ne $ep{$tgt}) {
if ($lp{$tgt} eq '' && $ep{$tgt} ne '') {
# If the lang voice string is blank, complain, and copy from English
$lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is blank! Copying from english!\n";
# print "#!! '$id:$tgt' voice is blank ('$lp{$tgt}' vs '$ep{$tgt}')\n";
$lang{$id}{'voice'}{$tgt} = $english{$id}{'voice'}{$tgt};
if ($lang{$id}{'dest'}{$tgt} ne '' &&
$lang{$id}{'dest'}{$tgt} ne $english{$id}{'dest'}{$tgt}) {
$lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is blank! Copying from translated <dest>!\n";
$lang{$id}{'voice'}{$tgt} = $lang{$id}{'dest'}{$tgt};
} else {
$lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is blank! Copying from english!\n";
$lang{$id}{'voice'}{$tgt} = $english{$id}{'voice'}{$tgt};
}
} elsif ($lp{$tgt} ne '' && $ep{$tgt} eq '') {
if ($id ne 'VOICE_NUMERIC_TENS_SWAP_SEPARATOR') {
# If it's not blank, clear it and complain!