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))
             {

Reply via email to