[Scummvm-git-logs] scummvm-tools master -> 8acd96de4c4050f9787589dbd67df6c2b8d412f7
sev-
sev at scummvm.org
Wed Apr 18 22:57:26 CEST 2018
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .
Summary:
8acd96de4c TOOLS: PRINCE: Added credits.txt support to the POT file generator
Commit: 8acd96de4c4050f9787589dbd67df6c2b8d412f7
https://github.com/scummvm/scummvm-tools/commit/8acd96de4c4050f9787589dbd67df6c2b8d412f7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-18T22:57:04+02:00
Commit Message:
TOOLS: PRINCE: Added credits.txt support to the POT file generator
Changed paths:
engines/prince/gen-po.pl
diff --git a/engines/prince/gen-po.pl b/engines/prince/gen-po.pl
index aee2f20..51856e2 100644
--- a/engines/prince/gen-po.pl
+++ b/engines/prince/gen-po.pl
@@ -7,6 +7,7 @@ use utf8;
sub process_inv($);
sub process_varia($);
sub process_mob($);
+sub process_credits($);
use open qw/:std :utf8/;
@@ -14,6 +15,8 @@ if ($#ARGV != 0) {
die "Usage: $0 <language-code>";
}
+my %data;
+
my $lang = $ARGV[0];
print <<EOF;
@@ -41,6 +44,7 @@ EOF
process_inv "invtxt.txt.out";
process_varia "variatxt.txt.out";
process_mob "mob.txt.out";
+process_credits "credits.txt.out";
exit;
@@ -56,6 +60,8 @@ sub process_inv {
/^([\d]+)\.\s+(.*)$/;
+ $data{'invtxt.dat'}{$1} = $2;
+
print <<EOF;
#: invtxt.txt:$1
@@ -79,6 +85,8 @@ sub process_varia {
/^([\d]+)\.\s+(.*)$/;
+ $data{'variatxt.dat'}{$1} = $2;
+
print <<EOF;
#: variatxt.txt:$1
@@ -113,6 +121,8 @@ sub process_mob {
$line++;
+ $data{'mob.lst'}{$n} = $_;
+
print <<EOF;
#: mob.lst:$n
@@ -123,3 +133,50 @@ EOF
close IN;
}
+
+sub process_credits {
+ my $file = shift;
+
+ open(*IN, $file) or die "Cannot open file $file: $!";
+
+ my $n = 0;
+ my $line = 0;
+ my $str = "";
+
+ while (<IN>) {
+ chomp;
+
+ next if $_ eq 'credits.txt';
+
+ $line++;
+ $str .= "\"$_\\n\"\n";
+
+ if ($line == 10) {
+ $data{'credits.txt'}{$n} = $str;
+
+ $n++;
+ $line = 0;
+
+ print <<EOF;
+
+#: credits.txt:$n
+msgid ""
+$str
+msgstr ""
+EOF
+
+ $str = "";
+ }
+ }
+
+ $data{'credits.txt'}{$n} = $str;
+
+ print <<EOF;
+
+#: credits.txt:$n
+msgid ""
+${str}msgstr ""
+EOF
+
+ close IN;
+}
More information about the Scummvm-git-logs
mailing list