1
0
Fork 0
forked from len0rd/rockbox

updatelang: Complain about suspicious characters in voiced strings.

The main intent is to catch printf() format specifiers (ie '%')

Change-Id: I8ed54993431e5f4d35e98de8faa7690198d5947f
This commit is contained in:
Solomon Peachy 2024-04-29 17:14:15 -04:00
parent bf325de48e
commit 9fd4782c6a

View file

@ -371,7 +371,11 @@ foreach my $id (@langorder) {
$lang{$id}{'dest'}{$tgt} ne $english{$id}{'dest'}{$tgt}) { $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}{'notes'} .= "### The <voice> section for '$id:$tgt' is blank! Copying from translated <dest>!\n";
$lang{$id}{'voice'}{$tgt} = $lang{$id}{'dest'}{$tgt}; $lang{$id}{'voice'}{$tgt} = $lang{$id}{'dest'}{$tgt};
if ($lang{$id}{'voice'}{$tgt} =~ /%/) {
# If it has suspicious characters that are not normally voiced..
$lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' has some suspicious characters, please double-check!\n";
#print "#!! '$id:$tgt' suspicious characters\n";
}
} else { } else {
$lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is blank! Copying from english!\n"; $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is blank! Copying from english!\n";
@ -397,6 +401,11 @@ foreach my $id (@langorder) {
$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";
} }
} }
if ($lp{$tgt} =~ /%/) {
# If it has suspicious characters that are not normally voiced..
$lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' has some suspicious characters, please double-check!\n";
# print "#!! '$id:$tgt' suspicious characters\n";
}
} }
} }