Commit 3f1a413d authored by Allison Karlitskaya's avatar Allison Karlitskaya

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
parent 6da7b11f
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment