[Scummvm-git-logs] scummvm-tools master -> d870023f9db0adc00cd558fbb27f4fa14f1a113f

sev- sev at scummvm.org
Tue Apr 17 16:56:20 CEST 2018


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .

Summary:
d66fa8479b TOOLS: Initial code for generating prince POT file
d870023f9d TOOLS: Added support for variatxt and mobtxt to the POT file generator for Prince


Commit: d66fa8479b33eed4324a449e34121f91521e64ed
    https://github.com/scummvm/scummvm-tools/commit/d66fa8479b33eed4324a449e34121f91521e64ed
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-17T16:30:39+02:00

Commit Message:
TOOLS: Initial code for generating prince POT file

Changed paths:
  A engines/prince/gen-po.pl


diff --git a/engines/prince/gen-po.pl b/engines/prince/gen-po.pl
new file mode 100644
index 0000000..ca67dd2
--- /dev/null
+++ b/engines/prince/gen-po.pl
@@ -0,0 +1,62 @@
+#!perl
+
+# Generate .po file for The Prince and the Coward game
+
+use utf8;
+
+sub process_inv($);
+
+use open qw/:std :utf8/;
+
+if ($#ARGV != 0) {
+	die "Usage: $0 <language-code>";
+}
+
+my $lang = $ARGV[0];
+
+print <<EOF;
+# The Prince and the Coward lanugage file
+# Copyright (C) 2018 ScummVM Team
+# This file is distributed under the same license as the ScummVM package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Prince\\n"
+"Report-Msgid-Bugs-To: scummvm-devel at lists.scummvm.org\\n"
+"POT-Creation-Date: 2018-04-17 19:53+0100\\n"
+"PO-Revision-Date: 2018-04-17 18:01+0000\\n"
+"Last-Translator: Eugene Sandulenko <sev at scummvm.org>\\n"
+"Language-Team: none\\n"
+"Language: $lang\\n"
+"MIME-Version: 1.0\\n"
+"Content-Type: text/plain; charset=UTF8\\n"
+"Content-Transfer-Encoding: 8bit\\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\\n"
+"X-Generator: Weblate 2.9\\n"
+EOF
+
+process_inv "invtxt.txt.out";
+
+exit;
+
+sub process_inv {
+	my $file = shift;
+
+	open(*IN, $file) or die "Cannot open file $file: $!";
+
+	while (<IN>) {
+		chomp;
+
+		next if $_ eq 'invtxt.dat';
+
+		/^([\d]+)\.\s+(.*)$/;
+
+		print <<EOF;
+
+#: invtxt.txt:$1
+msgid "$2"
+msgstr ""
+EOF
+	}
+}


Commit: d870023f9db0adc00cd558fbb27f4fa14f1a113f
    https://github.com/scummvm/scummvm-tools/commit/d870023f9db0adc00cd558fbb27f4fa14f1a113f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2018-04-17T16:55:49+02:00

Commit Message:
TOOLS: Added support for variatxt and mobtxt to the POT file generator for Prince

Changed paths:
    engines/prince/gen-po.pl


diff --git a/engines/prince/gen-po.pl b/engines/prince/gen-po.pl
index ca67dd2..aee2f20 100644
--- a/engines/prince/gen-po.pl
+++ b/engines/prince/gen-po.pl
@@ -5,6 +5,8 @@
 use utf8;
 
 sub process_inv($);
+sub process_varia($);
+sub process_mob($);
 
 use open qw/:std :utf8/;
 
@@ -37,6 +39,8 @@ msgstr ""
 EOF
 
 process_inv "invtxt.txt.out";
+process_varia "variatxt.txt.out";
+process_mob "mob.txt.out";
 
 exit;
 
@@ -59,4 +63,63 @@ msgid "$2"
 msgstr ""
 EOF
 	}
+
+	close IN;
+}
+
+sub process_varia {
+	my $file = shift;
+
+	open(*IN, $file) or die "Cannot open file $file: $!";
+
+	while (<IN>) {
+		chomp;
+
+		next if $_ eq 'variatxt.dat';
+
+		/^([\d]+)\.\s+(.*)$/;
+
+		print <<EOF;
+
+#: variatxt.txt:$1
+msgid "$2"
+msgstr ""
+EOF
+	}
+
+	close IN;
+}
+
+sub process_mob {
+	my $file = shift;
+
+	open(*IN, $file) or die "Cannot open file $file: $!";
+
+	my $num = 1;
+	my $line = 1;
+
+	while (<IN>) {
+		chomp;
+
+		next if $_ eq 'mob.lst';
+
+		if (/^([\d]+)\.$/) {
+			$num = $1;
+			$line = 1;
+			next;
+		}
+
+		my $n = sprintf("%d%03d", $num, $line);
+
+		$line++;
+
+		print <<EOF;
+
+#: mob.lst:$n
+msgid "$_"
+msgstr ""
+EOF
+	}
+
+	close IN;
 }





More information about the Scummvm-git-logs mailing list