diff options
author | Not Zed <NotZed@Ximian.com> | 2004-05-12 11:36:37 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-05-12 11:36:37 +0800 |
commit | 72dbc81f48008909473e67eb23e61e05ff4d8057 (patch) | |
tree | 7ae2ce7aabf1c82da3ff9f8de2284966f9edb6e0 /widgets/misc/e-error.c | |
parent | 97926d706a599a789b8d7b03a9e41a20513659d1 (diff) | |
download | gsoc2013-evolution-72dbc81f48008909473e67eb23e61e05ff4d8057.tar gsoc2013-evolution-72dbc81f48008909473e67eb23e61e05ff4d8057.tar.gz gsoc2013-evolution-72dbc81f48008909473e67eb23e61e05ff4d8057.tar.bz2 gsoc2013-evolution-72dbc81f48008909473e67eb23e61e05ff4d8057.tar.lz gsoc2013-evolution-72dbc81f48008909473e67eb23e61e05ff4d8057.tar.xz gsoc2013-evolution-72dbc81f48008909473e67eb23e61e05ff4d8057.tar.zst gsoc2013-evolution-72dbc81f48008909473e67eb23e61e05ff4d8057.zip |
make the Because cases the same.
2004-05-12 Not Zed <NotZed@Ximian.com>
* e-system-errors.xml: make the Because cases the same.
* e-system-errors.xml.h: add for translators.
* e-error.c (ee_load): just use _() to do i18n rather than the
nasty lang stuff.
(find_node): no longer needed.
* Makefile.am (%.xml.h): setup the build rules for the i18n file
for the errors.
* e-system-errors.xml.in: Removed, renamed to .xml and removed the
_ stuff.
svn path=/trunk/; revision=25871
Diffstat (limited to 'widgets/misc/e-error.c')
-rw-r--r-- | widgets/misc/e-error.c | 73 |
1 files changed, 16 insertions, 57 deletions
diff --git a/widgets/misc/e-error.c b/widgets/misc/e-error.c index a456802be4..0caceb37d1 100644 --- a/widgets/misc/e-error.c +++ b/widgets/misc/e-error.c @@ -133,44 +133,6 @@ map_type(const char *name) return 3; } -static const GList *lang_list; - -/* Finds the right node for the current language. */ -static xmlNodePtr -find_node(xmlNodePtr base, const char *name) -{ - const GList *l; - xmlNodePtr scan, langc=NULL; - - if (lang_list == NULL) - lang_list = gnome_i18n_get_language_list("LC_MESSAGES"); - - /* This is, like, way shitful, very slow, terribly inefficient ... sigh */ - for (l=lang_list;l;l=l->next) { - const char *lang = l->data; - - for (scan = base;scan;scan=scan->next) { - if (!strcmp(scan->name, name)) { - char *xmllang = xmlGetProp(scan, "xml:lang"); - - if (xmllang) { - if (!strcmp(xmllang, lang)) { - xmlFree(xmllang); - return scan; - } - xmlFree(xmllang); - } else { - langc = scan; - if (strcmp(lang, "C") == 0) - return scan; - } - } - } - } - - return langc; -} - /* XML format: @@ -254,26 +216,23 @@ ee_load(const char *path) xmlFree(tmp); } - node = find_node(error->children, "primary"); - if (node && (tmp = xmlNodeGetContent(node))) { - e->primary = g_strdup(tmp); - xmlFree(tmp); - } - - node = find_node(error->children, "secondary"); - if (node && (tmp = xmlNodeGetContent(node))) { - e->secondary = g_strdup(tmp); - xmlFree(tmp); - } - - node = find_node(error->children, "title"); - if (node && (tmp = xmlNodeGetContent(node))) { - e->title = g_strdup(tmp); - xmlFree(tmp); - } - for (scan = error->children;scan;scan=scan->next) { - if (!strcmp(scan->name, "button")) { + if (!strcmp(scan->name, "primary")) { + if ((tmp = xmlNodeGetContent(scan))) { + e->primary = g_strdup(_(tmp)); + xmlFree(tmp); + } + } else if (!strcmp(scan->name, "secondary")) { + if ((tmp = xmlNodeGetContent(node))) { + e->secondary = g_strdup(_(tmp)); + xmlFree(tmp); + } + } else if (!strcmp(scan->name, "title")) { + if ((tmp = xmlNodeGetContent(node))) { + e->title = g_strdup(_(tmp)); + xmlFree(tmp); + } + } else if (!strcmp(scan->name, "button")) { struct _e_error_button *b; b = g_malloc0(sizeof(*b)); |