summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm/args.pm10
-rw-r--r--urpm/msg.pm7
2 files changed, 12 insertions, 5 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index 947f7193..d5de4bdc 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -37,9 +37,13 @@ my %options_spec = (
if (defined &::usage) { ::usage() } else { die "No help defined\n" }
},
"no-locales" => sub {
- require urpm; # make sure it has been loaded
- undef *::N; undef *urpm::N;
- *::N = *urpm::N = sub { sprintf(@_) };
+ require urpm::msg; # make sure it has been loaded
+ undef *::N;
+ undef *urpm::N;
+ undef *urpm::msg::N;
+ undef *urpm::args::N;
+ *::N = *urpm::N = *urpm::msg::N = *urpm::args::N
+ = sub { my ($f, @p) = @_; sprintf($f, @p) };
},
update => \$::update,
'media|mediums=s' => \$::media,
diff --git a/urpm/msg.pm b/urpm/msg.pm
index fb5264c7..d913b233 100644
--- a/urpm/msg.pm
+++ b/urpm/msg.pm
@@ -12,13 +12,16 @@ my $yesexpr = N("Yy");
eval {
require Locale::gettext;
use POSIX qw(LC_ALL);
- setlocale(LC_ALL, "");
+ POSIX::setlocale(LC_ALL, "");
Locale::gettext::textdomain("urpmi");
};
sub N {
my ($format, @params) = @_;
- sprintf(eval { Locale::gettext::gettext($format || '') } || $format, @params);
+ sprintf(
+ eval { Locale::gettext::gettext($format || '') } || $format,
+ @params,
+ );
}
sub log_it {