summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/common.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index e81253ed3..5c5168c4c 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -6,10 +6,11 @@ use diagnostics;
use strict;
use run_program;
use vars qw(@ISA @EXPORT $SECTORSIZE);
+use POSIX qw(setlocale LC_ALL LC_COLLATE);
@ISA = qw(Exporter);
# no need to export ``_''
-@EXPORT = qw($SECTORSIZE N N_ check_for_xserver files_exist formatTime formatXiB is_xbox makedev mandrake_release removeXiBSuffix require_root_capability salt setVirtual set_alternative set_permissions translate unmakedev untranslate);
+@EXPORT = qw($SECTORSIZE N N_ check_for_xserver files_exist formatTime formatXiB is_xbox makedev mandrake_release removeXiBSuffix require_root_capability salt setVirtual set_alternative set_l10n_sort set_permissions translate unmakedev untranslate);
# perl_checker: RE-EXPORT-ALL
push @EXPORT, @MDK::Common::EXPORT;
@@ -81,6 +82,17 @@ sub untranslate {
die "untranslate failed";
}
+sub set_l10n_sort() {
+ my $collation_locale = $ENV{LC_ALL};
+ if ($collation_locale) {
+ $collation_locale =~ /UTF-8/ or setlocale(LC_ALL, "$collation_locale.UTF-8");
+ } else {
+ $collation_locale = setlocale(LC_COLLATE);
+ $collation_locale =~ /UTF-8/ or setlocale(LC_COLLATE, "$collation_locale.UTF-8");
+ }
+}
+
+
BEGIN { undef *availableRamMB }
sub availableRamMB() {
my $s = MDK::Common::System::availableRamMB();