diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-05-16 21:50:42 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-05-16 21:51:14 -0400 |
commit | c615a02ee3127c4cb359983104d5c19f8b0f6590 (patch) | |
tree | afa49621eaed9e66178cb1f0c8a355b81e41d018 /tools/updatelang | |
parent | b9755a30854ba7ce1753f6eb1ff1ac83179cdcca (diff) | |
download | rockbox-c615a02ee3127c4cb359983104d5c19f8b0f6590.tar.gz rockbox-c615a02ee3127c4cb359983104d5c19f8b0f6590.zip |
updatelang: Improve tests for illegal characters
Change-Id: I1a8ed93f1e7d6b449e634656c8ff087f28c259f5
Diffstat (limited to 'tools/updatelang')
-rwxr-xr-x | tools/updatelang | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/tools/updatelang b/tools/updatelang index e8a5fcae9d..e0305ba7d1 100755 --- a/tools/updatelang +++ b/tools/updatelang | |||
@@ -392,13 +392,11 @@ foreach my $id (@langorder) { | |||
392 | # print "#!! '$id:$tgt' dest does not match src format args: '$fmt1' vs '$fmt2'\n"; | 392 | # print "#!! '$id:$tgt' dest does not match src format args: '$fmt1' vs '$fmt2'\n"; |
393 | } | 393 | } |
394 | } | 394 | } |
395 | if (defined($lp{$tgt})) { | 395 | |
396 | $count2 = $lp{$tgt} =~ tr/"//; | 396 | if ($lang{$id}{'dest'}{$tgt} =~ tr/"//) { |
397 | if ($count2 > 0) { | 397 | # If it has suspicious characters that are not allowed |
398 | # If it has suspicious characters that are not allowed | 398 | $lang{$id}{'notes'} .= "### The <dest> section for '$id:$tgt' has some suspicious characters, please double-check!\n"; |
399 | $lang{$id}{'notes'} .= "### The <dest> section for '$id:$tgt' has some suspicious characters, please double-check!\n"; | 399 | # print "#!! '$id:$tgt' suspicious characters\n"; |
400 | # print "#!! '$id:$tgt' suspicious characters\n"; | ||
401 | } | ||
402 | } | 400 | } |
403 | } | 401 | } |
404 | } | 402 | } |
@@ -439,11 +437,6 @@ foreach my $id (@langorder) { | |||
439 | $lang{$id}{'dest'}{$tgt} ne $english{$id}{'dest'}{$tgt}) { | 437 | $lang{$id}{'dest'}{$tgt} ne $english{$id}{'dest'}{$tgt}) { |
440 | $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is blank! Copying from translated <dest>!\n"; | 438 | $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is blank! Copying from translated <dest>!\n"; |
441 | $lang{$id}{'voice'}{$tgt} = $lang{$id}{'dest'}{$tgt}; | 439 | $lang{$id}{'voice'}{$tgt} = $lang{$id}{'dest'}{$tgt}; |
442 | if ($lang{$id}{'voice'}{$tgt} =~ /%"/) { | ||
443 | # If it has suspicious characters that are not normally voiced.. | ||
444 | $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' has some suspicious characters, please double-check!\n"; | ||
445 | #print "#!! '$id:$tgt' suspicious characters\n"; | ||
446 | } | ||
447 | } else { | 440 | } else { |
448 | $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is blank! Copying from english!\n"; | 441 | $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is blank! Copying from english!\n"; |
449 | 442 | ||
@@ -469,11 +462,16 @@ foreach my $id (@langorder) { | |||
469 | $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is identical to english! (correct or prefix with ~)\n"; | 462 | $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' is identical to english! (correct or prefix with ~)\n"; |
470 | } | 463 | } |
471 | } | 464 | } |
472 | if (defined($lp{$tgt}) && ($lp{$tgt} =~ /%"/)) { | 465 | if ($lang{$id}{'voice'}{$tgt} =~ tr/%"//) { |
473 | # If it has suspicious characters that are not normally voiced.. | 466 | # If it has suspicious characters that are not normally voiced.. |
474 | $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' has some suspicious characters, please double-check!\n"; | 467 | $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' has some suspicious characters (eg '%'), please double-check!\n"; |
475 | # print "#!! '$id:$tgt' suspicious characters\n"; | 468 | # print "#!! '$id:$tgt' suspicious characters\n"; |
476 | } | 469 | } |
470 | if ($lang{$id}{'voice'}{$tgt} =~ /\.\.\./) { | ||
471 | # Ellipses should not be in voice strings | ||
472 | $lang{$id}{'notes'} .= "### The <voice> section for '$id:$tgt' has ellipses (...), please remove!\n"; | ||
473 | # print "#!! '$id:$tgt' ellipses\n"; | ||
474 | } | ||
477 | } | 475 | } |
478 | } | 476 | } |
479 | 477 | ||