[Scummvm-git-logs] scummvm-tools master -> a3dce7d57c0a1d87a66e95199b2a2d026f52d0df
sev-
sev at scummvm.org
Sun Apr 29 23:18:21 CEST 2018
This automated email contains information about 10 new commits which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .
Summary:
f7974045b5 TOOLS: PRINCE: Initial code for talktxt.txt POT generation
9ce63b37a3 TOOLS: PRINCE: Fix warnings
4274f59f43 TOOLS: PRINCE: Implemented dialogText print
6b588625d3 TOOLS: PRINCE: Implemented talkNoDialog
748eeff871 TOOLS: PRINCE: More heuristics to English string detection
2f88c24254 TOOLS: PRINCE: Reenable full dump in POT generation
f0ad4b7433 TOOLS: PRINCE: Escape quotes in language converter
a3062960c7 TOOLS: PRINCE: Initial code for POT parser
fdb5367233 TOOLS: PRINCE: Fix credits POT generation
a3dce7d57c TOOLS: PRINCE: More files parsed from POT
Commit: f7974045b5884e569e9b168b11b10f9673bbd389
https://github.com/scummvm/scummvm-tools/commit/f7974045b5884e569e9b168b11b10f9673bbd389
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-29T23:18:09+02:00
Commit Message:
TOOLS: PRINCE: Initial code for talktxt.txt POT generation
Changed paths:
engines/prince/gen-po.pl
diff --git a/engines/prince/gen-po.pl b/engines/prince/gen-po.pl
index 51856e2..acb2d3a 100644
--- a/engines/prince/gen-po.pl
+++ b/engines/prince/gen-po.pl
@@ -8,6 +8,10 @@ sub process_inv($);
sub process_varia($);
sub process_mob($);
sub process_credits($);
+sub process_talk($);
+
+sub process_talkWithDialog($$);
+sub process_talkNoDialog($$);
use open qw/:std :utf8/;
@@ -41,10 +45,11 @@ msgstr ""
"X-Generator: Weblate 2.9\\n"
EOF
-process_inv "invtxt.txt.out";
-process_varia "variatxt.txt.out";
-process_mob "mob.txt.out";
-process_credits "credits.txt.out";
+#process_inv "invtxt.txt.out";
+#process_varia "variatxt.txt.out";
+#process_mob "mob.txt.out";
+#process_credits "credits.txt.out";
+process_talk "talktxt.txt.out";
exit;
@@ -180,3 +185,96 @@ EOF
close IN;
}
+
+sub process_talk($) {
+ my $file = shift;
+
+ open(*IN, $file) or die "Cannot open file $file: $!";
+
+ my $n = 0;
+ my $dialog = 1;
+ my $str = "";
+
+ while (<IN>) {
+ chomp;
+
+ next if $_ eq 'talktxt.dat';
+
+ if ($_ eq "\@DIALOGBOX_LINES:") {
+ process_talkWithDialog($dialog, IN);
+ } elsif ($_ eq "\@NORMAL_LINES:") {
+ process_talkNoDialog($dialog, IN);
+ }
+ }
+
+ close IN;
+}
+
+
+sub process_talkWithDialog($$) {
+ my $dialog = shift;
+ my $in = shift;
+
+ my $s;
+ my $line = 0;
+
+ while (<$in>) {
+ chomp;
+
+ if (/^#HERO$/) {
+ $s .= "HERO: ";
+ } elsif (/^#OTHER$/) {
+ $s .= "OTHER: ";
+ } elsif (/^#OTHER2$/) {
+ $s .= "OTHER2: ";
+ } elsif (/^#PAUSE$/) {
+ $s .= "P#";
+ } elsif (/^#BOX 0$/) {
+ $_ = <$in>; # skip #END
+ last; # Break
+ } else {
+ $line++;
+ print <<EOF;
+
+#: dialog$dialog.txt:$line
+msgid "$s$_"
+msgstr ""
+EOF
+
+ $s = "";
+ }
+ }
+
+ my $box;
+
+ while (<$in>) {
+ chomp;
+
+ if (/^\@DIALOG_BOX (\d+)$/) {
+ $box = $1 + 1;
+ if ($box > 9) {
+ die "Too big DIALOG_BOX: $box";
+ }
+ next;
+ } elsif (/^\@DIALOG_OPT (\d+)$/) {
+ $box = $1 + 1;
+ last;
+ } elsif (/^#END$/) {
+ next;
+ } elsif (/^\$(\d+)$/) {
+ $s = "$_: ";
+ $line = $1;
+ } else {
+ my $n = sprintf("%d%02d", $box, $line);
+ print <<EOF;
+
+#: dialog$dialog.txt:$n
+msgid "$s$_"
+msgstr ""
+EOF
+
+ }
+ }
+
+ exit;
+}
Commit: 9ce63b37a353d691298602e5e9f7e14ce8fd4256
https://github.com/scummvm/scummvm-tools/commit/9ce63b37a353d691298602e5e9f7e14ce8fd4256
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-29T23:18:09+02:00
Commit Message:
TOOLS: PRINCE: Fix warnings
Changed paths:
engines/prince/gen-po.pl
diff --git a/engines/prince/gen-po.pl b/engines/prince/gen-po.pl
index acb2d3a..9a85485 100644
--- a/engines/prince/gen-po.pl
+++ b/engines/prince/gen-po.pl
@@ -53,7 +53,7 @@ process_talk "talktxt.txt.out";
exit;
-sub process_inv {
+sub process_inv($) {
my $file = shift;
open(*IN, $file) or die "Cannot open file $file: $!";
@@ -78,7 +78,7 @@ EOF
close IN;
}
-sub process_varia {
+sub process_varia($) {
my $file = shift;
open(*IN, $file) or die "Cannot open file $file: $!";
@@ -103,7 +103,7 @@ EOF
close IN;
}
-sub process_mob {
+sub process_mob($) {
my $file = shift;
open(*IN, $file) or die "Cannot open file $file: $!";
@@ -139,7 +139,7 @@ EOF
close IN;
}
-sub process_credits {
+sub process_credits($) {
my $file = shift;
open(*IN, $file) or die "Cannot open file $file: $!";
Commit: 4274f59f43aea4a18c77a9ea227e8e8efbcbc246
https://github.com/scummvm/scummvm-tools/commit/4274f59f43aea4a18c77a9ea227e8e8efbcbc246
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-29T23:18:09+02:00
Commit Message:
TOOLS: PRINCE: Implemented dialogText print
Changed paths:
engines/prince/gen-po.pl
diff --git a/engines/prince/gen-po.pl b/engines/prince/gen-po.pl
index 9a85485..4759238 100644
--- a/engines/prince/gen-po.pl
+++ b/engines/prince/gen-po.pl
@@ -257,7 +257,11 @@ EOF
}
next;
} elsif (/^\@DIALOG_OPT (\d+)$/) {
- $box = $1 + 1;
+ $box = $1;
+
+ die "Overflow in DIALOG_OPT: $box" if $box > 9;
+
+ $line = 0;
last;
} elsif (/^#END$/) {
next;
@@ -276,5 +280,67 @@ EOF
}
}
- exit;
+ my $needPrint = 0;
+ my $snew;
+
+ while (<$in>) {
+ chomp;
+
+ if (/^#HERO$/) {
+ $snew = "HERO: ";
+ $needPrint = 1;
+ } elsif (/^#OTHER$/) {
+ $snew = "OTHER: ";
+ $needPrint = 1;
+ } elsif (/^#OTHER2$/) {
+ $snew = "OTHER2: ";
+ $needPrint = 1;
+ } elsif (/^#PAUSE$/) {
+ $s .= "#P";
+ } elsif (/^#ENABLE (\d+)$/) {
+ $s .= "#E$1"
+ } elsif (/^#DISABLE (\d+)$/) {
+ $s .= "#D$1"
+ } elsif (/^#BOX (\d+)$/) {
+ $s .= "#B$1"
+ } elsif (/^#EXIT (\d+)$/) {
+ $s .= "#X$1"
+ } elsif (/^#FLAG (\d+)$/) {
+ $s .= "#F$1"
+ } elsif (/^#END$/) {
+ $needPrint = 1;
+ $snew = "";
+
+ if ($line == 0) {
+ $line = 1; # Force print empty lines
+ }
+ } elsif (/^\@DIALOG_OPT (\d+)$/) {
+ $box = $1;
+
+ die "Overflow in DIALOG_OPT: $box" if $box > 9;
+
+ $line = 0;
+ } elsif (/^#ENDEND$/) {
+ last;
+ } else {
+ $line++;
+ $s .= $_;
+ }
+
+ if ($needPrint) {
+ my $n = sprintf("%d%02d", 1000 + $box, $line);
+
+ if ($line) {
+ print <<EOF;
+
+#: dialog$dialog.txt:$n
+msgid "$s"
+msgstr ""
+EOF
+ }
+
+ $s = $snew;
+ $needPrint = 0;
+ }
+ }
}
Commit: 6b588625d3a4d8cc62b83a1e7cce0117be96951c
https://github.com/scummvm/scummvm-tools/commit/6b588625d3a4d8cc62b83a1e7cce0117be96951c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-29T23:18:09+02:00
Commit Message:
TOOLS: PRINCE: Implemented talkNoDialog
Changed paths:
engines/prince/gen-po.pl
diff --git a/engines/prince/gen-po.pl b/engines/prince/gen-po.pl
index 4759238..e23d189 100644
--- a/engines/prince/gen-po.pl
+++ b/engines/prince/gen-po.pl
@@ -205,6 +205,8 @@ sub process_talk($) {
} elsif ($_ eq "\@NORMAL_LINES:") {
process_talkNoDialog($dialog, IN);
}
+
+ $dialog++;
}
close IN;
@@ -258,9 +260,6 @@ EOF
next;
} elsif (/^\@DIALOG_OPT (\d+)$/) {
$box = $1;
-
- die "Overflow in DIALOG_OPT: $box" if $box > 9;
-
$line = 0;
last;
} elsif (/^#END$/) {
@@ -316,9 +315,6 @@ EOF
}
} elsif (/^\@DIALOG_OPT (\d+)$/) {
$box = $1;
-
- die "Overflow in DIALOG_OPT: $box" if $box > 9;
-
$line = 0;
} elsif (/^#ENDEND$/) {
last;
@@ -344,3 +340,37 @@ EOF
}
}
}
+
+sub process_talkNoDialog($$) {
+ my $dialog = shift;
+ my $in = shift;
+
+ my $s;
+ my $line = 0;
+
+ while (<$in>) {
+ chomp;
+
+ if (/^#HERO$/) {
+ $s .= "HERO: ";
+ } elsif (/^#OTHER$/) {
+ $s .= "OTHER: ";
+ } elsif (/^#OTHER2$/) {
+ $s .= "OTHER2: ";
+ } elsif (/^#PAUSE$/) {
+ $s .= "P#";
+ } elsif (/^#END$/) {
+ last; # Break
+ } else {
+ $line++;
+ print <<EOF;
+
+#: dialog$dialog.txt:$line
+msgid "$s$_"
+msgstr ""
+EOF
+
+ $s = "";
+ }
+ }
+}
Commit: 748eeff8714504f0dd5a7faa139109857be634f0
https://github.com/scummvm/scummvm-tools/commit/748eeff8714504f0dd5a7faa139109857be634f0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-29T23:18:09+02:00
Commit Message:
TOOLS: PRINCE: More heuristics to English string detection
Changed paths:
engines/prince/convert-ru.pl
diff --git a/engines/prince/convert-ru.pl b/engines/prince/convert-ru.pl
index 803338d..42836cf 100644
--- a/engines/prince/convert-ru.pl
+++ b/engines/prince/convert-ru.pl
@@ -13,7 +13,7 @@ my $lang;
my @english = (' a ', ' is ', ' i ', ' and ', ' be ', 'can', ' me', 'you', 'ack', 'that', 'then', 'yes', 'um', 'chi', 'year', 'mm', 'no', 'da', 'on',
'bla', 'lik', 'ha', 'but', 'ma', 'wa', 'yeah', 'taste', 'str', 'grr', 'pff', 'air', 'lord', ' he, ', 'get', 'yuck', 'oo', 'blur', 'see',
- 'puah', 'lo', 'go', 'cur', 'hop', 'super', 'doing', 'well', 'real', 'sure', 'final', 'all', 'illeg', 'done', 'empt');
+ 'puah', 'lo', 'go', 'cur', 'hop', 'super', 'doing', 'well', 'real', 'sure', 'final', 'all', 'illeg', 'done', 'empt', 'galador');
while (<STDIN>) {
$line++;
@@ -62,12 +62,12 @@ while (<STDIN>) {
if ($lang eq 'ru' or $lang eq 'en') { # We have English mixed with Russian
if ($skip) {
- tr /\x9f\xa3/źá/; # Pseude-hungarian speech symbol
+ tr /\x9f\xa3/źá/; # Pseudo-hungarian speech symbol
print;
next;
}
- if (/^nj b dsqltn.$/) { # After this phrase we have German
+ if (/^nj b dsqltn.$/ && $lang eq 'ru') { # After this phrase we have German
$skip = 1;
}
@@ -85,7 +85,7 @@ while (<STDIN>) {
if ($lang eq 'de') {
tr /\xc4\xdf\xfc\xf6/Äßüö/;
- tr /\x9f\xa3/źá/; # Pseude-hungarian speech symbol
+ tr /\x9f\xa3/źá/; # Pseudo-hungarian speech symbol
print;
}
Commit: 2f88c2425439c2ce6ee4a8f81e58debb37a13cf4
https://github.com/scummvm/scummvm-tools/commit/2f88c2425439c2ce6ee4a8f81e58debb37a13cf4
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-29T23:18:09+02:00
Commit Message:
TOOLS: PRINCE: Reenable full dump in POT generation
Changed paths:
engines/prince/gen-po.pl
diff --git a/engines/prince/gen-po.pl b/engines/prince/gen-po.pl
index e23d189..6a0add3 100644
--- a/engines/prince/gen-po.pl
+++ b/engines/prince/gen-po.pl
@@ -45,10 +45,10 @@ msgstr ""
"X-Generator: Weblate 2.9\\n"
EOF
-#process_inv "invtxt.txt.out";
-#process_varia "variatxt.txt.out";
-#process_mob "mob.txt.out";
-#process_credits "credits.txt.out";
+process_inv "invtxt.txt.out";
+process_varia "variatxt.txt.out";
+process_mob "mob.txt.out";
+process_credits "credits.txt.out";
process_talk "talktxt.txt.out";
exit;
@@ -236,6 +236,7 @@ sub process_talkWithDialog($$) {
last; # Break
} else {
$line++;
+ $data{'talktxt.txt'}{$dialog}{$line} = "$s$_";
print <<EOF;
#: dialog$dialog.txt:$line
@@ -269,6 +270,7 @@ EOF
$line = $1;
} else {
my $n = sprintf("%d%02d", $box, $line);
+ $data{'talktxt.txt'}{$dialog}{$n} = "$s$_";
print <<EOF;
#: dialog$dialog.txt:$n
@@ -327,6 +329,7 @@ EOF
my $n = sprintf("%d%02d", 1000 + $box, $line);
if ($line) {
+ $data{'talktxt.txt'}{$dialog}{$n} = "$s";
print <<EOF;
#: dialog$dialog.txt:$n
@@ -363,6 +366,7 @@ sub process_talkNoDialog($$) {
last; # Break
} else {
$line++;
+ $data{'talktxt.txt'}{$dialog}{$line} = "$s$_";
print <<EOF;
#: dialog$dialog.txt:$line
Commit: f0ad4b743379dad9dbbe358e98fe6927e4a6fb50
https://github.com/scummvm/scummvm-tools/commit/f0ad4b743379dad9dbbe358e98fe6927e4a6fb50
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-29T23:18:09+02:00
Commit Message:
TOOLS: PRINCE: Escape quotes in language converter
Changed paths:
engines/prince/convert-ru.pl
diff --git a/engines/prince/convert-ru.pl b/engines/prince/convert-ru.pl
index 42836cf..7407704 100644
--- a/engines/prince/convert-ru.pl
+++ b/engines/prince/convert-ru.pl
@@ -43,6 +43,8 @@ while (<STDIN>) {
}
}
+ s/"/\\"/g; # Escape quotes
+
if ($lang eq 'en') {
# Heuristics to detect Russian
my $eng = 0;
Commit: a3062960c7b75c0fc4229b3f5bb0647c2dffde02
https://github.com/scummvm/scummvm-tools/commit/a3062960c7b75c0fc4229b3f5bb0647c2dffde02
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-29T23:18:09+02:00
Commit Message:
TOOLS: PRINCE: Initial code for POT parser
Changed paths:
A engines/prince/po-parse.pl
diff --git a/engines/prince/po-parse.pl b/engines/prince/po-parse.pl
new file mode 100644
index 0000000..27d90e8
--- /dev/null
+++ b/engines/prince/po-parse.pl
@@ -0,0 +1,99 @@
+#!perl
+
+# Generate .po file for The Prince and the Coward game
+
+use utf8;
+
+sub process_inv($);
+sub process_varia($);
+sub process_mob($);
+sub process_credits($);
+sub process_talk($);
+
+use open qw/:std :utf8/;
+
+if ($#ARGV != 1) {
+ die "Usage: $0 <language-code> <file>";
+}
+
+my %data;
+
+my $lang = $ARGV[0];
+
+my $fname = "";
+my $idx1 = "";
+my $idx2 = "";
+my $seenheader = 0;
+
+my %data;
+
+while (<$ARGV[1]>) {
+ chomp;
+
+ if (/^#: ([^:]]+):(\d+)$/) {
+ $fname = $1;
+ $idx1 = $2;
+
+ $seenheader = 1;
+
+ next;
+ }
+
+ if (/^msgid (.*)$/) {
+ my $s = $1;
+
+ $s =~ s/(^")|("$)//g;
+ $s =~ s/\\"/"/g;
+
+ $data{$fname}{$idx1} = $s;
+ }
+}
+
+
+process_inv "invtxt.txt.out1";
+process_varia "variatxt.txt.out1";
+process_mob "mob.txt.out1";
+process_credits "credits.txt.out1";
+process_talk "talktxt.txt.out1";
+
+exit;
+
+sub process_inv($) {
+ my $file = shift;
+
+ open(*OUT, ">$file") or die "Cannot open file $file: $!";
+
+ close OUT;
+}
+
+sub process_varia($) {
+ my $file = shift;
+
+ open(*OUT, ">$file") or die "Cannot open file $file: $!";
+
+ close OUT;
+}
+
+sub process_mob($) {
+ my $file = shift;
+
+ open(*OUT, ">$file") or die "Cannot open file $file: $!";
+
+ close OUT;
+}
+
+sub process_credits($) {
+ my $file = shift;
+
+ open(*OUT, ">$file") or die "Cannot open file $file: $!";
+
+ close OUT;
+}
+
+sub process_talk($) {
+ my $file = shift;
+
+ open(*OUT, ">$file") or die "Cannot open file $file: $!";
+
+ close OUT;
+}
Commit: fdb5367233d95aaff944489e7bb7eac238710cc8
https://github.com/scummvm/scummvm-tools/commit/fdb5367233d95aaff944489e7bb7eac238710cc8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-29T23:18:09+02:00
Commit Message:
TOOLS: PRINCE: Fix credits POT generation
Changed paths:
engines/prince/gen-po.pl
diff --git a/engines/prince/gen-po.pl b/engines/prince/gen-po.pl
index 6a0add3..b6ea5c8 100644
--- a/engines/prince/gen-po.pl
+++ b/engines/prince/gen-po.pl
@@ -151,7 +151,7 @@ sub process_credits($) {
while (<IN>) {
chomp;
- next if $_ eq 'credits.txt';
+ next if $_ eq 'credits.dat';
$line++;
$str .= "\"$_\\n\"\n";
Commit: a3dce7d57c0a1d87a66e95199b2a2d026f52d0df
https://github.com/scummvm/scummvm-tools/commit/a3dce7d57c0a1d87a66e95199b2a2d026f52d0df
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-29T23:18:09+02:00
Commit Message:
TOOLS: PRINCE: More files parsed from POT
Changed paths:
engines/prince/po-parse.pl
diff --git a/engines/prince/po-parse.pl b/engines/prince/po-parse.pl
index 27d90e8..e359c5f 100644
--- a/engines/prince/po-parse.pl
+++ b/engines/prince/po-parse.pl
@@ -16,8 +16,6 @@ if ($#ARGV != 1) {
die "Usage: $0 <language-code> <file>";
}
-my %data;
-
my $lang = $ARGV[0];
my $fname = "";
@@ -25,12 +23,15 @@ my $idx1 = "";
my $idx2 = "";
my $seenheader = 0;
-my %data;
+my $inmsgid = 0;
+our %data;
+
+open IN, $ARGV[1];
-while (<$ARGV[1]>) {
+while (<IN>) {
chomp;
- if (/^#: ([^:]]+):(\d+)$/) {
+ if (/^#: ([^:]+):(\d+)$/) {
$fname = $1;
$idx1 = $2;
@@ -39,13 +40,29 @@ while (<$ARGV[1]>) {
next;
}
+ if (/^msgid ""$/) {
+ $inmsgid = 1;
+ next;
+ }
+
if (/^msgid (.*)$/) {
my $s = $1;
$s =~ s/(^")|("$)//g;
- $s =~ s/\\"/"/g;
$data{$fname}{$idx1} = $s;
+
+ $inmsgid = 0;
+ }
+
+ if (/^"(.*)"$/) {
+ if ($inmsgid) {
+ $data{$fname}{$idx1} .= $1;
+ }
+ }
+
+ if (/^msgstr/) {
+ $inmsgid = 0;
}
}
@@ -63,6 +80,12 @@ sub process_inv($) {
open(*OUT, ">$file") or die "Cannot open file $file: $!";
+ print OUT "invtxt.dat\n";
+
+ for $n (sort {$a<=>$b} keys $data{'invtxt.txt'}) {
+ print OUT "$n. $data{'invtxt.txt'}{$n}\n";
+ }
+
close OUT;
}
@@ -71,6 +94,12 @@ sub process_varia($) {
open(*OUT, ">$file") or die "Cannot open file $file: $!";
+ print OUT "variatxt.dat\n";
+
+ for $n (sort {$a<=>$b} keys $data{'variatxt.txt'}) {
+ print OUT "$n. $data{'variatxt.txt'}{$n}\n";
+ }
+
close OUT;
}
@@ -79,6 +108,28 @@ sub process_mob($) {
open(*OUT, ">$file") or die "Cannot open file $file: $!";
+ print OUT "mob.lst\n";
+
+ my $pn = 0;
+
+ for $n (sort {$a<=>$b} keys $data{'mob.lst'}) {
+ my $p1 = int($n / 1000);
+
+ if ($p1 != $pn) {
+ if ($p1 > 1) {
+ for my $i (($pn+1)..$p1) {
+ print OUT "$i.\n";
+ }
+ }
+ $pn = $p1;
+ }
+ print OUT "$data{'mob.lst'}{$n}\n";
+ }
+
+ for my $i (($pn+1)..61) {
+ print OUT "$i.\n";
+ }
+
close OUT;
}
@@ -87,6 +138,14 @@ sub process_credits($) {
open(*OUT, ">$file") or die "Cannot open file $file: $!";
+ print OUT "credits.dat\n";
+
+ for $n (sort {$a<=>$b} keys $data{'credits.txt'}) {
+ $data{'credits.txt'}{$n} =~ s/\\n/\n/g;
+
+ print OUT "$data{'credits.txt'}{$n}";
+ }
+
close OUT;
}
More information about the Scummvm-git-logs
mailing list