diff options
Diffstat (limited to 'src/lib/event_xml_parser.c')
| -rw-r--r-- | src/lib/event_xml_parser.c | 17 |
1 files changed, 14 insertions, 3 deletions
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; } |
