summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-22 15:13:16 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-26 17:58:07 +0900
commit839c4ed395f4aa20c3d8089bad828f2ebdc95a4b (patch)
treee34298f4924fab9755e198b9f87ce2f5ca81f638 /src/lib/elementary
parent2b7f9b6dfd372af81fd691ac0a0a87b53f8cce34 (diff)
elm: Introduce interface Efl.Ui.Translatable
This will be used to replace the part translation API in Elm.Widget. It should work for both parts and non-parts (ie. the main text of a button, for instance). For now I'm taking the following approach: - All efl_text_set/get strings are untranslatable, i.e. get() returns the visible string, set replaces and can not be translated. - translatable_text_set/get needs to be used to enable automatic translation, which in turns calls efl_text_set to modify the visible string. Thus, translatable applications will have to use efl_ui_translatable_text_set a lot more than efl_text_set, unless they translate strings application-side. Note that some other frameworks take a simpler approach equivalent to calling efl_text_set() with an already translated text. This prevents runtime language changes of the application, unless the application handles them specifically.
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/Elementary.h1
-rw-r--r--src/lib/elementary/efl_ui_clock.c4
-rw-r--r--src/lib/elementary/efl_ui_clock.eo2
-rw-r--r--src/lib/elementary/efl_ui_translatable.eo58
-rw-r--r--src/lib/elementary/efl_ui_win.c2
-rw-r--r--src/lib/elementary/elc_combobox.c10
-rw-r--r--src/lib/elementary/elc_ctxpopup.c4
-rw-r--r--src/lib/elementary/elc_hoversel.c4
-rw-r--r--src/lib/elementary/elc_multibuttonentry.c4
-rw-r--r--src/lib/elementary/elc_naviframe.c4
-rw-r--r--src/lib/elementary/elc_popup.c6
-rw-r--r--src/lib/elementary/elm_combobox.eo2
-rw-r--r--src/lib/elementary/elm_ctxpopup.eo2
-rw-r--r--src/lib/elementary/elm_dayselector.c4
-rw-r--r--src/lib/elementary/elm_dayselector.eo2
-rw-r--r--src/lib/elementary/elm_diskselector.c2
-rw-r--r--src/lib/elementary/elm_diskselector.eo2
-rw-r--r--src/lib/elementary/elm_hoversel.eo2
-rw-r--r--src/lib/elementary/elm_list.c4
-rw-r--r--src/lib/elementary/elm_list.eo2
-rw-r--r--src/lib/elementary/elm_menu.c2
-rw-r--r--src/lib/elementary/elm_menu.eo2
-rw-r--r--src/lib/elementary/elm_multibuttonentry.eo2
-rw-r--r--src/lib/elementary/elm_naviframe.eo2
-rw-r--r--src/lib/elementary/elm_popup.eo2
-rw-r--r--src/lib/elementary/elm_segment_control.c4
-rw-r--r--src/lib/elementary/elm_segment_control.eo2
-rw-r--r--src/lib/elementary/elm_toolbar.c4
-rw-r--r--src/lib/elementary/elm_toolbar.eo2
-rw-r--r--src/lib/elementary/elm_widget.c9
-rw-r--r--src/lib/elementary/elm_widget.eo12
-rw-r--r--src/lib/elementary/elm_widget.h2
32 files changed, 111 insertions, 55 deletions
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index a40e36501d..81e5bb6930 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -151,6 +151,7 @@ EAPI extern Elm_Version *elm_version;
151# include "efl_ui_focus_manager_root_focus.eo.h" 151# include "efl_ui_focus_manager_root_focus.eo.h"
152# include "efl_ui_focus_user.eo.h" 152# include "efl_ui_focus_user.eo.h"
153# include <efl_ui_textpath.eo.h> 153# include <efl_ui_textpath.eo.h>
154# include <efl_ui_translatable.eo.h>
154#endif 155#endif
155 156
156#include <elm_tooltip.h> 157#include <elm_tooltip.h>
diff --git a/src/lib/elementary/efl_ui_clock.c b/src/lib/elementary/efl_ui_clock.c
index b8927bfaf6..5de015f2e5 100644
--- a/src/lib/elementary/efl_ui_clock.c
+++ b/src/lib/elementary/efl_ui_clock.c
@@ -408,12 +408,12 @@ _reload_format(Evas_Object *obj)
408} 408}
409 409
410EOLIAN static void 410EOLIAN static void
411_efl_ui_clock_elm_widget_translate(Eo *obj, Efl_Ui_Clock_Data *sd) 411_efl_ui_clock_efl_ui_translatable_translation_update(Eo *obj, Efl_Ui_Clock_Data *sd)
412{ 412{
413 if (!sd->user_format) _reload_format(obj); 413 if (!sd->user_format) _reload_format(obj);
414 else _field_list_display(obj); 414 else _field_list_display(obj);
415 415
416 elm_obj_widget_translate(efl_super(obj, MY_CLASS)); 416 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
417} 417}
418 418
419static Eina_List * 419static Eina_List *
diff --git a/src/lib/elementary/efl_ui_clock.eo b/src/lib/elementary/efl_ui_clock.eo
index 81ed89c717..319147a3b7 100644
--- a/src/lib/elementary/efl_ui_clock.eo
+++ b/src/lib/elementary/efl_ui_clock.eo
@@ -229,7 +229,7 @@ class Efl.Ui.Clock (Efl.Ui.Layout)
229 Elm.Widget.focus_next; 229 Elm.Widget.focus_next;
230 Elm.Widget.on_disabled_update; 230 Elm.Widget.on_disabled_update;
231 Elm.Widget.on_focus_update; 231 Elm.Widget.on_focus_update;
232 Elm.Widget.translate; 232 Efl.Ui.Translatable.translation_update;
233 } 233 }
234 events { 234 events {
235 changed; [[Called when clock changed]] 235 changed; [[Called when clock changed]]
diff --git a/src/lib/elementary/efl_ui_translatable.eo b/src/lib/elementary/efl_ui_translatable.eo
new file mode 100644
index 0000000000..985566c795
--- /dev/null
+++ b/src/lib/elementary/efl_ui_translatable.eo
@@ -0,0 +1,58 @@
1interface Efl.Ui.Translatable
2{
3 [[Interface for all translatable text APIs.
4
5 This is intended for translation of human readable on-screen text strings,
6 but may also be used in text-to-speech situations.
7 ]]
8 methods {
9 @property translatable_text {
10 [[A unique string to be translated.
11
12 Often this will be a human-readable string (eg. in English) but it
13 might as well be a unique string identifier that must then be
14 translated to the current locale with $dgettext() or any similar
15 mechanism.
16
17 Setting this property will enable translation for this object or
18 part.
19 ]]
20 set {
21 [[Sets the new untranslated string and domain for this object.]]
22 }
23 get {
24 values {
25 domain: string @optional; [[A translation domain. If $null
26 this means the default domain is used.]]
27 }
28 return: string; [[This returns the untranslated value of $label.
29 The translated string can usually be retrieved with
30 $Efl.Text.text.get.]]
31 }
32 values {
33 label: string; [[A unique (untranslated) string.]]
34 domain: string @optional; [[A translation domain. If $null this
35 uses the default domain (eg. set by $textdomain()).]]
36 }
37 }
38 translation_update @protected {
39 [[Requests this object to update its text strings for the current
40 locale.
41
42 For the moment, strings are translated with $dgettext, so support for
43 this function may depend on the platform. It is up to the application
44 to provide their own translation data.
45
46 This function is a hook meant to be implemented by any object that
47 supports translation. This might be called whenever a new object is
48 created or when the current locale changes, for instance. This should
49 only trigger further calls to @.translation_update to children
50 objects.
51 ]]
52 }
53 }
54 events {
55 /* FIXME: Shouldn't language,change be here? */
56 }
57}
58
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 30d4d3d492..1a94b70c2e 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -3679,7 +3679,7 @@ _elm_win_translate(void)
3679 Evas_Object *obj; 3679 Evas_Object *obj;
3680 3680
3681 EINA_LIST_FOREACH(_elm_win_list, l, obj) 3681 EINA_LIST_FOREACH(_elm_win_list, l, obj)
3682 elm_widget_translate(obj); 3682 efl_ui_translatable_translation_update(obj);
3683} 3683}
3684 3684
3685void 3685void
diff --git a/src/lib/elementary/elc_combobox.c b/src/lib/elementary/elc_combobox.c
index 8d53fea303..b172153e7c 100644
--- a/src/lib/elementary/elc_combobox.c
+++ b/src/lib/elementary/elc_combobox.c
@@ -45,14 +45,14 @@ static const Elm_Action key_actions[] = {
45}; 45};
46 46
47EOLIAN static void 47EOLIAN static void
48_elm_combobox_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Combobox_Data *sd) 48_elm_combobox_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Combobox_Data *sd)
49{ 49{
50 elm_obj_widget_translate(efl_super(obj, MY_CLASS)); 50 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
51 elm_obj_widget_translate(sd->genlist); 51 efl_ui_translatable_translation_update(sd->genlist);
52 elm_obj_widget_translate(sd->entry); 52 efl_ui_translatable_translation_update(sd->entry);
53 53
54 if (sd->hover) 54 if (sd->hover)
55 elm_obj_widget_translate(sd->hover); 55 efl_ui_translatable_translation_update(sd->hover);
56} 56}
57 57
58EOLIAN static Efl_Ui_Theme_Apply 58EOLIAN static Efl_Ui_Theme_Apply
diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c
index 709b0579ce..d53cb203e8 100644
--- a/src/lib/elementary/elc_ctxpopup.c
+++ b/src/lib/elementary/elc_ctxpopup.c
@@ -48,7 +48,7 @@ static const Elm_Action key_actions[] = {
48}; 48};
49 49
50EOLIAN static void 50EOLIAN static void
51_elm_ctxpopup_elm_widget_translate(Eo *obj, Elm_Ctxpopup_Data *sd) 51_elm_ctxpopup_efl_ui_translatable_translation_update(Eo *obj, Elm_Ctxpopup_Data *sd)
52{ 52{
53 Eina_List *l; 53 Eina_List *l;
54 Elm_Object_Item *it; 54 Elm_Object_Item *it;
@@ -58,7 +58,7 @@ _elm_ctxpopup_elm_widget_translate(Eo *obj, Elm_Ctxpopup_Data *sd)
58 EINA_LIST_FOREACH(sd->items, l, it) 58 EINA_LIST_FOREACH(sd->items, l, it)
59 elm_wdg_item_translate(it); 59 elm_wdg_item_translate(it);
60 60
61 elm_obj_widget_translate(efl_super(obj, MY_CLASS)); 61 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
62} 62}
63 63
64EOLIAN static Eina_Bool 64EOLIAN static Eina_Bool
diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c
index 7a4ab20e39..d4973b103c 100644
--- a/src/lib/elementary/elc_hoversel.c
+++ b/src/lib/elementary/elc_hoversel.c
@@ -49,7 +49,7 @@ static const Elm_Action key_actions[] = {
49}; 49};
50 50
51EOLIAN static void 51EOLIAN static void
52_elm_hoversel_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd) 52_elm_hoversel_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
53{ 53{
54 Eo *it; 54 Eo *it;
55 Eina_List *l; 55 Eina_List *l;
@@ -57,7 +57,7 @@ _elm_hoversel_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
57 EINA_LIST_FOREACH(sd->items, l, it) 57 EINA_LIST_FOREACH(sd->items, l, it)
58 elm_wdg_item_translate(it); 58 elm_wdg_item_translate(it);
59 59
60 elm_obj_widget_translate(efl_super(obj, MY_CLASS)); 60 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
61} 61}
62 62
63EOLIAN static Efl_Ui_Theme_Apply 63EOLIAN static Efl_Ui_Theme_Apply
diff --git a/src/lib/elementary/elc_multibuttonentry.c b/src/lib/elementary/elc_multibuttonentry.c
index 1da8df6191..90538e4bcb 100644
--- a/src/lib/elementary/elc_multibuttonentry.c
+++ b/src/lib/elementary/elc_multibuttonentry.c
@@ -64,7 +64,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_multi_buttonentry_cb,
64); 64);
65 65
66EOLIAN static void 66EOLIAN static void
67_elm_multibuttonentry_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd) 67_elm_multibuttonentry_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
68{ 68{
69 Elm_Object_Item *it; 69 Elm_Object_Item *it;
70 Eina_List *l; 70 Eina_List *l;
@@ -72,7 +72,7 @@ _elm_multibuttonentry_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Multibuttone
72 EINA_LIST_FOREACH(sd->items, l, it) 72 EINA_LIST_FOREACH(sd->items, l, it)
73 elm_wdg_item_translate(it); 73 elm_wdg_item_translate(it);
74 74
75 elm_obj_widget_translate(efl_super(obj, MY_CLASS)); 75 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
76} 76}
77 77
78static char * 78static char *
diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c
index e9a39e4aa2..6975a701b4 100644
--- a/src/lib/elementary/elc_naviframe.c
+++ b/src/lib/elementary/elc_naviframe.c
@@ -105,14 +105,14 @@ _prev_page_focus_recover(Elm_Naviframe_Item_Data *it)
105} 105}
106 106
107EOLIAN static void 107EOLIAN static void
108_elm_naviframe_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd) 108_elm_naviframe_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
109{ 109{
110 Elm_Naviframe_Item_Data *it; 110 Elm_Naviframe_Item_Data *it;
111 111
112 EINA_INLIST_FOREACH(sd->stack, it) 112 EINA_INLIST_FOREACH(sd->stack, it)
113 elm_wdg_item_translate(EO_OBJ(it)); 113 elm_wdg_item_translate(EO_OBJ(it));
114 114
115 elm_obj_widget_translate(efl_super(obj, MY_CLASS)); 115 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
116} 116}
117 117
118static void 118static void
diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c
index f7d6f9deb3..7f0e45ef82 100644
--- a/src/lib/elementary/elc_popup.c
+++ b/src/lib/elementary/elc_popup.c
@@ -67,7 +67,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_notify_cb,
67static void _on_content_del(void *data, Evas *e, Evas_Object *obj, void *event_info); 67static void _on_content_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
68 68
69EOLIAN static void 69EOLIAN static void
70_elm_popup_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd) 70_elm_popup_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
71{ 71{
72 Elm_Popup_Item_Data *it; 72 Elm_Popup_Item_Data *it;
73 Eina_List *l; 73 Eina_List *l;
@@ -75,8 +75,8 @@ _elm_popup_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
75 EINA_LIST_FOREACH(sd->items, l, it) 75 EINA_LIST_FOREACH(sd->items, l, it)
76 elm_wdg_item_translate(EO_OBJ(it)); 76 elm_wdg_item_translate(EO_OBJ(it));
77 77
78 elm_obj_widget_translate(efl_super(obj, MY_CLASS)); 78 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
79 elm_obj_widget_translate(sd->main_layout); 79 efl_ui_translatable_translation_update(sd->main_layout);
80} 80}
81 81
82static void 82static void
diff --git a/src/lib/elementary/elm_combobox.eo b/src/lib/elementary/elm_combobox.eo
index a0f106bd41..1c9592ba75 100644
--- a/src/lib/elementary/elm_combobox.eo
+++ b/src/lib/elementary/elm_combobox.eo
@@ -40,7 +40,7 @@ class Elm.Combobox (Efl.Ui.Button, Efl.Ui.Selectable,
40 Efl.Gfx.visible { set; } 40 Efl.Gfx.visible { set; }
41 Efl.Gfx.size { set; } 41 Efl.Gfx.size { set; }
42 Elm.Widget.theme_apply; 42 Elm.Widget.theme_apply;
43 Elm.Widget.translate; 43 Efl.Ui.Translatable.translation_update;
44 Elm.Widget.widget_event; 44 Elm.Widget.widget_event;
45 Efl.Ui.Autorepeat.autorepeat_supported { get; } 45 Efl.Ui.Autorepeat.autorepeat_supported { get; }
46 Elm.Genlist.filter { set; } 46 Elm.Genlist.filter { set; }
diff --git a/src/lib/elementary/elm_ctxpopup.eo b/src/lib/elementary/elm_ctxpopup.eo
index 4829b74ebb..d46b054de7 100644
--- a/src/lib/elementary/elm_ctxpopup.eo
+++ b/src/lib/elementary/elm_ctxpopup.eo
@@ -208,7 +208,7 @@ class Elm.Ctxpopup (Efl.Ui.Layout, Elm.Interface.Atspi_Widget_Action,
208 Elm.Widget.focus_next; 208 Elm.Widget.focus_next;
209 Elm.Widget.on_disabled_update; 209 Elm.Widget.on_disabled_update;
210 Elm.Widget.widget_sub_object_add; 210 Elm.Widget.widget_sub_object_add;
211 Elm.Widget.translate; 211 Efl.Ui.Translatable.translation_update;
212 Elm.Widget.theme_apply; 212 Elm.Widget.theme_apply;
213 Elm.Widget.widget_event; 213 Elm.Widget.widget_event;
214 Efl.Ui.Menu.selected_item { get; } 214 Efl.Ui.Menu.selected_item { get; }
diff --git a/src/lib/elementary/elm_dayselector.c b/src/lib/elementary/elm_dayselector.c
index 3f20da3b74..7274b84985 100644
--- a/src/lib/elementary/elm_dayselector.c
+++ b/src/lib/elementary/elm_dayselector.c
@@ -56,7 +56,7 @@ _dayselector_resize(void *data,
56} 56}
57 57
58EOLIAN static void 58EOLIAN static void
59_elm_dayselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Dayselector_Data *sd) 59_elm_dayselector_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Dayselector_Data *sd)
60{ 60{
61 time_t t; 61 time_t t;
62 Eina_List *l; 62 Eina_List *l;
@@ -76,7 +76,7 @@ _elm_dayselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Dayselector_Data
76 elm_object_text_set(VIEW(it), buf); 76 elm_object_text_set(VIEW(it), buf);
77 } 77 }
78 78
79 elm_obj_widget_translate(efl_super(obj, MY_CLASS)); 79 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
80} 80}
81 81
82static void 82static void
diff --git a/src/lib/elementary/elm_dayselector.eo b/src/lib/elementary/elm_dayselector.eo
index 97b12d2ffd..2ccf6169ae 100644
--- a/src/lib/elementary/elm_dayselector.eo
+++ b/src/lib/elementary/elm_dayselector.eo
@@ -153,7 +153,7 @@ class Elm.Dayselector (Efl.Ui.Layout)
153 Efl.Object.constructor; 153 Efl.Object.constructor;
154 Elm.Widget.theme_apply; 154 Elm.Widget.theme_apply;
155 Elm.Widget.focus_direction_manager_is; 155 Elm.Widget.focus_direction_manager_is;
156 Elm.Widget.translate; 156 Efl.Ui.Translatable.translation_update;
157 Efl.Part.part; 157 Efl.Part.part;
158 } 158 }
159 events { 159 events {
diff --git a/src/lib/elementary/elm_diskselector.c b/src/lib/elementary/elm_diskselector.c
index 1f6b192bc2..eea10e492b 100644
--- a/src/lib/elementary/elm_diskselector.c
+++ b/src/lib/elementary/elm_diskselector.c
@@ -49,7 +49,7 @@ static const Elm_Action key_actions[] = {
49}; 49};
50 50
51EOLIAN static void 51EOLIAN static void
52_elm_diskselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd) 52_elm_diskselector_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
53{ 53{
54 Elm_Diskselector_Item_Data *it; 54 Elm_Diskselector_Item_Data *it;
55 Eina_List *l; 55 Eina_List *l;
diff --git a/src/lib/elementary/elm_diskselector.eo b/src/lib/elementary/elm_diskselector.eo
index a0c9f83e3f..e65099b41e 100644
--- a/src/lib/elementary/elm_diskselector.eo
+++ b/src/lib/elementary/elm_diskselector.eo
@@ -206,7 +206,7 @@ class Elm.Diskselector (Elm.Widget, Elm.Interface_Scrollable,
206 Elm.Widget.focus_next; 206 Elm.Widget.focus_next;
207 Elm.Widget.theme_apply; 207 Elm.Widget.theme_apply;
208 Elm.Widget.on_focus_update; 208 Elm.Widget.on_focus_update;
209 Elm.Widget.translate; 209 Efl.Ui.Translatable.translation_update;
210 Elm.Widget.widget_sub_object_del; 210 Elm.Widget.widget_sub_object_del;
211 Elm.Widget.widget_event; 211 Elm.Widget.widget_event;
212 Elm.Interface_Scrollable.policy { get; set; } 212 Elm.Interface_Scrollable.policy { get; set; }
diff --git a/src/lib/elementary/elm_hoversel.eo b/src/lib/elementary/elm_hoversel.eo
index fcdd6cfa57..1deb509621 100644
--- a/src/lib/elementary/elm_hoversel.eo
+++ b/src/lib/elementary/elm_hoversel.eo
@@ -97,7 +97,7 @@ class Elm.Hoversel (Efl.Ui.Button, Efl.Ui.Selectable,
97 Efl.Gfx.visible { set; } 97 Efl.Gfx.visible { set; }
98 Elm.Widget.widget_parent { set; } 98 Elm.Widget.widget_parent { set; }
99 Elm.Widget.theme_apply; 99 Elm.Widget.theme_apply;
100 Elm.Widget.translate; 100 Efl.Ui.Translatable.translation_update;
101 Elm.Widget.widget_event; 101 Elm.Widget.widget_event;
102 Efl.Ui.Autorepeat.autorepeat_supported { get; } 102 Efl.Ui.Autorepeat.autorepeat_supported { get; }
103 Elm.Interface.Atspi_Widget_Action.elm_actions { get; } 103 Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
diff --git a/src/lib/elementary/elm_list.c b/src/lib/elementary/elm_list.c
index 34ced61c3a..e0f2f92f34 100644
--- a/src/lib/elementary/elm_list.c
+++ b/src/lib/elementary/elm_list.c
@@ -632,7 +632,7 @@ static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params EINA_UN
632} 632}
633 633
634EOLIAN static void 634EOLIAN static void
635_elm_list_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_List_Data *sd) 635_elm_list_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
636{ 636{
637 Elm_Object_Item *it; 637 Elm_Object_Item *it;
638 Eina_List *l; 638 Eina_List *l;
@@ -640,7 +640,7 @@ _elm_list_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
640 EINA_LIST_FOREACH(sd->items, l, it) 640 EINA_LIST_FOREACH(sd->items, l, it)
641 elm_wdg_item_translate(it); 641 elm_wdg_item_translate(it);
642 642
643 elm_obj_widget_translate(efl_super(obj, MY_CLASS)); 643 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
644} 644}
645 645
646static void 646static void
diff --git a/src/lib/elementary/elm_list.eo b/src/lib/elementary/elm_list.eo
index a8f57288a4..442363349d 100644
--- a/src/lib/elementary/elm_list.eo
+++ b/src/lib/elementary/elm_list.eo
@@ -441,7 +441,7 @@ class Elm.List (Efl.Ui.Layout, Elm.Interface_Scrollable,
441 Elm.Widget.focus_next; 441 Elm.Widget.focus_next;
442 Elm.Widget.on_disabled_update; 442 Elm.Widget.on_disabled_update;
443 Elm.Widget.on_focus_update; 443 Elm.Widget.on_focus_update;
444 Elm.Widget.translate; 444 Efl.Ui.Translatable.translation_update;
445 Elm.Widget.widget_sub_object_del; 445 Elm.Widget.widget_sub_object_del;
446 Elm.Widget.widget_event; 446 Elm.Widget.widget_event;
447 Elm.Widget.focused_item { get; } 447 Elm.Widget.focused_item { get; }
diff --git a/src/lib/elementary/elm_menu.c b/src/lib/elementary/elm_menu.c
index 5ed912a2d7..29d8caaa13 100644
--- a/src/lib/elementary/elm_menu.c
+++ b/src/lib/elementary/elm_menu.c
@@ -32,7 +32,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
32#undef ELM_PRIV_MENU_SIGNALS 32#undef ELM_PRIV_MENU_SIGNALS
33 33
34EOLIAN static void 34EOLIAN static void
35_elm_menu_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd) 35_elm_menu_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
36{ 36{
37 Elm_Menu_Item_Data *it; 37 Elm_Menu_Item_Data *it;
38 Eina_List *l; 38 Eina_List *l;
diff --git a/src/lib/elementary/elm_menu.eo b/src/lib/elementary/elm_menu.eo
index 7a2cf0c13f..e50c4e9549 100644
--- a/src/lib/elementary/elm_menu.eo
+++ b/src/lib/elementary/elm_menu.eo
@@ -59,7 +59,7 @@ class Elm.Menu (Elm.Widget, Efl.Ui.Clickable, Efl.Ui.Menu,
59 Efl.Gfx.visible { set; } 59 Efl.Gfx.visible { set; }
60 Elm.Widget.widget_parent { get; set; } 60 Elm.Widget.widget_parent { get; set; }
61 Elm.Widget.theme_apply; 61 Elm.Widget.theme_apply;
62 Elm.Widget.translate; 62 Efl.Ui.Translatable.translation_update;
63 Elm.Widget.focus_manager_create; 63 Elm.Widget.focus_manager_create;
64 Elm.Interface.Atspi_Accessible.children { get; } 64 Elm.Interface.Atspi_Accessible.children { get; }
65 Efl.Access.Selection.selected_children_count { get; } 65 Efl.Access.Selection.selected_children_count { get; }
diff --git a/src/lib/elementary/elm_multibuttonentry.eo b/src/lib/elementary/elm_multibuttonentry.eo
index 8e71e068b8..70081d9f6d 100644
--- a/src/lib/elementary/elm_multibuttonentry.eo
+++ b/src/lib/elementary/elm_multibuttonentry.eo
@@ -185,7 +185,7 @@ class Elm.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable)
185 Elm.Widget.focus_direction; 185 Elm.Widget.focus_direction;
186 Elm.Widget.focus_next; 186 Elm.Widget.focus_next;
187 Elm.Widget.on_focus_update; 187 Elm.Widget.on_focus_update;
188 Elm.Widget.translate; 188 Efl.Ui.Translatable.translation_update;
189 Elm.Widget.widget_event; 189 Elm.Widget.widget_event;
190 Elm.Interface.Atspi_Accessible.children { get; } 190 Elm.Interface.Atspi_Accessible.children { get; }
191 Efl.Part.part; 191 Efl.Part.part;
diff --git a/src/lib/elementary/elm_naviframe.eo b/src/lib/elementary/elm_naviframe.eo
index 4dd9469aa7..332e98c49f 100644
--- a/src/lib/elementary/elm_naviframe.eo
+++ b/src/lib/elementary/elm_naviframe.eo
@@ -149,7 +149,7 @@ class Elm.Naviframe (Efl.Ui.Layout, Elm.Interface.Atspi_Widget_Action)
149 Elm.Widget.focus_direction_manager_is; 149 Elm.Widget.focus_direction_manager_is;
150 Elm.Widget.on_access_update; 150 Elm.Widget.on_access_update;
151 Elm.Widget.focus_next; 151 Elm.Widget.focus_next;
152 Elm.Widget.translate; 152 Efl.Ui.Translatable.translation_update;
153 Elm.Widget.theme_apply; 153 Elm.Widget.theme_apply;
154 Elm.Widget.widget_event; 154 Elm.Widget.widget_event;
155 Efl.Canvas.Layout_Signal.signal_emit; 155 Efl.Canvas.Layout_Signal.signal_emit;
diff --git a/src/lib/elementary/elm_popup.eo b/src/lib/elementary/elm_popup.eo
index 8023d62571..7ac9a18b05 100644
--- a/src/lib/elementary/elm_popup.eo
+++ b/src/lib/elementary/elm_popup.eo
@@ -175,7 +175,7 @@ class Elm.Popup (Efl.Ui.Layout, Elm.Interface.Atspi_Widget_Action)
175 Elm.Widget.on_access_update; 175 Elm.Widget.on_access_update;
176 Elm.Widget.focus_next; 176 Elm.Widget.focus_next;
177 Elm.Widget.widget_parent { set; } 177 Elm.Widget.widget_parent { set; }
178 Elm.Widget.translate; 178 Efl.Ui.Translatable.translation_update;
179 Elm.Widget.widget_sub_object_del; 179 Elm.Widget.widget_sub_object_del;
180 Elm.Widget.widget_event; 180 Elm.Widget.widget_event;
181 Efl.Canvas.Layout_Signal.signal_emit; 181 Efl.Canvas.Layout_Signal.signal_emit;
diff --git a/src/lib/elementary/elm_segment_control.c b/src/lib/elementary/elm_segment_control.c
index bd90657f7a..8ea9689ee7 100644
--- a/src/lib/elementary/elm_segment_control.c
+++ b/src/lib/elementary/elm_segment_control.c
@@ -26,7 +26,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
26}; 26};
27 27
28EOLIAN static void 28EOLIAN static void
29_elm_segment_control_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Segment_Control_Data *sd) 29_elm_segment_control_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Segment_Control_Data *sd)
30{ 30{
31 Elm_Object_Item *it; 31 Elm_Object_Item *it;
32 Eina_List *l; 32 Eina_List *l;
@@ -34,7 +34,7 @@ _elm_segment_control_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Segment_Contr
34 EINA_LIST_FOREACH(sd->items, l, it) 34 EINA_LIST_FOREACH(sd->items, l, it)
35 elm_wdg_item_translate(it); 35 elm_wdg_item_translate(it);
36 36
37 elm_obj_widget_translate(efl_super(obj, MY_CLASS)); 37 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
38} 38}
39 39
40EOLIAN static void 40EOLIAN static void
diff --git a/src/lib/elementary/elm_segment_control.eo b/src/lib/elementary/elm_segment_control.eo
index 36016d7e39..b9a3f94095 100644
--- a/src/lib/elementary/elm_segment_control.eo
+++ b/src/lib/elementary/elm_segment_control.eo
@@ -142,7 +142,7 @@ class Elm.Segment_Control (Efl.Ui.Layout)
142 Elm.Widget.focus_direction_manager_is; 142 Elm.Widget.focus_direction_manager_is;
143 Elm.Widget.on_access_update; 143 Elm.Widget.on_access_update;
144 Elm.Widget.on_disabled_update; 144 Elm.Widget.on_disabled_update;
145 Elm.Widget.translate; 145 Efl.Ui.Translatable.translation_update;
146 } 146 }
147 events { 147 events {
148 changed; [[Called when segment control changed]] 148 changed; [[Called when segment control changed]]
diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c
index b43fcd8148..37955b7738 100644
--- a/src/lib/elementary/elm_toolbar.c
+++ b/src/lib/elementary/elm_toolbar.c
@@ -1724,14 +1724,14 @@ _elm_toolbar_item_elm_widget_item_part_content_unset(Eo *eo_item EINA_UNUSED, El
1724} 1724}
1725 1725
1726EOLIAN static void 1726EOLIAN static void
1727_elm_toolbar_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) 1727_elm_toolbar_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
1728{ 1728{
1729 Elm_Toolbar_Item_Data *it; 1729 Elm_Toolbar_Item_Data *it;
1730 1730
1731 EINA_INLIST_FOREACH(sd->items, it) 1731 EINA_INLIST_FOREACH(sd->items, it)
1732 elm_wdg_item_translate(EO_OBJ(it)); 1732 elm_wdg_item_translate(EO_OBJ(it));
1733 1733
1734 elm_obj_widget_translate(efl_super(obj, MY_CLASS)); 1734 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
1735} 1735}
1736 1736
1737static void 1737static void
diff --git a/src/lib/elementary/elm_toolbar.eo b/src/lib/elementary/elm_toolbar.eo
index 9bec19f7a1..31fab9d539 100644
--- a/src/lib/elementary/elm_toolbar.eo
+++ b/src/lib/elementary/elm_toolbar.eo
@@ -325,7 +325,7 @@ class Elm.Toolbar (Elm.Widget, Elm.Interface_Scrollable, Efl.Ui.Direction,
325 Elm.Widget.focus_next; 325 Elm.Widget.focus_next;
326 Elm.Widget.theme_apply; 326 Elm.Widget.theme_apply;
327 Elm.Widget.on_focus_update; 327 Elm.Widget.on_focus_update;
328 Elm.Widget.translate; 328 Efl.Ui.Translatable.translation_update;
329 Elm.Widget.widget_event; 329 Elm.Widget.widget_event;
330 Elm.Widget.focus_highlight_geometry { get; } 330 Elm.Widget.focus_highlight_geometry { get; }
331 Elm.Widget.focused_item { get; } 331 Elm.Widget.focused_item { get; }
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 1bc6b9a460..fca0787b42 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -3882,7 +3882,7 @@ elm_widget_part_text_translate(Eo *obj, const char *part, const char *text)
3882} 3882}
3883 3883
3884EOLIAN static void 3884EOLIAN static void
3885_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd) 3885_elm_widget_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
3886{ 3886{
3887 const Eina_List *l; 3887 const Eina_List *l;
3888 Evas_Object *child; 3888 Evas_Object *child;
@@ -3890,10 +3890,10 @@ _elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
3890 EINA_LIST_FOREACH(sd->subobjs, l, child) 3890 EINA_LIST_FOREACH(sd->subobjs, l, child)
3891 { 3891 {
3892 if (elm_widget_is(child)) 3892 if (elm_widget_is(child))
3893 elm_widget_translate(child); 3893 efl_ui_translatable_translation_update(child);
3894 } 3894 }
3895 3895
3896 if (sd->hover_obj) elm_widget_translate(sd->hover_obj); 3896 if (sd->hover_obj) efl_ui_translatable_translation_update(sd->hover_obj);
3897 3897
3898#ifdef HAVE_GETTEXT 3898#ifdef HAVE_GETTEXT
3899 Elm_Translate_String_Data *ts; 3899 Elm_Translate_String_Data *ts;
@@ -6693,3 +6693,6 @@ ELM_PART_TEXT_DEFAULT_GET(elm_widget, NULL)
6693 6693
6694#include "elm_widget_item.eo.c" 6694#include "elm_widget_item.eo.c"
6695#include "elm_widget.eo.c" 6695#include "elm_widget.eo.c"
6696
6697/* Others */
6698#include "efl_ui_translatable.eo.c"
diff --git a/src/lib/elementary/elm_widget.eo b/src/lib/elementary/elm_widget.eo
index 53638c95f1..123c8baecc 100644
--- a/src/lib/elementary/elm_widget.eo
+++ b/src/lib/elementary/elm_widget.eo
@@ -19,7 +19,8 @@ struct Elm.Widget.Focus_State {
19 19
20abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible, 20abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
21 Efl.Access.Component, Efl.Ui.Focus.User, Efl.Part, 21 Efl.Access.Component, Efl.Ui.Focus.User, Efl.Part,
22 Efl.Ui.Focus.Object, Efl.Ui.Base, Efl.Ui.Cursor) 22 Efl.Ui.Focus.Object, Efl.Ui.Base, Efl.Ui.Cursor,
23 Efl.Ui.Translatable)
23{ 24{
24 [[Elementary widget abstract class]] 25 [[Elementary widget abstract class]]
25 legacy_prefix: elm_widget; 26 legacy_prefix: elm_widget;
@@ -285,14 +286,6 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
285 } 286 }
286 287
287 /* Translation & Text API. */ 288 /* Translation & Text API. */
288 translate @protected {
289 [[Virtual function handling language changes.
290
291 If a widget is composed of multiple sub-objects, this function might
292 need to be reimplemented to translate all those sub-objects that
293 have visible (or accessible) translatable text.
294 ]]
295 }
296 @property domain_part_text_translatable { 289 @property domain_part_text_translatable {
297 [[Translate domain text part property]] 290 [[Translate domain text part property]]
298 set { 291 set {
@@ -860,6 +853,7 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
860 Efl.Ui.Cursor.cursor { get; set; } 853 Efl.Ui.Cursor.cursor { get; set; }
861 Efl.Ui.Cursor.cursor_style { get; set; } 854 Efl.Ui.Cursor.cursor_style { get; set; }
862 Efl.Ui.Cursor.cursor_theme_search_enabled { get; set; } 855 Efl.Ui.Cursor.cursor_theme_search_enabled { get; set; }
856 Efl.Ui.Translatable.translation_update; [[This implements the calls to $gettext() and $text_set().]]
863 Efl.Part.part; [[Returns @Efl.Ui.Widget.Part.]] 857 Efl.Part.part; [[Returns @Efl.Ui.Widget.Part.]]
864 } 858 }
865 events { 859 events {
diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h
index 799ec11305..a57630fd28 100644
--- a/src/lib/elementary/elm_widget.h
+++ b/src/lib/elementary/elm_widget.h
@@ -635,7 +635,7 @@ EAPI Eina_Bool elm_widget_api_check(int ver);
635EAPI Eina_Bool elm_widget_access(Evas_Object *obj, Eina_Bool is_access); 635EAPI Eina_Bool elm_widget_access(Evas_Object *obj, Eina_Bool is_access);
636EAPI Efl_Ui_Theme_Apply elm_widget_theme(Evas_Object *obj); 636EAPI Efl_Ui_Theme_Apply elm_widget_theme(Evas_Object *obj);
637EAPI void elm_widget_theme_specific(Evas_Object *obj, Elm_Theme *th, Eina_Bool force); 637EAPI void elm_widget_theme_specific(Evas_Object *obj, Elm_Theme *th, Eina_Bool force);
638EAPI void elm_widget_translate(Evas_Object *obj); 638EAPI void efl_ui_translatable_translation_update(Evas_Object *obj);
639EAPI void elm_widget_on_show_region_hook_set(Evas_Object *obj, void *data, Efl_Ui_Scrollable_On_Show_Region func, Eina_Free_Cb data_free); 639EAPI void elm_widget_on_show_region_hook_set(Evas_Object *obj, void *data, Efl_Ui_Scrollable_On_Show_Region func, Eina_Free_Cb data_free);
640EAPI Eina_Bool elm_widget_sub_object_parent_add(Evas_Object *sobj); 640EAPI Eina_Bool elm_widget_sub_object_parent_add(Evas_Object *sobj);
641EAPI Eina_Bool elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj); 641EAPI Eina_Bool elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj);