diff options
author | Exitare <Exitare@users.noreply.github.com> | 2024-12-15 10:50:02 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-15 19:50:02 +0100 |
commit | 7fd8b04a564be4f9f5cebfaf9fa7e261de0733ac (patch) | |
tree | f52fe2dafd1b846863aedcc0eaf89af2369c6bb2 /src/common/Common.cpp | |
parent | 7732e1a5b2b383ff6905fd13e7ede5a697fe7647 (diff) |
feat(Core/Motd): Allow localized motd (#20542)
* Initial commit for localized motd
* Rename function that created world packages
* Update to satisfy code check
* Update code to accomodate localized motd
* Update command to support multiple optionales & adjusted db
* Code cleanup
* Update sql name
* Fix codestyle issues
* Remove hardcoded schema
* Add check for valid player in reload command
* Update to better code style
* Add missing include
* Fix redundant code usage
* Add missing include
* Remove sql files and create new rev sql files
* Address minor code reviews
* Fix code style
* Update code to address code revisions.
- Remove two unused functions
- Remove map
- Use available function to resolve LocaleConstant
* Fix code style
* Add check for base motd and update locale to DEFAULT_LOCALE
* Code docs
* Removed some docs, readd defaultd motd formatting
* Fix oversight in variable declaration
* Code style fix
* Update code based on code review
* ready for merge
* Fix set motd command due to changes to DEFAULT_LOCALE
* Fix CI
* Fix trailing whitespace
---------
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
Diffstat (limited to 'src/common/Common.cpp')
-rw-r--r-- | src/common/Common.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/Common.cpp b/src/common/Common.cpp index 435d83b396..e25611e068 100644 --- a/src/common/Common.cpp +++ b/src/common/Common.cpp @@ -41,6 +41,16 @@ LocaleConstant GetLocaleByName(const std::string& name) return LOCALE_enUS; // including enGB case } +const std::string GetNameByLocaleConstant(LocaleConstant localeConstant) +{ + if (localeConstant < TOTAL_LOCALES) + { + return localeNames[localeConstant]; + } + + return "enUS"; // Default value for unsupported or invalid LocaleConstant +} + void CleanStringForMysqlQuery(std::string& str) { std::string::size_type n = 0; |