diff options
Diffstat (limited to 'src/common/Common.cpp')
-rw-r--r-- | src/common/Common.cpp | 11 |
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 } |