summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-09-29 10:07:51 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-09-29 10:07:51 -0400
commit757766e807e2922950ce9f274a0feb2b304343f1 (patch)
tree50621cc0f55591501533499b1428a5188c186d4c /tools
parent2ebe69b67a4000458ba399bd6c67dd60076e493a (diff)
downloadrockbox-757766e807e2922950ce9f274a0feb2b304343f1.tar.gz
rockbox-757766e807e2922950ce9f274a0feb2b304343f1.zip
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
Diffstat (limited to 'tools')
-rwxr-xr-xtools/updatelang12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/updatelang b/tools/updatelang
index bde1dedaea..2c2b1e1d3b 100755
--- a/tools/updatelang
+++ b/tools/updatelang
@@ -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!