|
| Localization () |
|
const std::string & | Translate (size_t pId) const |
|
template<typename E >
requires std::is_enum_v<E> |
const std::string & | Translate (E pId) const |
|
template<typename Num >
requires std::is_integral_v<Num> && (!std::same_as<Num, size_t>) |
const std::string & | Translate (Num pId) const |
|
void | AddTranslation (gwlanguage pLang, const char *pText) |
|
void | AddTranslation (gwlanguage pLang, const char8_t *pText) |
|
void | AddTranslation (gwlanguage pLang, const std::string &pText) |
|
void | Load (gwlanguage pLang, const std::ranges::common_range auto &pRange) |
|
void | ChangeLanguage (gwlanguage pLang) |
|
void | OverrideTranslation (gwlanguage pLanguage, size_t pTranslation, const std::string &pText) |
|
template<typename E >
requires std::is_enum_v<E> |
const std::string & | OverrideTranslation (gwlanguage pLanguage, E pTranslation, const std::string &pText) |
|
template<typename Num >
requires std::is_integral_v<Num> && (!std::same_as<Num, size_t>) |
void | OverrideTranslation (gwlanguage pLanguage, Num pTranslation, const std::string &pText) |
|
template<typename T > |
void | OverrideTranslation (gwlanguage pLanguage, T pTranslation, const std::string &pText) |
|
| ~Singleton () override |
|
virtual | ~BaseSingleton ()=default |
|
How to use:
Call Load()
with your translations you want to add. Things are added to the back of the list with all Extension
based translations at the beginning. So make sure, your IDs enum or whatever you use, starts with one higher than the last used one. Also make sure you add all 4 translations and they are of the same size. Call it within mod_init
or as early as possible.
Call ChangeLanguage
when you want to change the language. Call it once to setup the language the user has in mod_init