Bug 15395: Do not use nl_putenv, use $ENV instead
authorJulian Maurice <julian.maurice@biblibre.com>
Thu, 25 Oct 2018 09:22:24 +0000 (11:22 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 8 Nov 2018 15:55:51 +0000 (15:55 +0000)
nl_putenv is only useful on Windows systems

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Koha/I18N.pm

index 44c4713..2152654 100644 (file)
@@ -24,7 +24,7 @@ use C4::Languages;
 use C4::Context;
 
 use Encode;
-use Locale::Messages qw(:locale_h nl_putenv setlocale LC_MESSAGES);
+use Locale::Messages qw(:locale_h setlocale LC_MESSAGES);
 use Koha::Cache::Memory::Lite;
 
 use parent 'Exporter';
@@ -54,7 +54,7 @@ sub init {
         if (@system_locales) {
             # LANG needs to be set to a valid locale,
             # otherwise LANGUAGE is ignored
-            nl_putenv('LANG=' . $system_locales[0]);
+            $ENV{LANG} = $system_locales[0];
             setlocale(LC_MESSAGES, '');
 
             my $langtag = C4::Languages::getlanguage;
@@ -68,8 +68,8 @@ sub init {
                 $locale .= '_' . $region;
             }
 
-            nl_putenv("LANGUAGE=$locale");
-            nl_putenv('OUTPUT_CHARSET=UTF-8');
+            $ENV{LANGUAGE} = $locale;
+            $ENV{OUTPUT_CHARSET} = 'UTF-8';
 
             my $directory = _base_directory();
             textdomain($textdomain);