Bug 15395: Use POSIX::setlocale
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 31 Oct 2018 14:02:56 +0000 (11:02 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 8 Nov 2018 16:40:05 +0000 (16:40 +0000)
To keep compatibility with jessie (that have Message::Locales 1.23, so
without setlocale)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Koha/I18N.pm

index 2152654..7206223 100644 (file)
@@ -24,7 +24,8 @@ use C4::Languages;
 use C4::Context;
 
 use Encode;
-use Locale::Messages qw(:locale_h setlocale LC_MESSAGES);
+use Locale::Messages qw(:locale_h LC_MESSAGES);
+use POSIX qw( setlocale );
 use Koha::Cache::Memory::Lite;
 
 use parent 'Exporter';
@@ -55,7 +56,7 @@ sub init {
             # LANG needs to be set to a valid locale,
             # otherwise LANGUAGE is ignored
             $ENV{LANG} = $system_locales[0];
-            setlocale(LC_MESSAGES, '');
+            POSIX::setlocale(LC_MESSAGES, '');
 
             my $langtag = C4::Languages::getlanguage;
             my @subtags = split /-/, $langtag;