From ef8df4099b4eb05cfd267a76bca9bf2e29629b96 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 7 Apr 2017 18:46:56 +0200 Subject: [PATCH] Bug 15395: Fix output of msgcat By default, msgcat tries to merge translations when two or more files have the same msgid, even for the header (msgid ""). This resulted in an invalid PO file ("#-#-#-#-#" markers in header). This patch tells msgcat to use the first available translation instead. Also, this patch set correctly the Project-Id-Version field --- misc/translator/LangInstaller.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm index 55e477b185..8f38c7de72 100644 --- a/misc/translator/LangInstaller.pm +++ b/misc/translator/LangInstaller.pm @@ -609,6 +609,7 @@ sub extract_messages { push @files_to_scan, @tt_files; my $xgettext_common_args = "--force-po --from-code=UTF-8 " + . "--package-name=Koha --package-version='' " . "-k -k__ -k__x -k__n:1,2 -k__nx:1,2 -k__xn:1,2 " . "-k__p:1c,2 -k__px:1c,2 -k__np:1c,2,3 -k__npx:1c,2,3 " . "-kN__ -kN__n:1,2 -kN__p:1c,2 -kN__np:1c,2,3"; @@ -637,7 +638,7 @@ sub extract_messages { die "system call failed: $xgettext_cmd"; } - my $msgcat_cmd = "$self->{msgcat} -o $Bin/$self->{domain}.pot $Bin/$self->{domain}-perl.pot $Bin/$self->{domain}-js.pot"; + my $msgcat_cmd = "$self->{msgcat} --use-first -o $Bin/$self->{domain}.pot $Bin/$self->{domain}-perl.pot $Bin/$self->{domain}-js.pot"; if (system($msgcat_cmd) != 0) { die "system call failed: $msgcat_cmd"; } -- 2.11.0