diff options
author | Juan Pablo Ugarte <juanpablougarte@gmail.com> | 2020-10-05 20:34:21 -0300 |
---|---|---|
committer | Juan Pablo Ugarte <juanpablougarte@gmail.com> | 2020-10-05 20:34:21 -0300 |
commit | a5ac6a9a2a4b20eebefd7631508ed70aca185683 (patch) | |
tree | ddf90b7c4c5394ca58ceabe73839ae82700d1ba7 /gladeui | |
parent | 767f95329409717b05affc72b8230ff34522ac7a (diff) | |
download | glade-a5ac6a9a2a4b20eebefd7631508ed70aca185683.tar.gz |
GladeProperty: make i18n_translatable false by default
Only string properties should be translatable by default.
Fix issue #406 "AtkObject::accessible-role should not be translatable"
Diffstat (limited to 'gladeui')
-rw-r--r-- | gladeui/glade-property.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gladeui/glade-property.c b/gladeui/glade-property.c index 746c1a44..8875a57e 100644 --- a/gladeui/glade-property.c +++ b/gladeui/glade-property.c @@ -639,12 +639,22 @@ glade_property_init (GladeProperty *property) property->priv->precision = 2; property->priv->enabled = TRUE; property->priv->sensitive = TRUE; - property->priv->i18n_translatable = TRUE; + property->priv->i18n_translatable = FALSE; property->priv->i18n_comment = NULL; property->priv->sync_tolerance = 1; } static void +glade_property_constructed (GObject *object) +{ + GladeProperty *property = GLADE_PROPERTY (object); + GParamSpec *pspec = glade_property_def_get_pspec (property->priv->def); + + /* Only string properties are translatable */ + glade_property_i18n_set_translatable (property, G_IS_PARAM_SPEC_STRING (pspec)); +} + +static void glade_property_class_init (GladePropertyClass * prop_class) { GObjectClass *object_class = G_OBJECT_CLASS (prop_class); @@ -652,6 +662,7 @@ glade_property_class_init (GladePropertyClass * prop_class) /* GObjectClass */ object_class->set_property = glade_property_set_real_property; object_class->get_property = glade_property_get_real_property; + object_class->constructed = glade_property_constructed; object_class->finalize = glade_property_finalize; /* Class methods */ @@ -701,7 +712,7 @@ glade_property_class_init (GladePropertyClass * prop_class) g_param_spec_boolean ("i18n-translatable", _("Translatable"), _("Whether this property is translatable"), - TRUE, + FALSE, G_PARAM_READWRITE); properties[PROP_STATE] = @@ -773,8 +784,9 @@ glade_property_new (GladePropertyDef *def, g_return_val_if_fail (GLADE_IS_PROPERTY_DEF (def), NULL); - property = (GladeProperty *) g_object_new (GLADE_TYPE_PROPERTY, NULL); - property->priv->def = def; + property = (GladeProperty *) g_object_new (GLADE_TYPE_PROPERTY, + "class", def, + NULL); property->priv->widget = widget; property->priv->value = value; |