1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Reworked translation system

-Label and Button reload translation on the fly
-Resources are loaded and reload depending on locale
This commit is contained in:
Juan Linietsky
2017-06-28 17:00:18 -03:00
parent 9e54e1f34f
commit db3b05d289
23 changed files with 248 additions and 52 deletions

View File

@@ -689,6 +689,7 @@ Error ResourceInteractiveLoaderBinary::poll() {
f->close();
resource = res;
resource->set_as_translation_remapped(translation_remapped);
error = ERR_FILE_EOF;
} else {
@@ -706,6 +707,11 @@ int ResourceInteractiveLoaderBinary::get_stage_count() const {
return external_resources.size() + internal_resources.size();
}
void ResourceInteractiveLoaderBinary::set_translation_remapped(bool p_remapped) {
translation_remapped = p_remapped;
}
static void save_ustring(FileAccess *f, const String &p_string) {
CharString utf8 = p_string.utf8();
@@ -920,6 +926,7 @@ ResourceInteractiveLoaderBinary::ResourceInteractiveLoaderBinary() {
endian_swap = false;
use_real64 = false;
error = OK;
translation_remapped = false;
}
ResourceInteractiveLoaderBinary::~ResourceInteractiveLoaderBinary() {