diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-05-11 22:34:29 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-05-11 22:34:29 -0300 |
commit | dc3d0bdf3809c8107db1d47b938edbfaa5aa332b (patch) | |
tree | 9f2259396ff83e4bbd01cd60aac3558310f0ae9d /demos/gui/translation | |
parent | 17ccd8d9b7c82ee4e3448c4923f9c1c8da4be1be (diff) |
Translation Demo
Diffstat (limited to 'demos/gui/translation')
-rw-r--r-- | demos/gui/translation/controls.scn | bin | 0 -> 1857 bytes | |||
-rw-r--r-- | demos/gui/translation/engine.cfg | 8 | ||||
-rw-r--r-- | demos/gui/translation/main.gd | 42 | ||||
-rw-r--r-- | demos/gui/translation/main.scn | bin | 0 -> 2051 bytes | |||
-rw-r--r-- | demos/gui/translation/noto.fnt | bin | 0 -> 9171 bytes | |||
-rw-r--r-- | demos/gui/translation/notosans.otf | bin | 0 -> 16426032 bytes | |||
-rw-r--r-- | demos/gui/translation/text.csv | 3 | ||||
-rw-r--r-- | demos/gui/translation/translations/text.en.xl | bin | 0 -> 575 bytes | |||
-rw-r--r-- | demos/gui/translation/translations/text.es.xl | bin | 0 -> 579 bytes | |||
-rw-r--r-- | demos/gui/translation/translations/text.ja.xl | bin | 0 -> 595 bytes |
10 files changed, 53 insertions, 0 deletions
diff --git a/demos/gui/translation/controls.scn b/demos/gui/translation/controls.scn Binary files differnew file mode 100644 index 0000000000..23e2413bc3 --- /dev/null +++ b/demos/gui/translation/controls.scn diff --git a/demos/gui/translation/engine.cfg b/demos/gui/translation/engine.cfg new file mode 100644 index 0000000000..4f01f200c6 --- /dev/null +++ b/demos/gui/translation/engine.cfg @@ -0,0 +1,8 @@ +[application] + +name="Translation Demo" +main_scene="res://main.scn" + +[locale] + +translations=["res://translations/text.en.xl", "res://translations/text.es.xl", "res://translations/text.ja.xl"] diff --git a/demos/gui/translation/main.gd b/demos/gui/translation/main.gd new file mode 100644 index 0000000000..bf3c0c0840 --- /dev/null +++ b/demos/gui/translation/main.gd @@ -0,0 +1,42 @@ + +extends Panel + +# member variables here, example: +# var a=2 +# var b="textvar" + +func _ready(): + # Initialization here + pass + + + +func _goto_scene(): + var s = load("res://controls.scn") + var si = s.instance() + get_parent().add_child(si) + queue_free() + pass + + +func _on_system_pressed(): + #will autodetect based on system, then fall back + #to english if not found + _goto_scene() + +#NOTE: Changling locale will not change the text in the controls, +# The scene must be reloaded for changes to take effect. + +func _on_english_pressed(): + TranslationServer.set_locale("en") + _goto_scene() + + +func _on_spanish_pressed(): + TranslationServer.set_locale("es") + _goto_scene() + + +func _on_japanese_pressed(): + TranslationServer.set_locale("ja") + _goto_scene() diff --git a/demos/gui/translation/main.scn b/demos/gui/translation/main.scn Binary files differnew file mode 100644 index 0000000000..1e1bd0141e --- /dev/null +++ b/demos/gui/translation/main.scn diff --git a/demos/gui/translation/noto.fnt b/demos/gui/translation/noto.fnt Binary files differnew file mode 100644 index 0000000000..e019615f41 --- /dev/null +++ b/demos/gui/translation/noto.fnt diff --git a/demos/gui/translation/notosans.otf b/demos/gui/translation/notosans.otf Binary files differnew file mode 100644 index 0000000000..6443f9023e --- /dev/null +++ b/demos/gui/translation/notosans.otf diff --git a/demos/gui/translation/text.csv b/demos/gui/translation/text.csv new file mode 100644 index 0000000000..0f4c148b95 --- /dev/null +++ b/demos/gui/translation/text.csv @@ -0,0 +1,3 @@ +,en,es,ja +KEY_HELLO,Hello!,Hola!,こんにちは +KEY_PUSH,Push Me!,Aprétame!,私をプッシュ
\ No newline at end of file diff --git a/demos/gui/translation/translations/text.en.xl b/demos/gui/translation/translations/text.en.xl Binary files differnew file mode 100644 index 0000000000..7bcba63e71 --- /dev/null +++ b/demos/gui/translation/translations/text.en.xl diff --git a/demos/gui/translation/translations/text.es.xl b/demos/gui/translation/translations/text.es.xl Binary files differnew file mode 100644 index 0000000000..4474d955d5 --- /dev/null +++ b/demos/gui/translation/translations/text.es.xl diff --git a/demos/gui/translation/translations/text.ja.xl b/demos/gui/translation/translations/text.ja.xl Binary files differnew file mode 100644 index 0000000000..b3d1f0bf60 --- /dev/null +++ b/demos/gui/translation/translations/text.ja.xl |