From 82527df55c02ba6a7ee653a47386758017564f10 Mon Sep 17 00:00:00 2001 From: raphaelazev Date: Fri, 10 Dec 2021 17:05:42 -0300 Subject: [PATCH] Added check to get_all_locales to avoid adding duplicate locales to array --- core/string/translation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/string/translation.cpp b/core/string/translation.cpp index 73f789b041d..865937e9ce8 100644 --- a/core/string/translation.cpp +++ b/core/string/translation.cpp @@ -1092,9 +1092,12 @@ Array TranslationServer::get_loaded_locales() const { ERR_FAIL_COND_V(t.is_null(), Array()); String l = t->get_locale(); - locales.push_back(l); + if (!locales.has(l)) { + locales.push_back(l); + } } + locales.sort(); return locales; }