From de48d5101b57991614db8d2a8f5e6a98badee11e Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Wed, 19 Jan 2022 16:46:48 +0200 Subject: Fix locale always selecting translation instead of "en", when no match found. --- core/string/translation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/string/translation.cpp') diff --git a/core/string/translation.cpp b/core/string/translation.cpp index 5d7e583de1..674098b06c 100644 --- a/core/string/translation.cpp +++ b/core/string/translation.cpp @@ -544,7 +544,7 @@ Ref TranslationServer::get_translation_object(const String &p_local String l = t->get_locale(); int score = compare_locales(p_locale, l); - if (score >= best_score) { + if (score > best_score) { res = t; best_score = score; if (score == 10) { @@ -617,7 +617,7 @@ StringName TranslationServer::_get_message_from_translations(const StringName &p String l = t->get_locale(); int score = compare_locales(p_locale, l); - if (score >= best_score) { + if (score > best_score) { StringName r; if (!plural) { res = t->get_message(p_message, p_context); -- cgit v1.2.3