From 2e1c4aa678a0191c011daef206e72016f94d1dc1 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Sun, 17 Apr 2011 16:50:22 +0200 Subject: make translatable --- src/lib/event_xml_parser.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/event_xml_parser.c b/src/lib/event_xml_parser.c index 00c3cba2..17e8a72e 100644 --- a/src/lib/event_xml_parser.c +++ b/src/lib/event_xml_parser.c @@ -181,6 +181,7 @@ static void start_element(GMarkupParseContext *context, || strcmp(element_name, DESCRIPTION_ELEMENT) == 0 || strcmp(element_name, LONG_DESCR_ELEMENT) == 0 || strcmp(element_name, NAME_ELEMENT) == 0 + || strcmp(element_name, NOTE_HTML_ELEMENT) == 0 ) { free(parse_data->attribute_lang); parse_data->attribute_lang = get_element_lang(parse_data, attribute_names, attribute_values); @@ -257,9 +258,19 @@ static void text(GMarkupParseContext *context, if (strcmp(inner_element, NOTE_HTML_ELEMENT) == 0) { - VERB2 log("html note:'%s'", text_copy); - free(opt->eo_note_html); - opt->eo_note_html = text_copy; + if (parse_data->attribute_lang != NULL) /* if it isn't for other locale */ + { + /* set the value only if we found a value for the current locale + * OR the label is still not set and we found the default value + */ + if (parse_data->attribute_lang[0] != '\0' + || !opt->eo_note_html /* && parse_data->attribute_lang is "" - always true */ + ) { + VERB2 log("html note:'%s'", text_copy); + free(opt->eo_note_html); + opt->eo_note_html = text_copy; + } + } return; } -- cgit