summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_widget.eo
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/elm_widget.eo
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/elm_widget.eo')
-rw-r--r--src/lib/elementary/elm_widget.eo12
1 files changed, 3 insertions, 9 deletions
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 {