![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
Namespaces | |
namespace | detail |
Classes | |
class | LanguageData |
struct | LanguageEntry |
Functions | |
FWD_DECLARE_MANAGED_CLASS (LanguageData) | |
ErrorCode | Init (const char *newLanguage=DEFAULT_LANG) |
Reset everything and load the specified language file. | |
void | Clear () noexcept |
clear the language table | |
void | Idle () |
perform maintenance tasks | |
ErrorCode | ChangeLanguage (const char *newLanguage) |
void | SetChangeLanguageCallback (const DELEGATE< void, std::string_view > &cbk) |
Set a function to be called on each language change. | |
const Str< 64 > & | CurrentLanguage () noexcept |
Query the current language code to detect changes. | |
const char * | Get (U64 key, bool appendSection=true, const char *defaultValue=nullptr) |
Variables | |
constexpr const char * | DEFAULT_LANG = "enGB" |
constexpr const char *const | g_languageFileExtension = ".ini" |
ErrorCode Divide::Locale::ChangeLanguage | ( | const char * | newLanguage | ) |
Although the language can be set at compile time, in-game options may support language changes
Definition at line 163 of file Localization.cpp.
|
noexcept |
clear the language table
Definition at line 143 of file Localization.cpp.
|
noexcept |
Query the current language code to detect changes.
Definition at line 185 of file Localization.cpp.
Divide::Locale::FWD_DECLARE_MANAGED_CLASS | ( | LanguageData | ) |
const char * Divide::Locale::Get | ( | U64 | key, |
bool | appendSection = true , |
||
const char * | defaultValue = nullptr |
||
) |
usage: Locale::Get("A_B_C")) or Locale::Get("A_B_C"), true/false, "X") where "A_B_C" is the language key we want and "X" is a default string in case the key does not exist in the INI file appendSection will add [ sectionName ] in front of the returned string.
Definition at line 171 of file Localization.cpp.
void Divide::Locale::Idle | ( | ) |
perform maintenance tasks
Definition at line 152 of file Localization.cpp.
ErrorCode Divide::Locale::Init | ( | const char * | newLanguage = DEFAULT_LANG | ) |
Reset everything and load the specified language file.
Definition at line 120 of file Localization.cpp.
void Divide::Locale::SetChangeLanguageCallback | ( | const DELEGATE< void, std::string_view > & | cbk | ) |
Set a function to be called on each language change.
Definition at line 178 of file Localization.cpp.
|
constexpr |
Definition at line 44 of file Localization.h.
|
constexpr |
Definition at line 45 of file Localization.h.