diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-06-29 10:17:53 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-29 10:18:46 -0300 |
commit | 72ab3c22367c98735cc97402447b862b59b8557e (patch) | |
tree | 64ab5ac41f51ebb36172df1e9f306713a9acd79e /core | |
parent | ea108bed7941725b1da2e0e28d7c8dc23f4fff70 (diff) |
Do a second stage remap, so it considers translation first, atlas second, closes #5147
Diffstat (limited to 'core')
-rw-r--r-- | core/path_remap.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/core/path_remap.cpp b/core/path_remap.cpp index d4cb883f41..8f189187f2 100644 --- a/core/path_remap.cpp +++ b/core/path_remap.cpp @@ -59,12 +59,20 @@ String PathRemap::get_remap(const String& p_from) const { return p_from; } else { + const RemapData *ptr2=NULL; + String locale = TranslationServer::get_singleton()->get_locale(); if (ptr->locale.has(locale)) { if (OS::get_singleton()->is_stdout_verbose()) print_line("remap found: "+p_from+" -> "+ptr->locale[locale]); - return ptr->locale[locale]; + + ptr2=remap.getptr(ptr->locale[locale]); + + if (ptr2 && ptr2->always!=String()) //may have atlas or export remap too + return ptr2->always; + else + return ptr->locale[locale]; } int p = locale.find("_"); @@ -73,7 +81,14 @@ String PathRemap::get_remap(const String& p_from) const { if (ptr->locale.has(locale)) { if (OS::get_singleton()->is_stdout_verbose()) print_line("remap found: "+p_from+" -> "+ptr->locale[locale]); - return ptr->locale[locale]; + + ptr2=remap.getptr(ptr->locale[locale]); + + if (ptr2 && ptr2->always!=String()) //may have atlas or export remap too + return ptr2->always; + else + return ptr->locale[locale]; + } } |