From fa2989942f2a299bf6c4fc093c3022b4a141bd1a Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 6 Apr 2017 10:09:19 +0200 Subject: [PATCH] Bug 15395: Fix PO header reading in po2json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since version 0.24 Locale::PO do not escape newline characters in string returned by dequote() This patch set the required version of Locale::PO to 0.24 and fix po2json https://rt.cpan.org/Public/Bug/Display.html?id=96016 Signed-off-by: Marc VĂ©ron --- C4/Installer/PerlDependencies.pm | 2 +- misc/translator/po2json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm index ffdceee1ad..99234d433d 100644 --- a/C4/Installer/PerlDependencies.pm +++ b/C4/Installer/PerlDependencies.pm @@ -142,7 +142,7 @@ our $PERL_DEPS = { 'Locale::PO' => { 'usage' => 'Core', 'required' => '1', - 'min_ver' => '0.17' + 'min_ver' => '0.24' }, 'LWP::Simple' => { 'usage' => 'Core', diff --git a/misc/translator/po2json b/misc/translator/po2json index 8a800926a7..2f534bead3 100755 --- a/misc/translator/po2json +++ b/misc/translator/po2json @@ -23,7 +23,7 @@ use strict; use JSON 2.53; -use Locale::PO 0.21; +use Locale::PO 0.24; use File::Basename qw(basename); my $gettext_context_glue = "\004"; @@ -81,7 +81,7 @@ sub main my $qmsgstr = $po->msgstr; my $cur = $po->dequote( $qmsgstr ); my %cur; - foreach my $h (split(/\\n/, $cur)) + foreach my $h (split(/\n/, $cur)) { next unless length($h); my @h = split(':', $h, 2); -- 2.14.2