summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-12-15 08:48:51 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-12-15 08:48:51 +0000
commit226bc14e18ffe6c106d28680ea935cad227a9e05 (patch)
tree170f4b1a3214a90592075fd3e42ff07e21134d31
parentd78b368c177b069dc2a157f6a094df272a385eab (diff)
downloaddrakx-226bc14e18ffe6c106d28680ea935cad227a9e05.tar
drakx-226bc14e18ffe6c106d28680ea935cad227a9e05.tar.gz
drakx-226bc14e18ffe6c106d28680ea935cad227a9e05.tar.bz2
drakx-226bc14e18ffe6c106d28680ea935cad227a9e05.tar.xz
drakx-226bc14e18ffe6c106d28680ea935cad227a9e05.zip
use Locale::gettext for dgettext, bindtextdomain and bind_textdomain_codeset instead of module c
(that way we can also use dngettext, and it's more modular)
-rw-r--r--perl-install/c/stuff.xs.pl17
-rw-r--r--perl-install/common.pm3
-rw-r--r--perl-install/drakxtools.spec1
-rw-r--r--perl-install/lang.pm6
-rw-r--r--perl-install/mygtk2.pm2
-rw-r--r--perl-install/share/list.xml2
-rw-r--r--perl-install/standalone.pm2
7 files changed, 10 insertions, 23 deletions
diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl
index b3be00b31..59c842993 100644
--- a/perl-install/c/stuff.xs.pl
+++ b/perl-install/c/stuff.xs.pl
@@ -128,11 +128,6 @@ pcmcia_probe()
';
print '
-char *
-dgettext(domainname, msgid)
- char * domainname
- char * msgid
-
int
del_partition(hd, part_number)
int hd
@@ -187,18 +182,6 @@ setlocale(category, locale = 0)
int category
char * locale
-
-
-char *
-bindtextdomain(domainname, dirname)
- char * domainname
- char * dirname
-
-char *
-bind_textdomain_codeset(domainname, codeset)
- char * domainname
- char * codeset
-
int
lseek_sector(fd, sector, offset)
int fd
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 36628d900..fedf68926 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -1,6 +1,7 @@
package common; # $Id$
use MDK::Common;
+use Locale::gettext();
use diagnostics;
use strict;
@@ -59,7 +60,7 @@ sub translate_real {
my ($s) = @_;
$s or return '';
foreach (@::textdomains, 'libDrakX') {
- my $s2 = c::dgettext($_, $s);
+ my $s2 = Locale::gettext::dgettext($_, $s);
return $s2 if $s ne $s2;
}
$s;
diff --git a/perl-install/drakxtools.spec b/perl-install/drakxtools.spec
index 2277a9c99..e3546567e 100644
--- a/perl-install/drakxtools.spec
+++ b/perl-install/drakxtools.spec
@@ -27,6 +27,7 @@ Obsoletes: draksec
Summary: The drakxtools (XFdrake, diskdrake, keyboarddrake, mousedrake...)
Group: System/Configuration/Other
Requires: perl-base >= 2:5.8.6-1mdk, urpmi >= 4.6.13, usermode-consoleonly >= 1.44-4mdk, msec >= 0.38-5mdk
+Requires: perl-Locale-gettext
Requires: module-init-tools
Requires: %{name}-backend = %version-%release
Requires: monitor-edid >= 1.5
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index fa7090213..e4e6df54d 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -956,7 +956,7 @@ sub langsLANGUAGE {
sub utf8_should_be_needed {
my ($locale) = @_;
- my @l = uniq(grep { $_ ne 'C' } map { l2charset($_) } $locale->{lang}, langs($locale->{langs}));
+ my @l = uniq(grep { $_ ne 'C' } map { l2charset($_) } langs($locale->{langs}));
@l > 1 || any { /utf|unicode/ } @l;
}
@@ -1253,9 +1253,9 @@ sub bindtextdomain() {
my $localedir = "$ENV{SHARE_PATH}/locale" . ($::prefix ? "_special" : '');
c::init_setlocale();
- c::bind_textdomain_codeset('libDrakX', 'UTF-8');
$::need_utf8_i18n = 1;
- c::bindtextdomain('libDrakX', $localedir);
+ Locale::gettext::bind_textdomain_codeset('libDrakX', 'UTF-8');
+ Locale::gettext::bindtextdomain('libDrakX', $localedir);
$localedir;
}
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm
index 07992705c..18142326d 100644
--- a/perl-install/mygtk2.pm
+++ b/perl-install/mygtk2.pm
@@ -18,7 +18,7 @@ unless ($::no_ugtk_init) {
$::one_message_has_been_translated and warn("N() was called from $::one_message_has_been_translated BEFORE gtk2 initialisation, replace it with a N_() AND a translate() later.\n"), c::_exit(1);
Gtk2->init;
- c::bind_textdomain_codeset($_, 'UTF8') foreach 'libDrakX', @::textdomains;
+ Locale::gettext::bind_textdomain_codeset($_, 'UTF8') foreach 'libDrakX', @::textdomains;
$::need_utf8_i18n = 1;
}
Gtk2->croak_execeptions if (!$::no_ugtk_init || $::isInstall) && 0.95 < $Gtk2::VERSION;
diff --git a/perl-install/share/list.xml b/perl-install/share/list.xml
index 516003d86..4082618e6 100644
--- a/perl-install/share/list.xml
+++ b/perl-install/share/list.xml
@@ -289,6 +289,8 @@
MDV/Packdrakeng.pm
MDK/Common
MDK/Common.pm
+ ARCH-linux/Locale/gettext.pm
+ ARCH-linux/auto/Locale/gettext/gettext.so
ARCH-linux/URPM.pm
ARCH-linux/URPM/Build.pm
ARCH-linux/URPM/Resolve.pm
diff --git a/perl-install/standalone.pm b/perl-install/standalone.pm
index 02ee34bdb..320b336e1 100644
--- a/perl-install/standalone.pm
+++ b/perl-install/standalone.pm
@@ -16,7 +16,7 @@ $::isStandalone = 1;
$ENV{SHARE_PATH} ||= "/usr/share";
c::init_setlocale();
-c::bindtextdomain('libDrakX', "/usr/share/locale");
+Locale::gettext::bindtextdomain('libDrakX', "/usr/share/locale");
$::license = N_("This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by