aboutsummaryrefslogtreecommitdiff
path: root/demos/gui/translation
diff options
context:
space:
mode:
authorRémi Verschelde2015-12-09 08:38:23 +0100
committerRémi Verschelde2015-12-09 08:38:23 +0100
commit8639cecf4cedd56452b47503be19c44b304cd02f (patch)
treee2a795da15e40c7d9d5b82e33378f8dbf0eaf67a /demos/gui/translation
parentefbb834936fdc9da9789ad37c9cc61e0b90cda95 (diff)
downloadgodot-8639cecf4cedd56452b47503be19c44b304cd02f.tar.gz
godot-8639cecf4cedd56452b47503be19c44b304cd02f.tar.zst
godot-8639cecf4cedd56452b47503be19c44b304cd02f.zip
Improve code formatting and update to 2.0
The scripts were streamlined using more or less the following conventions: - space after a comma in lists of arguments - space around weak operators (+, -), no space around strong operators (*, /) - space after a comment start (#) - removed trailing spaces or tabs, apart from those that delimit the function indentation level (those could be removed too but since they are added automatically by the editor when typing code, keeping them for now) - function blocks separate by two newlines The scene files were resaved with the (current) 2.0 format, and some scenes that were in XML format were converted to SCN, to be consistent across all demos.
Diffstat (limited to 'demos/gui/translation')
-rw-r--r--demos/gui/translation/controls.gd11
-rw-r--r--demos/gui/translation/controls.scnbin2349 -> 2272 bytes
-rw-r--r--demos/gui/translation/main.gd18
-rw-r--r--demos/gui/translation/main.scnbin2671 -> 2939 bytes
4 files changed, 4 insertions, 25 deletions
diff --git a/demos/gui/translation/controls.gd b/demos/gui/translation/controls.gd
index f8403f49a..ae2e26362 100644
--- a/demos/gui/translation/controls.gd
+++ b/demos/gui/translation/controls.gd
@@ -1,20 +1,9 @@
extends Panel
-# member variables here, example:
-# var a=2
-# var b="textvar"
-
-func _ready():
- # Initialization here
- pass
-
-
-
func _on_back_pressed():
var s = load("res://main.scn")
var si = s.instance()
get_parent().add_child(si)
queue_free()
- pass # replace with function body
diff --git a/demos/gui/translation/controls.scn b/demos/gui/translation/controls.scn
index 66e6d4770..055ac90b9 100644
--- a/demos/gui/translation/controls.scn
+++ b/demos/gui/translation/controls.scn
Binary files differ
diff --git a/demos/gui/translation/main.gd b/demos/gui/translation/main.gd
index bf3c0c084..9b188cd58 100644
--- a/demos/gui/translation/main.gd
+++ b/demos/gui/translation/main.gd
@@ -1,31 +1,21 @@
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
+ # 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.
+# NOTE: Changing 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")
diff --git a/demos/gui/translation/main.scn b/demos/gui/translation/main.scn
index 76c9ba7b4..8fc0b4ffb 100644
--- a/demos/gui/translation/main.scn
+++ b/demos/gui/translation/main.scn
Binary files differ