Skip to content

Commit

Permalink
enforce presence of same number of color tags in source and translation
Browse files Browse the repository at this point in the history
  • Loading branch information
wchristian committed Jul 24, 2019
1 parent 7d5cc0c commit 794c010
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 12 additions & 3 deletions kc.po
Original file line number Diff line number Diff line change
Expand Up @@ -5673,7 +5673,16 @@ msgid ""
"\n"
"さらに艦隊が居る場合は、それぞれに\n"
"[115511]支援艦隊[-]を向かわせることが可能です。\n"
msgstr "Counterattack the enemy with the allied fleet. The battle is divided into two parts, Vanguard Fleet and Battle Fleet. In addition, it is possible to direct support to each part\n"
msgstr ""
"[000000]Counterattack the enemy with a [0055aa]combined fleet[-].\n"
"A [0055aa]combined fleet[-] is divided into two parts,\n"
"\n"
"・Vanguard Fleet\n"
"・Battle Fleet\n"
"\n"
"If there are more fleets, it is possible\n"
"to send each as a [115511]support fleet[-].\n"
"\n"

msgctxt "resources_00945.-10|-1"
msgid ""
Expand Down Expand Up @@ -5747,7 +5756,7 @@ msgid ""
"配備を解除した場合も、同じく回航状態となり\n"
"ます。"
msgstr ""
"[000000][000000]The more Regions away from your base,\n"
"[000000]The more Regions away from your base,\n"
"the more days (turns) required for the [0055aa]voyage[-].\n"
"If you cancel a Transportation or Escort Fleet,\n"
"it will also be in a round trip."
Expand Down Expand Up @@ -47558,7 +47567,7 @@ msgstr ""

msgctxt "███ generic translation ███"
msgid "残り継戦時間[F9C66CFF]100[-]日"
msgstr "100 days of war remain."
msgstr "[F9C66CFF]100[-] days of war remain."

msgctxt "level4_00047.-15|-1"
msgid "残り継戦時間[F9C66CFF]100[-]日"
Expand Down
6 changes: 6 additions & 0 deletions translate_utf8_binary.pl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use countdown;
use Locale::PO;
use Devel::Confess;
use Test::More;

=head1 DESCRIPTION
Expand Down Expand Up @@ -781,6 +782,7 @@ sub run {
$|++;
binmode STDOUT, ":encoding(UTF-8)";
binmode STDERR, ":encoding(UTF-8)";
Test::More->builder->output("/dev/null"); # allows using is_deeply without spam

my ( $opt, $usage ) = describe_options(
'perl %c %o',
Expand Down Expand Up @@ -828,6 +830,9 @@ sub run {
$tr =~ s/\n/\\n/g;
$tr =~ s/\\r//g;
$po->msgstr($tr);
next if !$tr;
my ( $codes_src, $codes_tra ) = map [ map lc, sort ( $_ =~ /\[(-|b|\/b|[0-9a-fA-F]{6,8})\]/g ) ], $id, $tr;
die "color code mismatch" if not is_deeply $codes_tra, $codes_src, encode "UTF-8", "$id\n$tr\n@$codes_src\n@$codes_tra\n";
}
cache_and_load_carriage_returns @pof[ 1 .. $#pof ];

Expand Down Expand Up @@ -1055,6 +1060,7 @@ sub run {
io("report.txt")->utf8->print( join "\n", filter_nl @report );

say "\ndone";
done_testing;
return;
}

Expand Down

0 comments on commit 794c010

Please sign in to comment.