aboutsummaryrefslogtreecommitdiff
path: root/src/common/Common.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-06-30 00:22:25 +0200
committerShauren <shauren.trinity@gmail.com>2020-06-30 00:22:25 +0200
commit79cd94d26df33a332586b2aa72a99b123199c88f (patch)
treedba4de419d8c470b4f932702d0ba71da569c9e03 /src/common/Common.cpp
parent40c71ea9fca547f2a6fd547cb1cd35af361c4f3c (diff)
Core/Misc: Changed GetLocaleByName to return invalid value on invalid input instead of LOCALE_enUS
* Also added IsValidLocale helper function
Diffstat (limited to 'src/common/Common.cpp')
-rw-r--r--src/common/Common.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/Common.cpp b/src/common/Common.cpp
index b768461e274..a176941e6f9 100644
--- a/src/common/Common.cpp
+++ b/src/common/Common.cpp
@@ -33,11 +33,11 @@ char const* localeNames[TOTAL_LOCALES] =
"itIT"
};
-LocaleConstant GetLocaleByName(const std::string& name)
+LocaleConstant GetLocaleByName(std::string const& name)
{
for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
if (name == localeNames[i])
return LocaleConstant(i);
- return LOCALE_enUS; // including enGB case
+ return TOTAL_LOCALES;
}