summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-02-26 13:13:39 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-02-26 13:13:39 +0000
commit9be4c6b14504a30160a79ecb8e4384d3f310b25d (patch)
treeebfaa0d904c584496c1a098d6cc577554c5be03f
parentff85c7c97e630975fbfb660511d86101af9cf619 (diff)
downloaddrakx-backup-do-not-use-9be4c6b14504a30160a79ecb8e4384d3f310b25d.tar
drakx-backup-do-not-use-9be4c6b14504a30160a79ecb8e4384d3f310b25d.tar.gz
drakx-backup-do-not-use-9be4c6b14504a30160a79ecb8e4384d3f310b25d.tar.bz2
drakx-backup-do-not-use-9be4c6b14504a30160a79ecb8e4384d3f310b25d.tar.xz
drakx-backup-do-not-use-9be4c6b14504a30160a79ecb8e4384d3f310b25d.zip
create bindtextdomain which does only part of the load_mo job
-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 $_;