extract-strings: support GMenu GtkBuilder markup
Add support for extracting strings from GMenu markup in GtkBuilder files. This means that we have to support translatable <attribute/> tags. Unfortunately, <attribute> is also used by GtkTreeViewColumn and GtkLabel for other purposes, and those other purposes use a value='' (XML) attribute, so we must accept (and ignore) that in order not to have errors. Nothing will happen in those cases because they do not also specify translatable='yes', so we ignore them. https://bugzilla.gnome.org/show_bug.cgi?id=720552
This commit is contained in:
@ -36,6 +36,7 @@ start_element_handler (GMarkupParseContext *contexts,
|
||||
ParserData *data = user_data;
|
||||
|
||||
if (g_str_equal (element_name, "property") ||
|
||||
g_str_equal (element_name, "attribute") ||
|
||||
g_str_equal (element_name, "item"))
|
||||
{
|
||||
gboolean translatable;
|
||||
@ -47,6 +48,7 @@ start_element_handler (GMarkupParseContext *contexts,
|
||||
attribute_values,
|
||||
error,
|
||||
G_MARKUP_COLLECT_STRING|G_MARKUP_COLLECT_OPTIONAL, "name", NULL,
|
||||
G_MARKUP_COLLECT_STRING|G_MARKUP_COLLECT_OPTIONAL, "value", NULL,
|
||||
G_MARKUP_COLLECT_TRISTATE, "translatable", &translatable,
|
||||
G_MARKUP_COLLECT_STRDUP|G_MARKUP_COLLECT_OPTIONAL, "context", &context,
|
||||
G_MARKUP_COLLECT_STRDUP|G_MARKUP_COLLECT_OPTIONAL, "comments", &comments,
|
||||
|
Reference in New Issue
Block a user