summaryrefslogtreecommitdiff
path: root/src/common/Common.cpp
diff options
context:
space:
mode:
authorKitzunu <24550914+Kitzunu@users.noreply.github.com>2025-01-27 11:07:46 +0100
committerGitHub <noreply@github.com>2025-01-27 11:07:46 +0100
commit9b3d54dd6078698396ea473559f8f537684024cc (patch)
treefa716f20df354e23bf4b3df888f0d5ac2bf5cb6d /src/common/Common.cpp
parent8f16de2084404ff1a11e563c5e8349223c4379a1 (diff)
refactor(Core/Motd): improve and simplify (#21252)
Diffstat (limited to 'src/common/Common.cpp')
-rw-r--r--src/common/Common.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/common/Common.cpp b/src/common/Common.cpp
index e25611e068..530dec961f 100644
--- a/src/common/Common.cpp
+++ b/src/common/Common.cpp
@@ -30,13 +30,20 @@ char const* localeNames[TOTAL_LOCALES] =
"ruRU"
};
+bool IsLocaleValid(std::string const& locale)
+{
+ for (int i = 0; i < TOTAL_LOCALES; ++i)
+ if (locale == localeNames[i])
+ return true;
+
+ return false;
+}
+
LocaleConstant GetLocaleByName(const std::string& name)
{
for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
if (name == localeNames[i])
- {
return LocaleConstant(i);
- }
return LOCALE_enUS; // including enGB case
}