Load translated XML description elements if available
2005-01-08 Thomas Wood <thos@gnome.org> * gnome-wp-xml.c (gnome_wp_xml_load_xml): Load translated XML description elements if available Fixes #160700
This commit is contained in:
parent
bbf89d121b
commit
35037d76ec
2 changed files with 25 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2005-01-08 Thomas Wood <thos@gnome.org>
|
||||||
|
|
||||||
|
* gnome-wp-xml.c (gnome_wp_xml_load_xml): Load translated XML
|
||||||
|
description elements if available
|
||||||
|
|
||||||
|
Fixes #160700
|
||||||
|
|
||||||
2005-01-08 Rodney Dawes <dobey@novell.com>
|
2005-01-08 Rodney Dawes <dobey@novell.com>
|
||||||
|
|
||||||
* gnome-wp-capplet.c (wallpaper_properties_init): Fix the leaks
|
* gnome-wp-capplet.c (wallpaper_properties_init): Fix the leaks
|
||||||
|
|
|
@ -94,8 +94,13 @@ static void gnome_wp_xml_load_xml (GnomeWPCapplet * capplet,
|
||||||
const gchar * filename) {
|
const gchar * filename) {
|
||||||
xmlDoc * wplist;
|
xmlDoc * wplist;
|
||||||
xmlNode * root, * list, * wpa;
|
xmlNode * root, * list, * wpa;
|
||||||
|
gchar * nodelang;
|
||||||
|
const gchar ** syslangs;
|
||||||
GdkColor color1, color2;
|
GdkColor color1, color2;
|
||||||
GnomeWPItem * item;
|
GnomeWPItem * item;
|
||||||
|
gint i;
|
||||||
|
|
||||||
|
syslangs = g_get_language_names ();
|
||||||
|
|
||||||
wplist = xmlParseFile (filename);
|
wplist = xmlParseFile (filename);
|
||||||
|
|
||||||
|
@ -118,7 +123,19 @@ static void gnome_wp_xml_load_xml (GnomeWPCapplet * capplet,
|
||||||
}
|
}
|
||||||
} else if (!strcmp (wpa->name, "name")) {
|
} else if (!strcmp (wpa->name, "name")) {
|
||||||
if (wpa->last != NULL) {
|
if (wpa->last != NULL) {
|
||||||
wp->name = g_strdup (g_strstrip (wpa->last->content));
|
nodelang = xmlNodeGetLang (wpa->last);
|
||||||
|
|
||||||
|
if (wp->name == NULL && nodelang == NULL) {
|
||||||
|
wp->name = g_strdup (g_strstrip (wpa->last->content));
|
||||||
|
} else {
|
||||||
|
for (i = 0; syslangs[i] != NULL; i++) {
|
||||||
|
if (!strcmp (syslangs[i], nodelang)) {
|
||||||
|
wp->name = g_strdup (g_strstrip (wpa->last->content));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
xmlFree (nodelang);
|
||||||
}
|
}
|
||||||
} else if (!strcmp (wpa->name, "imguri")) {
|
} else if (!strcmp (wpa->name, "imguri")) {
|
||||||
if (wpa->last != NULL) {
|
if (wpa->last != NULL) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue