[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#499694: localization-config: creation of '/etc/kde3/system.kdeglobals' conffile makes kpersonalizer appear



Package: localization-config
Version: 1.03
Severity: important
Tags: patch

When running update-locale-config the config file
'/etc/kde3/system.kdeglobals' is created. In this file the country and
language as well as the preferred encoding is configured.

Nowadays KDE find the correct values using the configured locale and
configuring explicitly via '/etc/kde3/system.kdeglobals' just makes
kpersonalizer popup on first login to KDE.

It also configures the charset to use, which is in (almost) all cases
non unicode. The charset configured is also not depending on the
encoding part of the locale supplied when calling update-locale-config
(e.g. not UTF-8 for de_DE.UTF-8). As Debian has switched to default to
unicode before etch release I think this make this bug important.

We currently test a modified version of localization-config in Debian
Edu including the attached patch. If problems caused by this patch show
up I'll report here.

Greetings

Daniel

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages localization-config depends on:
ii  debconf [debconf-2.0]         1.5.22     Debian configuration management sy
ii  libapt-pkg-perl               0.1.22+b1  Perl interface to libapt-pkg
ii  libconfig-inifiles-perl       2.39-5     Read .ini-style configuration file
ii  locales                       2.7-13     GNU C Library: National Language (
ii  perl-base                     5.10.0-13  minimal Perl system

localization-config recommends no packages.

localization-config suggests no packages.

-- debconf information:
  base-config/menu/localization-config-preinst:
  base-config/menu/localization-config-postinst:
diff -Nur localization-config-1.03.orig/conffiles.d/kde.postinst localization-config-1.03/conffiles.d/kde.postinst
--- localization-config-1.03.orig/conffiles.d/kde.postinst	2007-05-06 05:32:08.000000000 +0200
+++ localization-config-1.03/conffiles.d/kde.postinst	2008-09-21 12:32:44.000000000 +0200
@@ -19,6 +19,7 @@
 my %vermap = ( '2.2.2-14.7',     => { RELEASE => 'woody' },
                '4:3.2.2-1',      => { RELEASE => 'sarge' },
                '3.5.5a.dfsg.1-6',=> { RELEASE => 'etch' },
+               '4:3.5.9.dfsg.1-5',=> { RELEASE => 'lenny' },
               );
 
 # Get lang entry
diff -Nur localization-config-1.03.orig/conffiles.d/lenny/kde localization-config-1.03/conffiles.d/lenny/kde
--- localization-config-1.03.orig/conffiles.d/lenny/kde	1970-01-01 01:00:00.000000000 +0100
+++ localization-config-1.03/conffiles.d/lenny/kde	2008-09-21 12:32:44.000000000 +0200
@@ -0,0 +1,206 @@
+#!/usr/bin/perl
+# This script configures KDE 3
+use strict;
+use warnings;
+
+# We use postconfig() helper subroutine so we have to include
+# its definition
+require '/usr/lib/localization-config/common/postconfig.pl';
+require '/usr/lib/localization-config/common/langmap.pl';
+require '/usr/lib/localization-config/common/log.pl';
+
+# If no locale is given as argument, quit
+my $lang = $ARGV[0] or log_die("$0: No language given");
+
+# The config filenames 
+# KDM does not honour the global KDE settings,
+# we need to edit kdmrc too
+my $global = '/etc/kde3/system.kdeglobals';
+my $kdmrc = '/etc/kde3/kdm/kdmrc';
+
+# These are X settings -> see /usr/X11R6/lib/locale for charset names
+my %lang_map = (
+        #entries sorted alphabetically
+        'Australian'    => { 'Locale/Country' => 'au',
+                           'Locale/Language' => 'en',
+                           'Locale/Charset'  => 'iso8859-1',
+                        },
+        'American (US)' => { 'Locale/Country' => 'us',
+                           'Locale/Language' => 'en',
+                           'Locale/Charset'  => 'iso8859-1',
+                         },
+        'Bosnian'       => { 'Locale/Country'  => 'ba',
+                                'Locale/Language' => 'bs_BA',
+                                'Locale/Charset'  => 'iso8859-2',
+                         },
+        'Brazilian'     => { 'Locale/Country' => 'br',
+                           'Locale/Language' => 'pt_BR',
+                           'Locale/Charset' => 'iso8859-1',
+                         },
+        'Canadian'      => { 'Locale/Country' => 'ca',
+                           'Locale/Language' => 'en',
+                           'Locale/Charset'  => 'iso8859-1',
+                         },
+        'Catalan'       => { 'Locale/Country'  => 'es',
+                           'Locale/Language' => 'ca_ES',
+                           'Locale/Charset'  => 'iso8859-15',
+                         },
+        'Danish'        => { 'Locale/Country'   => 'dk',
+                           'Locale/Language' => 'da_DK',
+                           'Locale/Charset' => 'iso8859-1',
+                         },
+        'Dutch (BE)'    => { 'Locale/Country' => 'be',
+                           'Locale/Language' => 'nl_BE',
+                           'Locale/Charset'  => 'iso8859-15',
+                         },
+        'Dutch'         => { 'Locale/Country'   => 'nl',
+                           'Locale/Language'  => 'nl_NL',
+                           'Locale/Charset'   => 'iso8859-15',
+                         },
+        'German (BE)'   => { 'Locale/Country' => 'be',
+                           'Locale/Language' => 'de_BE',
+                           'Locale/Charset'  => 'iso8859-15',
+                         },   
+        'German (DE)'        => { 'Locale/Country' => 'de',
+                           'Locale/Language' => 'de',
+                           'Locale/Charset'  => 'iso8859-15',
+                         },
+        'Greek'         => { 'Locale/Country' => 'gr',
+                           'Locale/Language' => 'el',
+                           'Locale/Charset'  => 'iso10646-1',
+                           'General/StandardFont' => 'MgOpen Modata,12,-1,5,50,0,0,0,0,0',
+                           'General/activeFont'   => 'MgOpen Modata,12,-1,5,75,0,0,0,0,0',
+                           'General/fixed'        => 'courier,12,-1,5,50,0,0,0,0,0',
+                           'General/font'         => 'MgOpen Modata,12,-1,5,50,0,0,0,0,0',
+                           'General/menuFont'     => 'MgOpen Modata,12,-1,5,50,0,0,0,0,0',
+                           'General/taskbarFont'  => 'MgOpen Modata,11,-1,5,50,0,0,0,0,0',
+                           'General/toolBarFont'  => 'MgOpen Modata,10,-1,5,50,0,0,0,0,0',
+                         },
+	'Hebrew'        => { 'Locale/Country' => 'il',
+	                     'Locale/Language' => 'he_IL',
+			     'Locale/Charset' => 'iso-8859-8',
+			 },
+        'Irish (UK)'    => { 'Locale/Country' => 'ie',
+                           'Locale/Language' => 'en',
+                           'Locale/Charset'  => 'iso8859-15',
+                         },
+        'Spanish'       => { 'Locale/Country' => 'es',
+                           'Locale/Language' => 'es_ES',
+                           'Locale/Charset'  => 'iso8859-15',
+                         },
+        'Spanish (AR)'  => { 'Locale/Country' => 'ar',
+                           'Locale/Language' => 'es_AR',
+                           'Locale/Charset'  => 'iso8859-1',
+                        },
+        'Spanish (MX)'  => { 'Locale/Country' => 'mx',
+                           'Locale/Language' => 'es_MX',
+                           'Locale/Charset' => 'iso8859-15',
+                         },
+        'Spanish (PE)'  => { 'Locale/Country' => 'pe',
+                           'Locale/Language' => 'es_PE',
+                           'Locale/Charset' => 'iso8859-1',
+                         },
+        'Finnish'       => { 'Locale/Country' => 'fi',
+                           'Locale/Language' => 'fi_FI@euro',
+                           'Locale/Charset' => 'iso8859-15',
+                         },
+        'French (BE)'    => { 'Locale/Country' => 'be',
+                           'Locale/Language' => 'fr_BE',
+                           'Locale/Charset'  => 'iso8859-15',
+                         },
+        'French (CA)'   => { 'Locale/Country' => 'ca',
+                           'Locale/Language' => 'fr',
+                           'Locale/Charset'  => 'iso8859-1',
+                         },
+        'French'        => { 'Locale/Country' => 'fr',
+                           'Locale/Language' => 'fr_FR',
+                           'Locale/Charset'  => 'iso8859-15',
+                          },
+        'Italian'       => { 'Locale/Country'   => 'it',
+                           'Locale/Language' => 'it_IT',
+                           'Locale/Charset' => 'iso8859-15',
+                         },
+        'Japanese'      => { 'Locale/Country'   => 'jp',
+                           'Locale/Language' => 'ja_JP',
+                           'Locale/Charset' => 'EUC-JP',
+                         },
+        'Latvian'       => { 'Locale/Country'   => 'lv',
+                           'Locale/Language'  => 'lv',
+                           'Locale/Charset'   => 'iso8859-13',
+                         },
+        'Korean'        => { 'Locale/Country'   => 'kr',
+                           'Locale/Language'  => 'ko',
+                           'Locale/Charset' => 'EUC-KR',
+                         },
+        'Norwegian'     => { 'Locale/Country'   => 'no', # no_NO and nb_NO is the same
+                           'Locale/Language'  => 'nb',
+                           'Locale/Charset' => 'iso8859-1',
+                         },
+        'New Norwegian' => { 'Locale/Country'   => 'no',
+                           'Locale/Language'  => 'nn',
+                           'Locale/Charset' => 'iso8859-1',
+                         },
+        'Polish'        => { 'Locale/Country' => 'pl',
+                           'Locale/Language' => 'pl_PL',
+                           'Locale/Charset' => 'iso8859-2',
+                         },
+        'Saami'         => { 'Locale/Country'   => 'no',
+                           'Locale/Language'  => 'se',
+                           'Locale/Charset'  => 'iso10646-1',
+                         },
+#       'sv_SE'       => { 'Locale/Country'  => 'se',
+#                          'Locale/Language' => 'sv',
+#                          'Locale/Charset'  => '',
+#                        },
+        'Turkish'       => { 'Locale/Country' => 'tr',
+                           'Locale/Language' => 'tr_TR',
+                           'Locale/Charset' => 'iso8859-9'
+			 },
+             );
+
+my %lang_locale_map = get_lang_map();
+my $language = choose_language($lang, \%lang_locale_map);
+log_msg("$0: Language: $language");
+            
+# We construct a similar associative array for use with kdmrc.
+# We copy only the values ''Locale/Language'' from the %lang_map
+my %kdmlang_map;
+for my $lang (sort keys %lang_map) {
+    $kdmlang_map{'X-*-Greeter/Language'} = $lang_map{$language}{'Locale/Language'};
+}
+
+for my $key (sort keys %kdmlang_map) {
+    if (defined($kdmlang_map{$key})) {
+        log_msg("$0: ".$key.":".$kdmlang_map{$key});
+    }
+}
+
+# Print the supported locale entries.
+if ("supported" eq $lang) {
+    for $lang (sort keys %lang_map) {
+        print "$lang\n";
+    }
+    exit 0;
+}
+
+## Not needed for lenny as correct settings are chosen automatically
+# Call postconfig() with the appropriate locale/keyboard pair
+#if(defined(my $conf = $lang_map{$language})) {
+#    for my $key (sort keys %$conf) {
+#        log_msg("$0: ".$key.":".$conf->{$key});
+#    }
+#    postconfig('true', $global, $conf);
+#} else {
+#    log_msg("$0: No support for language $lang");
+#    exit;
+#}
+
+# And once more for KDM, but only if it exists
+if (-e $kdmrc ) {
+    if (defined($kdmlang_map{'X-*-Greeter/Language'})) {
+        postconfig('false', $kdmrc, \%kdmlang_map);
+    }
+} else { 
+  log_msg("$0: $kdmrc does not exist");
+  exit;
+}

Attachment: signature.asc
Description: Digital signature


Reply to: