[gtk+] extract-strings: support GMenu GtkBuilder markup
- From: Ryan Lortie <desrt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] extract-strings: support GMenu GtkBuilder markup
- Date: Sat, 18 Jan 2014 03:45:11 +0000 (UTC)
commit 3f1a413d0c673e4bbe9a1785b0cd3a0cbb015ad3
Author: Ryan Lortie <desrt desrt ca>
Date: Wed Jan 15 01:35:43 2014 -0500
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
gtk/extract-strings.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gtk/extract-strings.c b/gtk/extract-strings.c
index df20d21..7592153 100644
--- a/gtk/extract-strings.c
+++ b/gtk/extract-strings.c
@@ -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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]