From f5b67049ebb4d041e64c1776acdcb13e69371142 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 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 --- 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 d466ec9f2c..d22999e880 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.11.0