summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/lang.pm18
1 files changed, 13 insertions, 5 deletions
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 $_;