summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-05-12 07:31:15 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-05-12 07:31:15 -0300
commit436379860855fe2d1b073a74f4bfa4e7acc96c5b (patch)
tree44e4b38a3de7808a0111dec582d03faaa44bf64d
parentdc3d0bdf3809c8107db1d47b938edbfaa5aa332b (diff)
-Fixed bug in translation remaps, also added proper demo, maybe fixes #1729
-rw-r--r--demos/gui/translation/controls.gd20
-rw-r--r--demos/gui/translation/controls.scnbin1857 -> 2349 bytes
-rw-r--r--demos/gui/translation/engine.cfg1
-rw-r--r--demos/gui/translation/flag_japan.pngbin0 -> 1473 bytes
-rw-r--r--demos/gui/translation/flag_spain.pngbin0 -> 3048 bytes
-rw-r--r--demos/gui/translation/flag_uk.pngbin0 -> 6544 bytes
-rw-r--r--demos/gui/translation/main.scnbin2051 -> 2671 bytes
-rw-r--r--tools/editor/project_settings.cpp5
8 files changed, 24 insertions, 2 deletions
diff --git a/demos/gui/translation/controls.gd b/demos/gui/translation/controls.gd
new file mode 100644
index 0000000000..f8403f49a7
--- /dev/null
+++ b/demos/gui/translation/controls.gd
@@ -0,0 +1,20 @@
+
+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 23e2413bc3..66e6d47702 100644
--- a/demos/gui/translation/controls.scn
+++ b/demos/gui/translation/controls.scn
Binary files differ
diff --git a/demos/gui/translation/engine.cfg b/demos/gui/translation/engine.cfg
index 4f01f200c6..169b65e154 100644
--- a/demos/gui/translation/engine.cfg
+++ b/demos/gui/translation/engine.cfg
@@ -6,3 +6,4 @@ main_scene="res://main.scn"
[locale]
translations=["res://translations/text.en.xl", "res://translations/text.es.xl", "res://translations/text.ja.xl"]
+translation_remaps={"res://flag_uk.png":["res://flag_spain.png:es", "res://flag_japan.png:ja"]}
diff --git a/demos/gui/translation/flag_japan.png b/demos/gui/translation/flag_japan.png
new file mode 100644
index 0000000000..4cc8267a5c
--- /dev/null
+++ b/demos/gui/translation/flag_japan.png
Binary files differ
diff --git a/demos/gui/translation/flag_spain.png b/demos/gui/translation/flag_spain.png
new file mode 100644
index 0000000000..4d00f93593
--- /dev/null
+++ b/demos/gui/translation/flag_spain.png
Binary files differ
diff --git a/demos/gui/translation/flag_uk.png b/demos/gui/translation/flag_uk.png
new file mode 100644
index 0000000000..53fbef3d67
--- /dev/null
+++ b/demos/gui/translation/flag_uk.png
Binary files differ
diff --git a/demos/gui/translation/main.scn b/demos/gui/translation/main.scn
index 1e1bd0141e..76c9ba7b45 100644
--- a/demos/gui/translation/main.scn
+++ b/demos/gui/translation/main.scn
Binary files differ
diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp
index 85adbd3a3b..08a1191f41 100644
--- a/tools/editor/project_settings.cpp
+++ b/tools/editor/project_settings.cpp
@@ -916,8 +916,8 @@ void ProjectSettings::_translation_res_option_changed() {
ERR_FAIL_COND(!remaps.has(key));
- StringArray r = remaps[key];
- ERR_FAIL_INDEX(idx,remaps.size());
+ StringArray r = remaps[key];
+ ERR_FAIL_INDEX(idx,r.size());
r.set(idx,path+":"+langs[which]);
remaps[key]=r;
@@ -1095,6 +1095,7 @@ void ProjectSettings::_update_translations() {
t2->set_editable(1,true);
t2->set_metadata(1,path);
int idx = langs.find(locale);
+ print_line("find "+locale+" at "+itos(idx));
if (idx<0)
idx=0;