summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/lib/elm_interface_atspi_accessible.c
diff options
context:
space:
mode:
authorLukasz Stanislawski <l.stanislaws@samsung.com>2015-10-02 17:04:38 +0200
committerLukasz Stanislawski <lukasz.stanislawski@gmail.com>2015-10-02 21:56:14 +0200
commitd1ec64205d88a01060a27cc4133f4c547909dc1a (patch)
tree207be4fadfbfcbcb8ea1bca70f2e4b8f3d2c8e5f /legacy/elementary/src/lib/elm_interface_atspi_accessible.c
parent61845ef60012f959533d87b275b0b6c7b3647572 (diff)
atspi: add translation domain for name and description.
@feature
Diffstat (limited to '')
-rw-r--r--legacy/elementary/src/lib/elm_interface_atspi_accessible.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/legacy/elementary/src/lib/elm_interface_atspi_accessible.c b/legacy/elementary/src/lib/elm_interface_atspi_accessible.c
index 483a35f501..709d142ff0 100644
--- a/legacy/elementary/src/lib/elm_interface_atspi_accessible.c
+++ b/legacy/elementary/src/lib/elm_interface_atspi_accessible.c
@@ -126,6 +126,7 @@ struct _Elm_Interface_Atspi_Accessible_Data
126 Elm_Atspi_Role role; 126 Elm_Atspi_Role role;
127 const char *name; 127 const char *name;
128 const char *description; 128 const char *description;
129 const char *translation_domain;
129 Elm_Interface_Atspi_Accessible *parent; 130 Elm_Interface_Atspi_Accessible *parent;
130}; 131};
131 132
@@ -215,7 +216,19 @@ _elm_interface_atspi_accessible_role_name_get(Eo *obj EINA_UNUSED, Elm_Interface
215EOLIAN char * 216EOLIAN char *
216_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd) 217_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd)
217{ 218{
218 return pd->name ? strdup(pd->name) : NULL; 219 if (pd->name)
220 {
221#ifdef ENABLE_NLS
222 if (pd->translation_domain)
223 return strdup(dgettext(pd->translation_domain, pd->name));
224 else
225 return strdup(pd->name);
226#else
227 return strdup(pd->name);
228#endif
229 }
230
231 return NULL;
219} 232}
220 233
221EOLIAN static void 234EOLIAN static void
@@ -226,6 +239,10 @@ _elm_interface_atspi_accessible_name_set(Eo *obj EINA_UNUSED, Elm_Interface_Atsp
226 239
227const char * _elm_interface_atspi_accessible_description_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd) 240const char * _elm_interface_atspi_accessible_description_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd)
228{ 241{
242#ifdef ENABLE_NLS
243 if (pd->translation_domain)
244 return dgettext(pd->translation_domain, pd->description);
245#endif
229 return pd->description; 246 return pd->description;
230} 247}
231 248
@@ -340,4 +357,16 @@ _elm_interface_atspi_accessible_event_handler_del(Eo *class EINA_UNUSED, void *p
340 } 357 }
341} 358}
342 359
360EOLIAN void
361_elm_interface_atspi_accessible_translation_domain_set(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd, const char *domain)
362{
363 eina_stringshare_replace(&pd->translation_domain, domain);
364}
365
366EOLIAN const char*
367_elm_interface_atspi_accessible_translation_domain_get(Eo *obj EINA_UNUSED, Elm_Interface_Atspi_Accessible_Data *pd)
368{
369 return pd->translation_domain;
370}
371
343#include "elm_interface_atspi_accessible.eo.c" 372#include "elm_interface_atspi_accessible.eo.c"