elm: Introduce interface Efl.Ui.Translatable
authorJean-Philippe Andre <jp.andre@samsung.com>
Fri, 22 Sep 2017 06:13:16 +0000 (15:13 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 26 Sep 2017 08:58:07 +0000 (17:58 +0900)
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.

33 files changed:
src/Makefile_Elementary.am
src/lib/elementary/Elementary.h
src/lib/elementary/efl_ui_clock.c
src/lib/elementary/efl_ui_clock.eo
src/lib/elementary/efl_ui_translatable.eo [new file with mode: 0644]
src/lib/elementary/efl_ui_win.c
src/lib/elementary/elc_combobox.c
src/lib/elementary/elc_ctxpopup.c
src/lib/elementary/elc_hoversel.c
src/lib/elementary/elc_multibuttonentry.c
src/lib/elementary/elc_naviframe.c
src/lib/elementary/elc_popup.c
src/lib/elementary/elm_combobox.eo
src/lib/elementary/elm_ctxpopup.eo
src/lib/elementary/elm_dayselector.c
src/lib/elementary/elm_dayselector.eo
src/lib/elementary/elm_diskselector.c
src/lib/elementary/elm_diskselector.eo
src/lib/elementary/elm_hoversel.eo
src/lib/elementary/elm_list.c
src/lib/elementary/elm_list.eo
src/lib/elementary/elm_menu.c
src/lib/elementary/elm_menu.eo
src/lib/elementary/elm_multibuttonentry.eo
src/lib/elementary/elm_naviframe.eo
src/lib/elementary/elm_popup.eo
src/lib/elementary/elm_segment_control.c
src/lib/elementary/elm_segment_control.eo
src/lib/elementary/elm_toolbar.c
src/lib/elementary/elm_toolbar.eo
src/lib/elementary/elm_widget.c
src/lib/elementary/elm_widget.eo
src/lib/elementary/elm_widget.h

index 2562bc2..e6a0795 100644 (file)
@@ -140,6 +140,7 @@ elm_public_eolian_files = \
        lib/elementary/efl_ui_focus_user.eo \
        lib/elementary/efl_ui_textpath.eo \
        lib/elementary/efl_ui_textpath_part.eo \
+       lib/elementary/efl_ui_translatable.eo \
        $(NULL)
 
 # Private classes (not exposed or shipped)
index a40e365..81e5bb6 100644 (file)
@@ -151,6 +151,7 @@ EAPI extern Elm_Version *elm_version;
 # include "efl_ui_focus_manager_root_focus.eo.h"
 # include "efl_ui_focus_user.eo.h"
 # include <efl_ui_textpath.eo.h>
+# include <efl_ui_translatable.eo.h>
 #endif
 
 #include <elm_tooltip.h>
index b8927bf..5de015f 100644 (file)
@@ -408,12 +408,12 @@ _reload_format(Evas_Object *obj)
 }
 
 EOLIAN static void
-_efl_ui_clock_elm_widget_translate(Eo *obj, Efl_Ui_Clock_Data *sd)
+_efl_ui_clock_efl_ui_translatable_translation_update(Eo *obj, Efl_Ui_Clock_Data *sd)
 {
    if (!sd->user_format) _reload_format(obj);
    else _field_list_display(obj);
 
-   elm_obj_widget_translate(efl_super(obj, MY_CLASS));
+   efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
 }
 
 static Eina_List *
index 81ed89c..319147a 100644 (file)
@@ -229,7 +229,7 @@ class Efl.Ui.Clock (Efl.Ui.Layout)
       Elm.Widget.focus_next;
       Elm.Widget.on_disabled_update;
       Elm.Widget.on_focus_update;
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
    }
    events {
       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 (file)
index 0000000..985566c
--- /dev/null
@@ -0,0 +1,58 @@
+interface Efl.Ui.Translatable
+{
+   [[Interface for all translatable text APIs.
+
+     This is intended for translation of human readable on-screen text strings,
+     but may also be used in text-to-speech situations.
+   ]]
+   methods {
+      @property translatable_text {
+         [[A unique string to be translated.
+           
+           Often this will be a human-readable string (eg. in English) but it
+           might as well be a unique string identifier that must then be
+           translated to the current locale with $dgettext() or any similar
+           mechanism.
+
+           Setting this property will enable translation for this object or
+           part.
+         ]]
+         set {
+            [[Sets the new untranslated string and domain for this object.]]
+         }
+         get {
+            values {
+               domain: string @optional; [[A translation domain. If $null
+                  this means the default domain is used.]]
+            }
+            return: string; [[This returns the untranslated value of $label.
+               The translated string can usually be retrieved with
+               $Efl.Text.text.get.]]
+         }
+         values {
+            label: string; [[A unique (untranslated) string.]]
+            domain: string @optional; [[A translation domain. If $null this
+               uses the default domain (eg. set by $textdomain()).]]
+         }
+      }
+      translation_update @protected {
+         [[Requests this object to update its text strings for the current
+           locale.
+
+           For the moment, strings are translated with $dgettext, so support for
+           this function may depend on the platform. It is up to the application
+           to provide their own translation data.
+
+           This function is a hook meant to be implemented by any object that
+           supports translation. This might be called whenever a new object is
+           created or when the current locale changes, for instance. This should
+           only trigger further calls to @.translation_update to children
+           objects.
+         ]]
+      }
+   }
+   events {
+      /* FIXME: Shouldn't language,change be here? */
+   }
+}
+
index 30d4d3d..1a94b70 100644 (file)
@@ -3679,7 +3679,7 @@ _elm_win_translate(void)
    Evas_Object *obj;
 
    EINA_LIST_FOREACH(_elm_win_list, l, obj)
-     elm_widget_translate(obj);
+     efl_ui_translatable_translation_update(obj);
 }
 
 void
index 8d53fea..b172153 100644 (file)
@@ -45,14 +45,14 @@ static const Elm_Action key_actions[] = {
 };
 
 EOLIAN static void
-_elm_combobox_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Combobox_Data *sd)
+_elm_combobox_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Combobox_Data *sd)
 {
-   elm_obj_widget_translate(efl_super(obj, MY_CLASS));
-   elm_obj_widget_translate(sd->genlist);
-   elm_obj_widget_translate(sd->entry);
+   efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
+   efl_ui_translatable_translation_update(sd->genlist);
+   efl_ui_translatable_translation_update(sd->entry);
 
    if (sd->hover)
-     elm_obj_widget_translate(sd->hover);
+     efl_ui_translatable_translation_update(sd->hover);
 }
 
 EOLIAN static Efl_Ui_Theme_Apply
index 709b057..d53cb20 100644 (file)
@@ -48,7 +48,7 @@ static const Elm_Action key_actions[] = {
 };
 
 EOLIAN static void
-_elm_ctxpopup_elm_widget_translate(Eo *obj, Elm_Ctxpopup_Data *sd)
+_elm_ctxpopup_efl_ui_translatable_translation_update(Eo *obj, Elm_Ctxpopup_Data *sd)
 {
    Eina_List *l;
    Elm_Object_Item *it;
@@ -58,7 +58,7 @@ _elm_ctxpopup_elm_widget_translate(Eo *obj, Elm_Ctxpopup_Data *sd)
    EINA_LIST_FOREACH(sd->items, l, it)
      elm_wdg_item_translate(it);
 
-   elm_obj_widget_translate(efl_super(obj, MY_CLASS));
+   efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
 }
 
 EOLIAN static Eina_Bool
index 7a4ab20..d4973b1 100644 (file)
@@ -49,7 +49,7 @@ static const Elm_Action key_actions[] = {
 };
 
 EOLIAN static void
-_elm_hoversel_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
+_elm_hoversel_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
 {
    Eo *it;
    Eina_List *l;
@@ -57,7 +57,7 @@ _elm_hoversel_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd)
    EINA_LIST_FOREACH(sd->items, l, it)
      elm_wdg_item_translate(it);
 
-   elm_obj_widget_translate(efl_super(obj, MY_CLASS));
+   efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
 }
 
 EOLIAN static Efl_Ui_Theme_Apply
index 1da8df6..90538e4 100644 (file)
@@ -64,7 +64,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_multi_buttonentry_cb,
 );
 
 EOLIAN static void
-_elm_multibuttonentry_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
+_elm_multibuttonentry_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd)
 {
    Elm_Object_Item *it;
    Eina_List *l;
@@ -72,7 +72,7 @@ _elm_multibuttonentry_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Multibuttone
    EINA_LIST_FOREACH(sd->items, l, it)
      elm_wdg_item_translate(it);
 
-   elm_obj_widget_translate(efl_super(obj, MY_CLASS));
+   efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
 }
 
 static char *
index e9a39e4..6975a70 100644 (file)
@@ -105,14 +105,14 @@ _prev_page_focus_recover(Elm_Naviframe_Item_Data *it)
 }
 
 EOLIAN static void
-_elm_naviframe_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
+_elm_naviframe_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
 {
    Elm_Naviframe_Item_Data *it;
 
    EINA_INLIST_FOREACH(sd->stack, it)
      elm_wdg_item_translate(EO_OBJ(it));
 
-   elm_obj_widget_translate(efl_super(obj, MY_CLASS));
+   efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
 }
 
 static void
index f7d6f9d..7f0e45e 100644 (file)
@@ -67,7 +67,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_notify_cb,
 static void  _on_content_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
 
 EOLIAN static void
-_elm_popup_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
+_elm_popup_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
 {
    Elm_Popup_Item_Data *it;
    Eina_List *l;
@@ -75,8 +75,8 @@ _elm_popup_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
    EINA_LIST_FOREACH(sd->items, l, it)
       elm_wdg_item_translate(EO_OBJ(it));
 
-   elm_obj_widget_translate(efl_super(obj, MY_CLASS));
-   elm_obj_widget_translate(sd->main_layout);
+   efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
+   efl_ui_translatable_translation_update(sd->main_layout);
 }
 
 static void
index a0f106b..1c9592b 100644 (file)
@@ -40,7 +40,7 @@ class Elm.Combobox (Efl.Ui.Button, Efl.Ui.Selectable,
       Efl.Gfx.visible { set; }
       Efl.Gfx.size { set; }
       Elm.Widget.theme_apply;
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
       Elm.Widget.widget_event;
       Efl.Ui.Autorepeat.autorepeat_supported { get; }
       Elm.Genlist.filter { set; }
index 4829b74..d46b054 100644 (file)
@@ -208,7 +208,7 @@ class Elm.Ctxpopup (Efl.Ui.Layout, Elm.Interface.Atspi_Widget_Action,
       Elm.Widget.focus_next;
       Elm.Widget.on_disabled_update;
       Elm.Widget.widget_sub_object_add;
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
       Elm.Widget.theme_apply;
       Elm.Widget.widget_event;
       Efl.Ui.Menu.selected_item { get; }
index 3f20da3..7274b84 100644 (file)
@@ -56,7 +56,7 @@ _dayselector_resize(void *data,
 }
 
 EOLIAN static void
-_elm_dayselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Dayselector_Data *sd)
+_elm_dayselector_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Dayselector_Data *sd)
 {
    time_t t;
    Eina_List *l;
@@ -76,7 +76,7 @@ _elm_dayselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Dayselector_Data
         elm_object_text_set(VIEW(it), buf);
      }
 
-   elm_obj_widget_translate(efl_super(obj, MY_CLASS));
+   efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
 }
 
 static void
index 97b12d2..2ccf616 100644 (file)
@@ -153,7 +153,7 @@ class Elm.Dayselector (Efl.Ui.Layout)
       Efl.Object.constructor;
       Elm.Widget.theme_apply;
       Elm.Widget.focus_direction_manager_is;
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
       Efl.Part.part;
    }
    events {
index 1f6b192..eea10e4 100644 (file)
@@ -49,7 +49,7 @@ static const Elm_Action key_actions[] = {
 };
 
 EOLIAN static void
-_elm_diskselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
+_elm_diskselector_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd)
 {
    Elm_Diskselector_Item_Data *it;
    Eina_List *l;
index a0c9f83..e65099b 100644 (file)
@@ -206,7 +206,7 @@ class Elm.Diskselector (Elm.Widget, Elm.Interface_Scrollable,
       Elm.Widget.focus_next;
       Elm.Widget.theme_apply;
       Elm.Widget.on_focus_update;
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
       Elm.Widget.widget_sub_object_del;
       Elm.Widget.widget_event;
       Elm.Interface_Scrollable.policy { get; set; }
index fcdd6cf..1deb509 100644 (file)
@@ -97,7 +97,7 @@ class Elm.Hoversel (Efl.Ui.Button, Efl.Ui.Selectable,
       Efl.Gfx.visible { set; }
       Elm.Widget.widget_parent { set; }
       Elm.Widget.theme_apply;
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
       Elm.Widget.widget_event;
       Efl.Ui.Autorepeat.autorepeat_supported { get; }
       Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
index 34ced61..e0f2f92 100644 (file)
@@ -632,7 +632,7 @@ static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params EINA_UN
 }
 
 EOLIAN static void
-_elm_list_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
+_elm_list_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
 {
    Elm_Object_Item *it;
    Eina_List *l;
@@ -640,7 +640,7 @@ _elm_list_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_List_Data *sd)
    EINA_LIST_FOREACH(sd->items, l, it)
      elm_wdg_item_translate(it);
 
-   elm_obj_widget_translate(efl_super(obj, MY_CLASS));
+   efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
 }
 
 static void
index a8f5728..4423633 100644 (file)
@@ -441,7 +441,7 @@ class Elm.List (Efl.Ui.Layout, Elm.Interface_Scrollable,
       Elm.Widget.focus_next;
       Elm.Widget.on_disabled_update;
       Elm.Widget.on_focus_update;
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
       Elm.Widget.widget_sub_object_del;
       Elm.Widget.widget_event;
       Elm.Widget.focused_item { get; }
index 5ed912a..29d8caa 100644 (file)
@@ -32,7 +32,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
 #undef ELM_PRIV_MENU_SIGNALS
 
 EOLIAN static void
-_elm_menu_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
+_elm_menu_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
 {
    Elm_Menu_Item_Data *it;
    Eina_List *l;
index 7a2cf0c..e50c4e9 100644 (file)
@@ -59,7 +59,7 @@ class Elm.Menu (Elm.Widget, Efl.Ui.Clickable, Efl.Ui.Menu,
       Efl.Gfx.visible { set; }
       Elm.Widget.widget_parent { get; set; }
       Elm.Widget.theme_apply;
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
       Elm.Widget.focus_manager_create;
       Elm.Interface.Atspi_Accessible.children { get; }
       Efl.Access.Selection.selected_children_count { get; }
index 8e71e06..70081d9 100644 (file)
@@ -185,7 +185,7 @@ class Elm.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable)
       Elm.Widget.focus_direction;
       Elm.Widget.focus_next;
       Elm.Widget.on_focus_update;
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
       Elm.Widget.widget_event;
       Elm.Interface.Atspi_Accessible.children { get; }
       Efl.Part.part;
index 4dd9469..332e98c 100644 (file)
@@ -149,7 +149,7 @@ class Elm.Naviframe (Efl.Ui.Layout, Elm.Interface.Atspi_Widget_Action)
       Elm.Widget.focus_direction_manager_is;
       Elm.Widget.on_access_update;
       Elm.Widget.focus_next;
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
       Elm.Widget.theme_apply;
       Elm.Widget.widget_event;
       Efl.Canvas.Layout_Signal.signal_emit;
index 8023d62..7ac9a18 100644 (file)
@@ -175,7 +175,7 @@ class Elm.Popup (Efl.Ui.Layout, Elm.Interface.Atspi_Widget_Action)
       Elm.Widget.on_access_update;
       Elm.Widget.focus_next;
       Elm.Widget.widget_parent { set; }
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
       Elm.Widget.widget_sub_object_del;
       Elm.Widget.widget_event;
       Efl.Canvas.Layout_Signal.signal_emit;
index bd90657..8ea9689 100644 (file)
@@ -26,7 +26,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
 };
 
 EOLIAN static void
-_elm_segment_control_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Segment_Control_Data *sd)
+_elm_segment_control_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Segment_Control_Data *sd)
 {
    Elm_Object_Item *it;
    Eina_List *l;
@@ -34,7 +34,7 @@ _elm_segment_control_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Segment_Contr
    EINA_LIST_FOREACH(sd->items, l, it)
      elm_wdg_item_translate(it);
 
-   elm_obj_widget_translate(efl_super(obj, MY_CLASS));
+   efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
 }
 
 EOLIAN static void
index 36016d7..b9a3f94 100644 (file)
@@ -142,7 +142,7 @@ class Elm.Segment_Control (Efl.Ui.Layout)
       Elm.Widget.focus_direction_manager_is;
       Elm.Widget.on_access_update;
       Elm.Widget.on_disabled_update;
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
    }
    events {
       changed; [[Called when segment control changed]]
index b43fcd8..37955b7 100644 (file)
@@ -1724,14 +1724,14 @@ _elm_toolbar_item_elm_widget_item_part_content_unset(Eo *eo_item EINA_UNUSED, El
 }
 
 EOLIAN static void
-_elm_toolbar_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
+_elm_toolbar_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd)
 {
    Elm_Toolbar_Item_Data *it;
 
    EINA_INLIST_FOREACH(sd->items, it)
      elm_wdg_item_translate(EO_OBJ(it));
 
-   elm_obj_widget_translate(efl_super(obj, MY_CLASS));
+   efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
 }
 
 static void
index 9bec19f..31fab9d 100644 (file)
@@ -325,7 +325,7 @@ class Elm.Toolbar (Elm.Widget, Elm.Interface_Scrollable, Efl.Ui.Direction,
       Elm.Widget.focus_next;
       Elm.Widget.theme_apply;
       Elm.Widget.on_focus_update;
-      Elm.Widget.translate;
+      Efl.Ui.Translatable.translation_update;
       Elm.Widget.widget_event;
       Elm.Widget.focus_highlight_geometry { get; }
       Elm.Widget.focused_item { get; }
index 1bc6b9a..fca0787 100644 (file)
@@ -3882,7 +3882,7 @@ elm_widget_part_text_translate(Eo *obj, const char *part, const char *text)
 }
 
 EOLIAN static void
-_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
+_elm_widget_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
 {
    const Eina_List *l;
    Evas_Object *child;
@@ -3890,10 +3890,10 @@ _elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
    EINA_LIST_FOREACH(sd->subobjs, l, child)
      {
         if (elm_widget_is(child))
-          elm_widget_translate(child);
+          efl_ui_translatable_translation_update(child);
      }
 
-   if (sd->hover_obj) elm_widget_translate(sd->hover_obj);
+   if (sd->hover_obj) efl_ui_translatable_translation_update(sd->hover_obj);
 
 #ifdef HAVE_GETTEXT
    Elm_Translate_String_Data *ts;
@@ -6693,3 +6693,6 @@ ELM_PART_TEXT_DEFAULT_GET(elm_widget, NULL)
 
 #include "elm_widget_item.eo.c"
 #include "elm_widget.eo.c"
+
+/* Others */
+#include "efl_ui_translatable.eo.c"
index 53638c9..123c8ba 100644 (file)
@@ -19,7 +19,8 @@ struct Elm.Widget.Focus_State {
 
 abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
                      Efl.Access.Component, Efl.Ui.Focus.User, Efl.Part,
-                     Efl.Ui.Focus.Object, Efl.Ui.Base, Efl.Ui.Cursor)
+                     Efl.Ui.Focus.Object, Efl.Ui.Base, Efl.Ui.Cursor,
+                     Efl.Ui.Translatable)
 {
    [[Elementary widget abstract class]]
    legacy_prefix: elm_widget;
@@ -285,14 +286,6 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
       }
 
       /* Translation & Text API. */
-      translate @protected {
-         [[Virtual function handling language changes.
-
-           If a widget is composed of multiple sub-objects, this function might
-           need to be reimplemented to translate all those sub-objects that
-           have visible (or accessible) translatable text.
-         ]]
-      }
       @property domain_part_text_translatable {
          [[Translate domain text part property]]
          set {
@@ -860,6 +853,7 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
       Efl.Ui.Cursor.cursor { get; set; }
       Efl.Ui.Cursor.cursor_style { get; set; }
       Efl.Ui.Cursor.cursor_theme_search_enabled { get; set; }
+      Efl.Ui.Translatable.translation_update; [[This implements the calls to $gettext() and $text_set().]]
       Efl.Part.part; [[Returns @Efl.Ui.Widget.Part.]]
    }
    events {
index 799ec11..a57630f 100644 (file)
@@ -635,7 +635,7 @@ EAPI Eina_Bool        elm_widget_api_check(int ver);
 EAPI Eina_Bool        elm_widget_access(Evas_Object *obj, Eina_Bool is_access);
 EAPI Efl_Ui_Theme_Apply  elm_widget_theme(Evas_Object *obj);
 EAPI void             elm_widget_theme_specific(Evas_Object *obj, Elm_Theme *th, Eina_Bool force);
-EAPI void             elm_widget_translate(Evas_Object *obj);
+EAPI void             efl_ui_translatable_translation_update(Evas_Object *obj);
 EAPI 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);
 EAPI Eina_Bool        elm_widget_sub_object_parent_add(Evas_Object *sobj);
 EAPI Eina_Bool        elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj);