summaryrefslogtreecommitdiff
path: root/core/string
diff options
context:
space:
mode:
authorraphaelazev <raphaelazev@hotmail.com>2021-12-10 17:05:42 -0300
committerraphaelazev <raphaelazev@hotmail.com>2021-12-10 19:25:59 -0300
commit82527df55c02ba6a7ee653a47386758017564f10 (patch)
tree5d0f178d2017204501db7acb687675a8ac922424 /core/string
parente69fa16eb3cd4cf4a591eb4c533b9eff45f79850 (diff)
Added check to get_all_locales to avoid adding duplicate locales to array
Diffstat (limited to 'core/string')
-rw-r--r--core/string/translation.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/string/translation.cpp b/core/string/translation.cpp
index 73f789b041..865937e9ce 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;
}