summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-04-29 17:14:15 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-04-29 17:14:15 -0400
commit9fd4782c6a2c5908e16f75eba469dcf6c6435af9 (patch)
tree54a882fd14706f7d9b75760f205ab0122536c8b0
parentbf325de48e68e3a30c6d34569d8e6374b9ab7e13 (diff)
downloadrockbox-9fd4782c6a.tar.gz
rockbox-9fd4782c6a.zip
updatelang: Complain about suspicious characters in voiced strings.
The main intent is to catch printf() format specifiers (ie '%') Change-Id: I8ed54993431e5f4d35e98de8faa7690198d5947f
-rwxr-xr-xtools/updatelang11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/updatelang b/tools/updatelang
index 61d57de532..b67a28400c 100755
--- a/tools/updatelang
+++ b/tools/updatelang
@@ -371,7 +371,11 @@ foreach my $id (@langorder) {
$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};
-
+ 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 {
$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";
}
}
+ 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";
+ }
}
}