Bug#844991: lightdm: does not offer C.UTF-8 locale

2016-11-19 Thread Daniel Shahaf
Package: lightdm
Version: 1.18.2-3
Severity: normal

Dear Maintainer,

tl;dr: The locales menu does not offer the "C" and "C.UTF-8" locales.

   * What led up to the situation?

I have the following locales installed:

% locale -a
C
C.UTF-8
POSIX
de_DE.utf8

The system default is:

% cat /etc/default/locale
LANG=C.UTF-8

   * What exactly did you do (or not do) that was effective (or
 ineffective)?
   * What was the outcome of this action?

The locale menu on the top right corner of the login screen offers one
choice: de_DE.utf8.  (The menu option is called "German - Germany".)

   * What outcome did you expect instead?

I expected the locales "C" and "C.UTF-8" to be offered in the drop-down
menu as well.

Cheers,

Daniel


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.8.0-1-amd64 (SMP w/1 CPU core)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages lightdm depends on:
ii  adduser3.115
ii  dbus   1.10.12-1
ii  debconf [debconf-2.0]  1.5.59
ii  libaudit1  1:2.6.7-1
ii  libc6  2.24-5
ii  libgcrypt201.7.3-2
ii  libglib2.0-0   2.50.2-1
ii  libpam-systemd 232-3
ii  libpam0g   1.1.8-3.3
ii  libxcb11.12-1
ii  libxdmcp6  1:1.1.2-1.1
ii  lightdm-gtk-greeter [lightdm-greeter]  2.0.2-1

Versions of packages lightdm recommends:
ii  xserver-xorg  1:7.7+16

Versions of packages lightdm suggests:
pn  accountsservice  
pn  upower   
pn  xserver-xephyr   

-- debconf information:
  lightdm/daemon_name: /usr/sbin/lightdm
* shared/default-x-display-manager: lightdm



Bug#844991: lightdm: does not offer C.UTF-8 locale

2017-01-22 Thread Piotr Engelking
The code includes a function to filter UTF-8 locales, but it is not always
used. The attached patch fixes the problem.
diff --git a/liblightdm-gobject/language.c b/liblightdm-gobject/language.c
index 91a4642..e640455 100644
--- a/liblightdm-gobject/language.c
+++ b/liblightdm-gobject/language.c
@@ -37,6 +37,12 @@ G_DEFINE_TYPE (LightDMLanguage, lightdm_language, G_TYPE_OBJECT);
 static gboolean have_languages = FALSE;
 static GList *languages = NULL;
 
+static gboolean
+is_utf8 (const gchar *code)
+{
+return g_strrstr (code, ".utf8") || g_strrstr (code, ".UTF-8");
+}
+
 static void
 update_languages (void)
 {
@@ -73,7 +79,7 @@ update_languages (void)
 continue;
 
 /* Ignore the non-interesting languages */
-if (strcmp (command, "locale -a") == 0 && !g_strrstr (code, ".utf8"))
+if (strcmp (command, "locale -a") == 0 && !is_utf8 (code))
 continue;
 
 language = g_object_new (LIGHTDM_TYPE_LANGUAGE, "code", code, NULL);
@@ -89,12 +95,6 @@ update_languages (void)
 have_languages = TRUE;
 }
 
-static gboolean
-is_utf8 (const gchar *code)
-{
-return g_strrstr (code, ".utf8") || g_strrstr (code, ".UTF-8");
-}
-
 /* Get a valid locale name that can be passed to setlocale(), so we always can use nl_langinfo() to get language and country names. */
 static gchar *
 get_locale_name (const gchar *code)
@@ -134,7 +134,7 @@ get_locale_name (const gchar *code)
 for (i = 0; avail_locales[i]; i++)
 {
 gchar *loc = avail_locales[i];
-if (!g_strrstr (loc, ".utf8"))
+if (!is_utf8 (loc))
 continue;
 if (g_str_has_prefix (loc, language))
 {


Bug#844991: [Pkg-xfce-devel] Bug#844991: lightdm: does not offer C.UTF-8 locale

2017-01-22 Thread Yves-Alexis Perez
On Sun, 2017-01-22 at 22:56 +0100, Piotr Engelking wrote:
> The code includes a function to filter UTF-8 locales, but it is not always
> used. The attached patch fixes the problem.

Thanks, can you push that upstream on launchpad.net?

Regards,
-- 
Yves-Alexis

signature.asc
Description: This is a digitally signed message part


Bug#844991: Fwd: [Pkg-xfce-devel] Bug#844991: lightdm: does not offer C.UTF-8 locale

2017-01-24 Thread Piotr Engelking
forwarded 844991 https://bugs.launchpad.net/lightdm/+bug/1658950
thanks

Yves-Alexis Perez :

> I don't think it's necessary, especially for a small patch.

Submitted, thank you.