forked from jtownley/kivy-gettext-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlang.kv
45 lines (32 loc) · 1.01 KB
/
lang.kv
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
#:kivy 1.9.0
#:import _ __main__._
<I18NLabel>:
text: app.translation(self.source_text)
<I18NButton@Button>: # Dynamic Classes, performs these actions when a Button is pressed
source_text: ''
text: app.translation(self.source_text)
font_name: app.app_font_namey
<I18NLabel@Button>: # Dynamic Classes, performs these actions when a Button is pressed
font_name: app.app_font_namey
BoxLayout:
orientation: 'vertical'
I18NLabel:
source_text: _('Hello World')
I18NLabel:
source_text: _('How are you?')
BoxLayout:
size_hint_y: None
height: '48dp'
spacing: '2dp'
padding: '3dp'
I18NButton:
source_text: _('French')
on_release: app.lang = 'fr'
I18NButton:
source_text: _('English')
on_release: app.lang = 'en'
I18NButton:
source_text: _('Chinese')
on_release: app.lang = 'zh_hant'
MySpecialLabel:
color: [1.0, 0.5, 0.5, 1.0]