summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/urpm.pm b/urpm.pm
index 2887b73a..20c72e2b 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -10,15 +10,17 @@ $VERSION = '4.4';
use URPM;
use URPM::Resolve;
use POSIX;
-use Locale::gettext();
#- I18N.
-setlocale(LC_ALL, "");
-Locale::gettext::textdomain("urpmi");
+eval {
+ require Locale::gettext;
+ setlocale(LC_ALL, "");
+ Locale::gettext::textdomain("urpmi");
+};
sub N {
my ($format, @params) = @_;
- sprintf(Locale::gettext::gettext($format || ''), @params);
+ sprintf(eval { Locale::gettext::gettext($format || '') } || $format, @params);
}
#- tool functions.