|
|
d3c1b09 |
--- gdm-2.17.8/gui/gdmcommon.h.hide-uninstalled-languages 2007-03-09 12:30:58.000000000 -0500
|
|
|
d3c1b09 |
+++ gdm-2.17.8/gui/gdmcommon.h 2007-03-09 12:31:59.000000000 -0500
|
|
|
d3c1b09 |
@@ -67,5 +67,5 @@
|
|
|
d3c1b09 |
void gdm_common_atspi_launch (void);
|
|
|
d3c1b09 |
gchar* gdm_common_expand_text (const gchar *text);
|
|
|
d3c1b09 |
gchar* gdm_common_get_clock (struct tm **the_tm);
|
|
|
d3c1b09 |
-
|
|
|
d3c1b09 |
+gboolean gdm_common_locale_is_displayable (const gchar *locale);
|
|
|
d3c1b09 |
#endif /* GDM_COMMON_H */
|
|
|
7c71c5e |
--- gdm-2.17.8/gui/gdmlogin.c.hide-uninstalled-languages 2007-03-09 12:22:36.000000000 -0500
|
|
|
7c71c5e |
+++ gdm-2.17.8/gui/gdmlogin.c 2007-03-09 12:22:39.000000000 -0500
|
|
|
7c71c5e |
@@ -1192,6 +1192,11 @@
|
|
|
7c71c5e |
|
|
|
7c71c5e |
li->data = NULL;
|
|
|
7c71c5e |
|
|
|
7c71c5e |
+ if (!gdm_common_locale_is_displayable (lang)) {
|
|
|
7c71c5e |
+ g_free (lang);
|
|
|
7c71c5e |
+ continue;
|
|
|
7c71c5e |
+ }
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
group = name = gdm_lang_name (lang,
|
|
|
7c71c5e |
FALSE /* never_encoding */,
|
|
|
7c71c5e |
FALSE /* no_group */,
|
|
|
7c71c5e |
@@ -1202,6 +1207,8 @@
|
|
|
7c71c5e |
continue;
|
|
|
7c71c5e |
}
|
|
|
7c71c5e |
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
untranslated = gdm_lang_untranslated_name (lang,
|
|
|
7c71c5e |
TRUE /* markup */);
|
|
|
7c71c5e |
|
|
|
7c71c5e |
--- gdm-2.17.8/gui/gdmcommon.c.hide-uninstalled-languages 2007-02-26 03:59:31.000000000 -0500
|
|
|
7c71c5e |
+++ gdm-2.17.8/gui/gdmcommon.c 2007-03-09 12:21:29.000000000 -0500
|
|
|
7c71c5e |
@@ -33,6 +33,8 @@
|
|
|
7c71c5e |
#include <sys/types.h>
|
|
|
7c71c5e |
#include <signal.h>
|
|
|
7c71c5e |
|
|
|
7c71c5e |
+#include <fontconfig/fontconfig.h>
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
#include <glib/gi18n.h>
|
|
|
7c71c5e |
#include <gdk/gdkx.h>
|
|
|
7c71c5e |
#include <gtk/gtk.h>
|
|
|
7c71c5e |
@@ -843,3 +845,95 @@
|
|
|
7c71c5e |
return g_string_free (str, FALSE);
|
|
|
7c71c5e |
}
|
|
|
7c71c5e |
|
|
|
7c71c5e |
+typedef enum
|
|
|
7c71c5e |
+{
|
|
|
7c71c5e |
+ LOCALE_UP_TO_LANGUAGE = 0,
|
|
|
7c71c5e |
+ LOCALE_UP_TO_COUNTRY,
|
|
|
7c71c5e |
+ LOCALE_UP_TO_ENCODING,
|
|
|
7c71c5e |
+ LOCALE_UP_TO_MODIFIER,
|
|
|
7c71c5e |
+} LocaleScope;
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+static char *
|
|
|
7c71c5e |
+get_less_specific_locale (const char *locale,
|
|
|
7c71c5e |
+ LocaleScope scope)
|
|
|
7c71c5e |
+{
|
|
|
7c71c5e |
+ char *generalized_locale;
|
|
|
7c71c5e |
+ char *end;
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ generalized_locale = strdup (locale);
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ end = strchr (generalized_locale, '_');
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ if (end != NULL && scope <= LOCALE_UP_TO_LANGUAGE)
|
|
|
7c71c5e |
+ {
|
|
|
7c71c5e |
+ *end = '\0';
|
|
|
7c71c5e |
+ return generalized_locale;
|
|
|
7c71c5e |
+ }
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ end = strchr (generalized_locale, '.');
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ if (end != NULL && scope <= LOCALE_UP_TO_COUNTRY)
|
|
|
7c71c5e |
+ {
|
|
|
7c71c5e |
+ *end = '\0';
|
|
|
7c71c5e |
+ return generalized_locale;
|
|
|
7c71c5e |
+ }
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ end = strchr (generalized_locale, '@');
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ if (end != NULL && scope <= LOCALE_UP_TO_ENCODING)
|
|
|
7c71c5e |
+ {
|
|
|
7c71c5e |
+ *end = '\0';
|
|
|
7c71c5e |
+ return generalized_locale;
|
|
|
7c71c5e |
+ }
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ return generalized_locale;
|
|
|
7c71c5e |
+}
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+gboolean
|
|
|
7c71c5e |
+gdm_common_locale_is_displayable (const gchar *locale)
|
|
|
7c71c5e |
+{
|
|
|
7c71c5e |
+ char *language_code;
|
|
|
7c71c5e |
+ gboolean is_displayable;
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ FcPattern *pattern;
|
|
|
7c71c5e |
+ FcObjectSet *object_set;
|
|
|
7c71c5e |
+ FcFontSet *font_set;
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ is_displayable = FALSE;
|
|
|
7c71c5e |
+ pattern = NULL;
|
|
|
7c71c5e |
+ object_set = NULL;
|
|
|
7c71c5e |
+ font_set = NULL;
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ language_code = get_less_specific_locale (locale, LOCALE_UP_TO_LANGUAGE);
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ pattern = FcPatternBuild (NULL, FC_LANG, FcTypeString, language_code, NULL);
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ if (pattern == NULL)
|
|
|
7c71c5e |
+ goto done;
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ object_set = FcObjectSetBuild (NULL, NULL);
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ if (object_set == NULL)
|
|
|
7c71c5e |
+ goto done;
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ font_set = FcFontList (NULL, pattern, object_set);
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ if (font_set == NULL)
|
|
|
7c71c5e |
+ goto done;
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ is_displayable = (font_set->nfont > 0);
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+done:
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ if (font_set != NULL)
|
|
|
7c71c5e |
+ FcFontSetDestroy (font_set);
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ if (object_set != NULL)
|
|
|
7c71c5e |
+ FcObjectSetDestroy (object_set);
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ if (pattern != NULL)
|
|
|
7c71c5e |
+ FcPatternDestroy (pattern);
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
+ g_free (language_code);
|
|
|
7c71c5e |
+ return is_displayable;
|
|
|
7c71c5e |
+}
|
|
|
7c71c5e |
--- gdm-2.17.8/gui/greeter/greeter_action_language.c.hide-uninstalled-languages 2007-02-26 03:59:30.000000000 -0500
|
|
|
d3c1b09 |
+++ gdm-2.17.8/gui/greeter/greeter_action_language.c 2007-03-09 12:37:17.000000000 -0500
|
|
|
7c71c5e |
@@ -86,6 +86,11 @@
|
|
|
7c71c5e |
|
|
|
7c71c5e |
li->data = NULL;
|
|
|
7c71c5e |
|
|
|
d3c1b09 |
+ if (!gdm_common_locale_is_displayable (lang)) {
|
|
|
7c71c5e |
+ g_free (lang);
|
|
|
7c71c5e |
+ continue;
|
|
|
7c71c5e |
+ }
|
|
|
7c71c5e |
+
|
|
|
7c71c5e |
name = gdm_lang_name (lang,
|
|
|
7c71c5e |
FALSE /* never_encoding */,
|
|
|
7c71c5e |
TRUE /* no_group */,
|