diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-11-06 13:20:21 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-11-06 13:20:21 +0000 |
commit | 9091151d546e5d749b47e2efce3ff651784fcc8c (patch) | |
tree | 2be2bec5e60f21ffe431eeef74095896ae5efe7f /perl-install/common.pm | |
parent | 68a1a2a6f2b9fdb1fd0c833cd9b3d8dcb9d8fd5c (diff) | |
download | drakx-9091151d546e5d749b47e2efce3ff651784fcc8c.tar drakx-9091151d546e5d749b47e2efce3ff651784fcc8c.tar.gz drakx-9091151d546e5d749b47e2efce3ff651784fcc8c.tar.bz2 drakx-9091151d546e5d749b47e2efce3ff651784fcc8c.tar.xz drakx-9091151d546e5d749b47e2efce3ff651784fcc8c.zip |
replace "_" with "N" and "__" with "N_"
rationale:
- currently, we use _("xxx") as a shorthand for gettext("xxx"). It
also used to call xgettext with --keyword=_
- alas, function &_ is global and not by package (notice esp. that _
is not exported in common.pm)
- this lead to big ugly pb with packages defining their own &_,
overriding common.pm's &_
- a fix is to set @::textdomains to add a new domain (the default
being "libDrakX")
but relying on the global "_" is still dangerous!
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index 6104b0b34..58872df01 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -8,7 +8,7 @@ use vars qw(@ISA @EXPORT $SECTORSIZE); @ISA = qw(Exporter); # no need to export ``_'' -@EXPORT = qw($SECTORSIZE __ translate untranslate formatXiB removeXiBSuffix formatTime setVirtual makedev unmakedev salt); +@EXPORT = qw($SECTORSIZE N N_ translate untranslate formatXiB removeXiBSuffix formatTime setVirtual makedev unmakedev salt); # perl_checker: RE-EXPORT-ALL push @EXPORT, @MDK::Common::EXPORT; @@ -24,11 +24,11 @@ $SECTORSIZE = 512; #-##################################################################################### -sub _ { +sub N { my $s = shift @_; my $t = translate($s); sprintf $t, @_; } -sub __ { $_[0] } +sub N_ { $_[0] } sub salt { my ($nb) = @_; @@ -96,7 +96,7 @@ sub formatXiB { ($nb, $base) = ($newnb, $newbase); $base >= 1024 ? ($newbase = $base / 1024) : ($newnb = $nb / 1024); }; - foreach ('', _("KB"), _("MB"), _("GB")) { + foreach ('', N("KB"), N("MB"), N("GB")) { $decr->(); if ($newnb < 1 && $newnb * $newbase < 1) { my $v = $nb * $base; @@ -104,7 +104,7 @@ sub formatXiB { return int($v) . ($s ? ".$s" : '') . $_; } } - int($newnb * $newbase) . _("TB"); + int($newnb * $newbase) . N("TB"); } sub formatTime { @@ -112,11 +112,11 @@ sub formatTime { if ($h) { sprintf "%02d:%02d", $h, $m; } elsif ($m > 1) { - _("%d minutes", $m); + N("%d minutes", $m); } elsif ($m == 1) { - _("1 minute"); + N("1 minute"); } else { - _("%d seconds", $s); + N("%d seconds", $s); } } @@ -161,14 +161,14 @@ sub take_screenshot { my $dir = screenshot_dir__and_move() . '/DrakX-screenshots'; my $warn; if (!-e $dir) { - mkdir $dir or $in->ask_warn('', _("Can't make screenshots before partitioning")), return; + mkdir $dir or $in->ask_warn('', N("Can't make screenshots before partitioning")), return; $warn = 1; } my $nb = 1; $nb++ while -e "$dir/$nb.png"; system("fb2png /dev/fb0 $dir/$nb.png 0"); - $in->ask_warn('', _("Screenshots will be available after install in %s", "/root/DrakX-screenshots")) if $warn; + $in->ask_warn('', N("Screenshots will be available after install in %s", "/root/DrakX-screenshots")) if $warn; } sub join_lines { |