summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_translatable.eo
blob: ebd7685b24d2e3679f506e2ef46ab2e91baed17a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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? */
   }
}