From f843b3be109f37efae816905aa2118ccc92897f8 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 11 Aug 2017 12:43:33 +0200 Subject: [PATCH] Bug 15395: Remove the use of Locale::Util's set_locale --- Koha/I18N.pm | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Koha/I18N.pm b/Koha/I18N.pm index 236454cc0e..95c82ff4f4 100644 --- a/Koha/I18N.pm +++ b/Koha/I18N.pm @@ -24,8 +24,7 @@ use C4::Languages; use C4::Context; use Encode; -use Locale::Util qw(set_locale); -use Locale::Messages qw(:locale_h :libintl_h nl_putenv); +use Locale::Messages qw(:locale_h nl_putenv); use Koha::Cache::Memory::Lite; use parent 'Exporter'; @@ -57,18 +56,14 @@ sub init { if ($region && length $region == 4) { $region = $subtags[2]; } - my $locale = set_locale(LC_ALL, $language, $region, 'utf-8'); - unless ($locale) { - set_locale(LC_MESSAGES, ''); - Locale::Messages->select_package('gettext_pp'); - $locale = $language; - if ($region) { - $locale .= '_' . $region; - } - nl_putenv("LANGUAGE=$locale"); - nl_putenv("LANG=$locale"); - nl_putenv('OUTPUT_CHARSET=utf-8'); + Locale::Messages->select_package('gettext_pp'); + my $locale = $language; + if ($region) { + $locale .= '_' . $region; } + nl_putenv("LANGUAGE=$locale"); + nl_putenv("LANG=$locale"); + nl_putenv('OUTPUT_CHARSET=utf-8'); my $directory = _base_directory(); textdomain($textdomain); -- 2.11.0