summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2022-07-29 09:30:29 -0500
committerDavid Snopek <dsnopek@gmail.com>2022-08-08 09:31:35 -0500
commit6bbc126c344c9b6999367e7795c8bc62a4007c21 (patch)
tree49197c191a77bd7ce3efffe278474ad25e7f541e /core
parent572629d4ee677a834815cdb9c9359fc818d0de59 (diff)
Fix locale resource remapping with binary conversion on export
Diffstat (limited to 'core')
-rw-r--r--core/io/resource_loader.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index fc4177004b..f6a0da4eb1 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -794,6 +794,8 @@ String ResourceLoader::_path_remap(const String &p_path, bool *r_translation_rem
// To find the path of the remapped resource, we extract the locale name after
// the last ':' to match the project locale.
+ // An extra remap may still be necessary afterwards due to the text -> binary converter on export.
+
String locale = TranslationServer::get_singleton()->get_locale();
ERR_FAIL_COND_V_MSG(locale.length() < 2, p_path, "Could not remap path '" + p_path + "' for translation as configured locale '" + locale + "' is invalid.");
@@ -823,12 +825,10 @@ String ResourceLoader::_path_remap(const String &p_path, bool *r_translation_rem
if (path_remaps.has(new_path)) {
new_path = path_remaps[new_path];
- }
-
- if (new_path == p_path) { // Did not remap.
+ } else {
// Try file remap.
Error err;
- Ref<FileAccess> f = FileAccess::open(p_path + ".remap", FileAccess::READ, &err);
+ Ref<FileAccess> f = FileAccess::open(new_path + ".remap", FileAccess::READ, &err);
if (f.is_valid()) {
VariantParser::StreamFile stream;
stream.f = f;