Lines 24-31
use C4::Languages;
Link Here
|
24 |
use C4::Context; |
24 |
use C4::Context; |
25 |
|
25 |
|
26 |
use Encode; |
26 |
use Encode; |
27 |
use Locale::Util qw(set_locale); |
27 |
use Locale::Messages qw(:locale_h nl_putenv); |
28 |
use Locale::Messages qw(:locale_h :libintl_h nl_putenv); |
|
|
29 |
use Koha::Cache::Memory::Lite; |
28 |
use Koha::Cache::Memory::Lite; |
30 |
|
29 |
|
31 |
use parent 'Exporter'; |
30 |
use parent 'Exporter'; |
Lines 57-74
sub init {
Link Here
|
57 |
if ($region && length $region == 4) { |
56 |
if ($region && length $region == 4) { |
58 |
$region = $subtags[2]; |
57 |
$region = $subtags[2]; |
59 |
} |
58 |
} |
60 |
my $locale = set_locale(LC_ALL, $language, $region, 'utf-8'); |
59 |
Locale::Messages->select_package('gettext_pp'); |
61 |
unless ($locale) { |
60 |
my $locale = $language; |
62 |
set_locale(LC_MESSAGES, ''); |
61 |
if ($region) { |
63 |
Locale::Messages->select_package('gettext_pp'); |
62 |
$locale .= '_' . $region; |
64 |
$locale = $language; |
|
|
65 |
if ($region) { |
66 |
$locale .= '_' . $region; |
67 |
} |
68 |
nl_putenv("LANGUAGE=$locale"); |
69 |
nl_putenv("LANG=$locale"); |
70 |
nl_putenv('OUTPUT_CHARSET=utf-8'); |
71 |
} |
63 |
} |
|
|
64 |
nl_putenv("LANGUAGE=$locale"); |
65 |
nl_putenv("LANG=$locale"); |
66 |
nl_putenv('OUTPUT_CHARSET=utf-8'); |
72 |
|
67 |
|
73 |
my $directory = _base_directory(); |
68 |
my $directory = _base_directory(); |
74 |
textdomain($textdomain); |
69 |
textdomain($textdomain); |
75 |
- |
|
|