From 37a8a615e502a2a883c687da8abd32ad9efcea13 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 (cherry picked from commit 82527df55c02ba6a7ee653a47386758017564f10) --- core/translation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/translation.cpp b/core/translation.cpp index fda7192dc35..9b8cb060ac7 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -1011,9 +1011,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; }