diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2011-04-17 16:33:15 +0200 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2011-04-17 16:33:15 +0200 |
commit | 8a36c615d96647ba1938ba760a94f3d8c2ab066a (patch) | |
tree | 3a27da7fe1f51d29a27af43a6ae6d0d84faf7049 /src/lib | |
parent | 7d2c5f5e1c0dac12f9de39525dd435374dee6a24 (diff) | |
download | abrt-8a36c615d96647ba1938ba760a94f3d8c2ab066a.tar.gz abrt-8a36c615d96647ba1938ba760a94f3d8c2ab066a.tar.xz abrt-8a36c615d96647ba1938ba760a94f3d8c2ab066a.zip |
make <name> in event xml description translatable
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/event_xml_parser.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/lib/event_xml_parser.c b/src/lib/event_xml_parser.c index 859e8951..00c3cba2 100644 --- a/src/lib/event_xml_parser.c +++ b/src/lib/event_xml_parser.c @@ -180,6 +180,7 @@ static void start_element(GMarkupParseContext *context, if (strcmp(element_name, LABEL_ELEMENT) == 0 || strcmp(element_name, DESCRIPTION_ELEMENT) == 0 || strcmp(element_name, LONG_DESCR_ELEMENT) == 0 + || strcmp(element_name, NAME_ELEMENT) == 0 ) { free(parse_data->attribute_lang); parse_data->attribute_lang = get_element_lang(parse_data, attribute_names, attribute_values); @@ -225,7 +226,6 @@ static void text(GMarkupParseContext *context, { if (strcmp(inner_element, LABEL_ELEMENT) == 0) { - VERB2 log("new label:'%s'", 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 @@ -234,6 +234,7 @@ static void text(GMarkupParseContext *context, if (parse_data->attribute_lang[0] != '\0' || !opt->eo_label /* && parse_data->attribute_lang is "" - always true */ ) { + VERB2 log("new label:'%s'", text_copy); free(opt->eo_label); opt->eo_label = text_copy; } @@ -292,9 +293,19 @@ static void text(GMarkupParseContext *context, */ if (strcmp(inner_element, NAME_ELEMENT) == 0) { - VERB2 log("event name:'%s'", text_copy); - free(ui->screen_name); - ui->screen_name = 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' + || !ui->screen_name /* && parse_data->attribute_lang is "" - always true */ + ) { + VERB2 log("event name:'%s'", text_copy); + free(ui->screen_name); + ui->screen_name = text_copy; + } + } return; } if (strcmp(inner_element, DESCRIPTION_ELEMENT) == 0) |