summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-25 16:12:28 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-26 17:58:07 +0900
commitc9f51e450b33e3ba6d5c66434f9fb38081b0efb7 (patch)
tree29096af891ac88b8813d86c49a5e79702face783 /src/lib/elementary
parent5f96c6fb4b09e45b5de18d7c8cb6a28fca8a489a (diff)
widget: Fix translation of default text parts
Note: fileselector uses this translation API Ref T5363
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_button.eo3
-rw-r--r--src/lib/elementary/efl_ui_frame.eo4
-rw-r--r--src/lib/elementary/efl_ui_slider.eo3
-rw-r--r--src/lib/elementary/elm_notify.c15
-rw-r--r--src/lib/elementary/elm_notify_part.eo4
-rw-r--r--src/lib/elementary/elm_part_helper.h10
6 files changed, 35 insertions, 4 deletions
diff --git a/src/lib/elementary/efl_ui_button.eo b/src/lib/elementary/efl_ui_button.eo
index 1065d14b3d..021c8229b2 100644
--- a/src/lib/elementary/efl_ui_button.eo
+++ b/src/lib/elementary/efl_ui_button.eo
@@ -1,5 +1,5 @@
1class Efl.Ui.Button (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Autorepeat, Efl.Text, 1class Efl.Ui.Button (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Autorepeat, Efl.Text,
2 Elm.Interface.Atspi_Widget_Action) 2 Elm.Interface.Atspi_Widget_Action, Efl.Ui.Translatable)
3{ 3{
4 [[Push-button widget 4 [[Push-button widget
5 5
@@ -25,5 +25,6 @@ class Efl.Ui.Button (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Autorepeat, Efl.Tex
25 Elm.Interface.Atspi_Widget_Action.elm_actions { get; } 25 Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
26 Efl.Part.part; 26 Efl.Part.part;
27 Efl.Text.text { get; set; } 27 Efl.Text.text { get; set; }
28 Efl.Ui.Translatable.translatable_text { get; set; }
28 } 29 }
29} 30}
diff --git a/src/lib/elementary/efl_ui_frame.eo b/src/lib/elementary/efl_ui_frame.eo
index 7983c81f0a..21e305c458 100644
--- a/src/lib/elementary/efl_ui_frame.eo
+++ b/src/lib/elementary/efl_ui_frame.eo
@@ -1,4 +1,5 @@
1class Efl.Ui.Frame (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Text) 1class Efl.Ui.Frame (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Text,
2 Efl.Ui.Translatable)
2{ 3{
3 [[Frame widget 4 [[Frame widget
4 5
@@ -61,5 +62,6 @@ class Efl.Ui.Frame (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Text)
61 Elm.Widget.focus_next; 62 Elm.Widget.focus_next;
62 Elm.Widget.focus_direction_manager_is; 63 Elm.Widget.focus_direction_manager_is;
63 Efl.Text.text { get; set; } 64 Efl.Text.text { get; set; }
65 Efl.Ui.Translatable.translatable_text { get; set; }
64 } 66 }
65} 67}
diff --git a/src/lib/elementary/efl_ui_slider.eo b/src/lib/elementary/efl_ui_slider.eo
index c26ab11b3e..0e7d21a153 100644
--- a/src/lib/elementary/efl_ui_slider.eo
+++ b/src/lib/elementary/efl_ui_slider.eo
@@ -2,7 +2,7 @@ type slider_func_type: __undefined_type; [[Elementary slider function type]]
2type slider_freefunc_type: __undefined_type; [[Elementary slider free function type]] 2type slider_freefunc_type: __undefined_type; [[Elementary slider free function type]]
3 3
4class Efl.Ui.Slider (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction, 4class Efl.Ui.Slider (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction,
5 Efl.Access.Value, Efl.Text, 5 Efl.Access.Value, Efl.Text, Efl.Ui.Translatable,
6 Elm.Interface.Atspi_Widget_Action) 6 Elm.Interface.Atspi_Widget_Action)
7{ 7{
8 [[Elementary slider class]] 8 [[Elementary slider class]]
@@ -130,6 +130,7 @@ class Efl.Ui.Slider (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction,
130 Efl.Access.Value.increment { get; } 130 Efl.Access.Value.increment { get; }
131 Elm.Interface.Atspi_Widget_Action.elm_actions { get; } 131 Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
132 Efl.Text.text { get; set; } 132 Efl.Text.text { get; set; }
133 Efl.Ui.Translatable.translatable_text { get; set; }
133 } 134 }
134 events { 135 events {
135 changed; [[Called when slider changed]] 136 changed; [[Called when slider changed]]
diff --git a/src/lib/elementary/elm_notify.c b/src/lib/elementary/elm_notify.c
index f4f97dcd01..1a71e67227 100644
--- a/src/lib/elementary/elm_notify.c
+++ b/src/lib/elementary/elm_notify.c
@@ -747,6 +747,21 @@ ELM_PART_OVERRIDE_CONTENT_SET(elm_notify, ELM_NOTIFY, Elm_Notify_Data)
747ELM_PART_OVERRIDE_CONTENT_GET(elm_notify, ELM_NOTIFY, Elm_Notify_Data) 747ELM_PART_OVERRIDE_CONTENT_GET(elm_notify, ELM_NOTIFY, Elm_Notify_Data)
748ELM_PART_OVERRIDE_CONTENT_UNSET(elm_notify, ELM_NOTIFY, Elm_Notify_Data) 748ELM_PART_OVERRIDE_CONTENT_UNSET(elm_notify, ELM_NOTIFY, Elm_Notify_Data)
749ELM_PART_CONTENT_DEFAULT_SET(elm_notify, "default") 749ELM_PART_CONTENT_DEFAULT_SET(elm_notify, "default")
750
751EOLIAN static const char *
752_elm_notify_part_efl_ui_translatable_translatable_text_get(Eo *obj, void *_pd EINA_UNUSED, const char **domain)
753{
754 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
755 return elm_widget_part_translatable_text_get(pd->obj, pd->part, domain);
756}
757
758EOLIAN static void
759_elm_notify_part_efl_ui_translatable_translatable_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *label, const char *domain)
760{
761 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
762 elm_widget_part_translatable_text_set(pd->obj, pd->part, label, domain);
763}
764
750#include "elm_notify_part.eo.c" 765#include "elm_notify_part.eo.c"
751 766
752/* Efl.Part end */ 767/* Efl.Part end */
diff --git a/src/lib/elementary/elm_notify_part.eo b/src/lib/elementary/elm_notify_part.eo
index 536d3b1cb1..40339b9e2c 100644
--- a/src/lib/elementary/elm_notify_part.eo
+++ b/src/lib/elementary/elm_notify_part.eo
@@ -1,9 +1,11 @@
1class Elm.Notify.Part (Efl.Ui.Widget.Part, Efl.Container, Efl.Text) 1class Elm.Notify.Part (Efl.Ui.Widget.Part, Efl.Container, Efl.Text,
2 Efl.Ui.Translatable)
2{ 3{
3 [[Elementary notification internel part class]] 4 [[Elementary notification internel part class]]
4 data: null; 5 data: null;
5 implements { 6 implements {
6 Efl.Text.text { get; set; } 7 Efl.Text.text { get; set; }
8 Efl.Ui.Translatable.translatable_text { get; set; }
7 Efl.Container.content { get; set; } 9 Efl.Container.content { get; set; }
8 Efl.Container.content_unset; 10 Efl.Container.content_unset;
9 } 11 }
diff --git a/src/lib/elementary/elm_part_helper.h b/src/lib/elementary/elm_part_helper.h
index 08612ff1df..bf84b5710a 100644
--- a/src/lib/elementary/elm_part_helper.h
+++ b/src/lib/elementary/elm_part_helper.h
@@ -150,6 +150,16 @@ EOLIAN static const char * \
150_ ## type ## _efl_text_text_get(Eo *obj, Type *pd EINA_UNUSED) \ 150_ ## type ## _efl_text_text_get(Eo *obj, Type *pd EINA_UNUSED) \
151{ \ 151{ \
152 return efl_text_get(efl_part(efl_super(obj, MY_CLASS), "elm.text")); \ 152 return efl_text_get(efl_part(efl_super(obj, MY_CLASS), "elm.text")); \
153} \
154EOLIAN static void \
155_ ## type ## _efl_ui_translatable_translatable_text_set(Eo *obj, Type *pd EINA_UNUSED, const char *label, const char *domain) \
156{ \
157 efl_ui_translatable_text_set(efl_part(efl_super(obj, MY_CLASS), "elm.text"), label, domain); \
158} \
159EOLIAN static const char * \
160_ ## type ## _efl_ui_translatable_translatable_text_get(Eo *obj, Type *pd EINA_UNUSED, const char **domain) \
161{ \
162 return efl_ui_translatable_text_get(efl_part(efl_super(obj, MY_CLASS), "elm.text"), domain); \
153} 163}
154 164
155#endif 165#endif