From 9be4c6b14504a30160a79ecb8e4384d3f310b25d Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 26 Feb 2002 13:13:39 +0000 Subject: create bindtextdomain which does only part of the load_mo job --- perl-install/lang.pm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'perl-install') diff --git a/perl-install/lang.pm b/perl-install/lang.pm index b2a26e177..787789b7f 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -757,16 +757,24 @@ sub write { }; } -sub load_mo { - my ($lang) = @_; - my ($localedir, $suffix) = ("$ENV{SHARE_PATH}/locale", 'LC_MESSAGES/libDrakX.mo'); +sub bindtextdomain() { + my $localedir = "$ENV{SHARE_PATH}/locale"; $localedir .= "_special" if $::isInstall; - $lang ||= $ENV{LANGUAGE} || $ENV{LC_ALL} || $ENV{LC_MESSAGES} || $ENV{LANG}; - c::setlocale(); c::bindtextdomain('libDrakX', $localedir); + $localedir; +} + +sub load_mo { + my ($lang) = @_; + + my $localedir = bindtextdomain(); + my $suffix = 'LC_MESSAGES/libDrakX.mo'; + + $lang ||= $ENV{LANGUAGE} || $ENV{LC_ALL} || $ENV{LC_MESSAGES} || $ENV{LANG}; + foreach (split ':', $lang) { my $f = "$localedir/$_/$suffix"; -s $f and return $_; -- cgit v1.2.1