summaryrefslogtreecommitdiffstats
path: root/src/lib/event_xml_parser.c
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2011-04-17 16:50:22 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2011-04-17 16:50:22 +0200
commit2e1c4aa678a0191c011daef206e72016f94d1dc1 (patch)
tree5b5da369c8ef1cb6c6334455d013c50e4fff7e92 /src/lib/event_xml_parser.c
parent73ee24ffefa6bd11789217a92f4cd842323f547f (diff)
downloadabrt-2e1c4aa678a0191c011daef206e72016f94d1dc1.tar.gz
abrt-2e1c4aa678a0191c011daef206e72016f94d1dc1.tar.xz
abrt-2e1c4aa678a0191c011daef206e72016f94d1dc1.zip
make <note-html> translatable
Diffstat (limited to 'src/lib/event_xml_parser.c')
-rw-r--r--src/lib/event_xml_parser.c17
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;
}