-Fixed bug in translation remaps, also added proper demo, maybe fixes #1729

This commit is contained in:
Juan Linietsky 2015-05-12 07:31:15 -03:00
parent dc3d0bdf38
commit 4363798608
8 changed files with 24 additions and 2 deletions

View file

@ -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

Binary file not shown.

View file

@ -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"]}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

View file

@ -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;