From 829349d2ca6e49eaf0703154467ee8020484b387 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:17:22 +0200 Subject: [PATCH] Do not reload resources and send notification if locale is not changed. --- core/string/translation.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/string/translation.cpp b/core/string/translation.cpp index a443ed308d6..8fcf2b24b58 100644 --- a/core/string/translation.cpp +++ b/core/string/translation.cpp @@ -518,8 +518,12 @@ String TranslationServer::get_country_name(const String &p_country) const { } void TranslationServer::set_locale(const String &p_locale) { - locale = standardize_locale(p_locale); + String new_locale = standardize_locale(p_locale); + if (locale == new_locale) { + return; + } + locale = new_locale; ResourceLoader::reload_translation_remaps(); if (OS::get_singleton()->get_main_loop()) {