From b8c2422ac2e382f5bbc46842301869369371cae6 Mon Sep 17 00:00:00 2001 From: Dries Harnie Date: Thu, 14 Aug 2025 19:35:01 +0200 Subject: [PATCH 1/2] PRINCE: Fix syntax error in po-parse.pl The `keys $var` form was removed in Perl 5.24. Replaced with the correct `keys %{$var}` form. --- engines/prince/po-parse.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engines/prince/po-parse.pl b/engines/prince/po-parse.pl index bc9fc2d8..f7307633 100644 --- a/engines/prince/po-parse.pl +++ b/engines/prince/po-parse.pl @@ -136,7 +136,7 @@ ($) print OUT "invtxt.dat\nitemNr. name - exam text\n"; - for my $n (sort {$a<=>$b} keys $data1{'invtxt.txt'}) { + for my $n (sort {$a<=>$b} keys %{$data1{'invtxt.txt'}}) { print OUT "$n. $data1{'invtxt.txt'}{$n}\n"; } @@ -150,7 +150,7 @@ ($) print OUT "variatxt.dat\nstringId. string\n"; - for my $n (sort {$a<=>$b} keys $data1{'variatxt.txt'}) { + for my $n (sort {$a<=>$b} keys %{$data1{'variatxt.txt'}}) { print OUT "$n. $data1{'variatxt.txt'}{$n}\n"; } @@ -166,7 +166,7 @@ ($) my $pn = 0; - for my $n (sort {$a<=>$b} keys $data1{'mob.lst'}) { + for my $n (sort {$a<=>$b} keys %{$data1{'mob.lst'}}) { my $p1 = int($n / 1000); if ($p1 != $pn) { @@ -197,7 +197,7 @@ ($) for my $f (sort grep /^dialog/, keys %data1) { $f =~ /dialog(\d+)/; my $dialog = $1; - my $hasDialog = !!grep { $_ > 100 } keys $data1{$f}; + my $hasDialog = !!grep { $_ > 100 } keys %{$data1{$f}}; if ($hasDialog) { print OUT "\@DIALOGBOX_LINES:\n"; @@ -208,7 +208,7 @@ ($) my $seenDialogBox = 0; my $prevBox = -1; - for my $n (sort {$a<=>$b} keys $data1{$f}) { + for my $n (sort {$a<=>$b} keys %{$data1{$f}}) { my $s = $data1{$f}{$n}; if ($n < 100) { while ($s =~ /^P#/) { From 5c0e0d34367d219ac12b732dedc1067e56988acf Mon Sep 17 00:00:00 2001 From: Dries Harnie Date: Thu, 14 Aug 2025 19:37:56 +0200 Subject: [PATCH 2/2] PRINCE: gen-translations.sh expects an input filename now This script used to reference a submodule in the ScummVM source tree with the translation sources. That submodule was removed, so the script now expects an argument and prints a hint if the directory does not exist: ``` % ./engines/prince/gen-translations.sh Usage: ./engines/prince/gen-translations.sh Download or clone from https://github.com/scummvm/game-translations/tree/prince-and-the-coward ``` --- engines/prince/gen-translations.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/engines/prince/gen-translations.sh b/engines/prince/gen-translations.sh index e50cb5aa..c668ef2b 100755 --- a/engines/prince/gen-translations.sh +++ b/engines/prince/gen-translations.sh @@ -1,6 +1,15 @@ #! /bin/bash -cp -v ../../../scummvm/devtools/create_prince/en.po . +set -e + +translations_dir="$1" +if [ -z "$translations_dir" ] || [ ! -d "$translations_dir" ]; then + echo "Usage: $0 " >&2 + echo "Download or clone from https://github.com/scummvm/game-translations/tree/prince-and-the-coward" >&2 + exit 1 +fi + +cp -v "$translations_dir"/en.po . perl po-parse.pl en en.po ../../scummvm-tools-cli --tool pack_prince . cp -v prince_translation.dat ../../../scummvm/dists/engine-data/