summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorCorentin Noël <corentin@elementary.io>2019-09-11 19:16:41 +0000
committerAlberto Fanjul <albertofanjul@gmail.com>2019-09-11 19:16:41 +0000
commit61516306c7d9a3c4bdb2f0ed77d9e0dbf678508f (patch)
tree7724b261bbb784af10f2efb39b10b88d0b5e01da /plugins
parent4219ca120da77c0d9548483e5e1b62c4bdcbc85e (diff)
downloadglade-61516306c7d9a3c4bdb2f0ed77d9e0dbf678508f.tar.gz
gtk+: Keep internationalization context in Atk properties
Fixes https://gitlab.gnome.org/GNOME/glade/issues/356
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtk+/glade-gtk-widget.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/plugins/gtk+/glade-gtk-widget.c b/plugins/gtk+/glade-gtk-widget.c
index 9bcfcd82..23c68927 100644
--- a/plugins/gtk+/glade-gtk-widget.c
+++ b/plugins/gtk+/glade-gtk-widget.c
@@ -150,7 +150,7 @@ glade_gtk_parse_atk_props (GladeWidget *widget, GladeXmlNode *node)
GladeXmlNode *prop;
GladeProperty *property;
GValue *gvalue;
- gchar *value, *name, *id, *comment;
+ gchar *value, *name, *id, *context, *comment;
gint translatable;
gboolean is_action;
@@ -215,12 +215,15 @@ glade_gtk_parse_atk_props (GladeWidget *widget, GladeXmlNode *node)
/* Deal with i18n... ... XXX Do i18n context !!! */
translatable = glade_xml_get_property_boolean
(prop, GLADE_TAG_TRANSLATABLE, FALSE);
+ context = glade_xml_get_property_string (prop, GLADE_TAG_CONTEXT);
comment = glade_xml_get_property_string (prop, GLADE_TAG_COMMENT);
glade_property_i18n_set_translatable (property, translatable);
+ glade_property_i18n_set_context (property, context);
glade_property_i18n_set_comment (property, comment);
g_free (comment);
+ g_free (context);
g_free (value);
}
@@ -351,6 +354,7 @@ glade_gtk_widget_write_atk_property (GladeProperty *property,
{
GladePropertyDef *pdef = glade_property_get_def (property);
GladeXmlNode *prop_node = glade_xml_node_new (context, GLADE_TAG_A11Y_PROPERTY);
+ const gchar *comment, *context;
glade_xml_node_append_child (node, prop_node);
@@ -364,15 +368,17 @@ glade_gtk_widget_write_atk_property (GladeProperty *property,
GLADE_TAG_TRANSLATABLE,
GLADE_XML_TAG_I18N_TRUE);
- if (glade_property_i18n_get_comment (property))
+ comment = glade_property_i18n_get_comment (property);
+ if (comment)
glade_xml_node_set_property_string (prop_node,
GLADE_TAG_COMMENT,
- glade_property_i18n_get_comment (property));
+ comment);
- if (glade_property_i18n_get_context (property))
+ context = glade_property_i18n_get_context (property);
+ if (context)
glade_xml_node_set_property_string (prop_node,
GLADE_TAG_CONTEXT,
- glade_property_i18n_get_context (property));
+ context);
}
g_free (value);