improve rendering of languages

This commit is contained in:
Matthias Clasen 2008-07-10 16:00:26 +00:00
parent ecc120f517
commit e9fd0ebb37
2 changed files with 73 additions and 1 deletions

View File

@ -15,7 +15,7 @@
Summary: The GNOME Display Manager
Name: gdm
Version: 2.22.0
Release: 9%{?dist}
Release: 10%{?dist}
Epoch: 1
License: GPLv2+
Group: User Interface/X
@ -85,8 +85,12 @@ Patch3: show-users.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=446672
Patch4: gdm-2.22.0-enable-tcp.patch
# fixed in upstream svn
Patch9: gdm-null-fs.patch
# fixed in upstream svn
Patch10: lang-tag.patch
# Fedora-specific
Patch99: gdm-2.21.8-fedora-logo.patch
@ -112,6 +116,7 @@ multiple simulanteous logged in users.
%patch3 -p1 -b .show-users
%patch4 -p1 -b .enable-tcp
%patch9 -p1 -b .null-fs
%patch10 -p1 -b .lang-tag
%patch99 -p1 -b .fedora-logo
autoreconf
@ -311,6 +316,9 @@ fi
%{_datadir}/gnome-2.0/ui/GNOME_FastUserSwitchApplet.xml
%changelog
* Thu Jul 10 2008 Matthias Clasen <mclasen@redhat.com> - 1:2.22.0-10
- Improve rendering of languages
* Thu Jul 3 2008 Jon McCann <jmccann@redhat.com> - 1:2.22.0-9
- Check for a null filesystem type

64
lang-tag.patch Normal file
View File

@ -0,0 +1,64 @@
diff -up gdm-2.22.0/gui/simple-greeter/gdm-language-chooser-widget.c.lang-tag gdm-2.22.0/gui/simple-greeter/gdm-language-chooser-widget.c
--- gdm-2.22.0/gui/simple-greeter/gdm-language-chooser-widget.c.lang-tag 2008-07-10 01:10:23.000000000 -0400
+++ gdm-2.22.0/gui/simple-greeter/gdm-language-chooser-widget.c 2008-07-10 01:10:28.000000000 -0400
@@ -103,24 +103,30 @@ gdm_language_chooser_widget_add_language
char *language;
char *normalized_name;
char *readable_language;
+ char *lang_tag;
+ char *tagged;
normalized_name = gdm_normalize_language_name (name);
+ gdm_parse_language_name (name, &lang_tag, NULL, NULL, NULL);
language = gdm_get_language_from_name (normalized_name, normalized_name);
readable_language = gdm_get_language_from_name (normalized_name, NULL);
+ tagged = g_strdup_printf ("<span lang=\"%s\">%s</span>", lang_tag, language);
+
if (language != NULL) {
gdm_chooser_widget_add_item (GDM_CHOOSER_WIDGET (widget),
normalized_name,
NULL,
- language,
- readable_language,
+ tagged,
+ readable_language,
0,
FALSE,
FALSE);
g_free (language);
}
g_free (readable_language);
-
+ g_free (tagged);
+ g_free (lang_tag);
g_free (normalized_name);
}
diff -up gdm-2.22.0/gui/simple-greeter/gdm-language-option-widget.c.lang-tag gdm-2.22.0/gui/simple-greeter/gdm-language-option-widget.c
--- gdm-2.22.0/gui/simple-greeter/gdm-language-option-widget.c.lang-tag 2008-07-10 11:42:07.000000000 -0400
+++ gdm-2.22.0/gui/simple-greeter/gdm-language-option-widget.c 2008-07-10 11:42:24.000000000 -0400
@@ -146,6 +146,7 @@ gdm_language_option_widget_lookup_item (
{
char *language;
char *readable_language;
+ char *lang_tag;
language = gdm_get_language_from_name (locale, locale);
@@ -154,10 +155,13 @@ gdm_language_option_widget_lookup_item (
}
readable_language = gdm_get_language_from_name (locale, NULL);
-
- *name = language;
+ gdm_parse_language_name (locale, &lang_tag, NULL, NULL, NULL);
+ *name = g_strdup_printf ("<span lang=\"%s\">%s</span>", lang_tag, language);
*comment = readable_language;
+ g_free (language);
+ g_free (lang_tag);
+
return TRUE;
}