summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2010-05-08 16:12:55 +0000
committerAndreas Brachold <vdr07@deltab.de>2010-05-08 16:12:55 +0000
commitbfcd27e23bfb909c67b7983047637190598db7b7 (patch)
tree486b592aae82e14b00608b9814f48ec52817d75c /bin
parent2e3fa06ba9286c4d94073e0607ff5e1d83a2c2a2 (diff)
downloadxxv-bfcd27e23bfb909c67b7983047637190598db7b7.tar.gz
xxv-bfcd27e23bfb909c67b7983047637190598db7b7.tar.bz2
update localisation detection(Bug #17082)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/xxvd10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/xxvd b/bin/xxvd
index ba81a6a..ea2d3c5 100755
--- a/bin/xxvd
+++ b/bin/xxvd
@@ -42,7 +42,7 @@ $|++;
my $REV = (split(/ /, '$Revision$'))[1];
my $MODULES;
-my $VERSION = '1.6';
+my $VERSION = '1.6.1';
my $VDRVERSION = 0;
my $DBVERSION = 0;
my $CLEANUP;
@@ -479,10 +479,13 @@ sub init_locale {
# ------------------
my $paths = shift || return error('No path defined!');
+ my $lang = "C";
setlocale (LC_ALL, ''); #From environment like 'export LANG="fr_FR"';
my $current_locale = setlocale (LC_MESSAGES);
- debug sprintf('Current locale is set to %s', $current_locale);
+ $lang = (split(/\.|\@/, $current_locale))[0] if($current_locale);
+
+ debug sprintf('Current locale is set to %s (%s)', $current_locale, $lang);
my $charset;
# Check for environment with UTF-8
@@ -496,7 +499,8 @@ sub init_locale {
} else {
$charset = 'ISO-8859-1';
}
- setcharset($charset);
+
+ setcharset($charset, $lang);
# TODO set to installed folder like /usr/share/locale
# set /usr/share/locale/de/LC_MESSAGES/xxv.mo