ewol::translate Namespace Reference
Functions | |
void | addPath (const std::string &_lib, const std::string &_path, bool _major=false) |
const std::string & | getPaths (const std::string &_lib) |
void | setLanguageDefault (const std::string &_lang) |
const std::string & | getLanguageDefault () |
void | setLanguage (const std::string &_lang) |
const std::string & | getLanguage () |
void | autoDetectLanguage () |
std::string | get (const std::string &_instance) |
Detailed Description
This is a simple interface to converte application display string in a generic current system language.
- Note
- : The current name of language reprenent the file name, then if you want to get the machine language in an other than generic passed, juste add it. Generic langage char: (all translation might be done in UTF-8 this simplify interface) English : "EN" French : "FR" German : "DE" Spanish : "SP" Japanese : "JA" Italian : "IT" Korean : "KO" Russian : "RU" Portuguese, Brazilian : "PT" Chinese : "ZH"
Function Documentation
§ addPath()
void ewol::translate::addPath | ( | const std::string & | _lib, |
const std::string & | _path, | ||
bool | _major = false |
||
) |
Set the path folder of the translation files.
- Parameters
-
[in] _lib Library name that the path depend [in] _path ETK generic path (DATA:... or /xxx) [in] _major This path is the major path (The last loaded, the one which overload all)
§ autoDetectLanguage()
void ewol::translate::autoDetectLanguage | ( | ) |
Automatic detection of the system language.
§ get()
std::string ewol::translate::get | ( | const std::string & | _instance | ) |
Translate a specific text (if not find, it will be retured the same text).
- Parameters
-
[in] _instance Text to translate.
- Returns
- The tranlated text.
§ getLanguage()
const std::string& ewol::translate::getLanguage | ( | ) |
Get the current language loaded.
- Returns
- The 2/3 char defining the language
§ getLanguageDefault()
const std::string& ewol::translate::getLanguageDefault | ( | ) |
Get the current language selected.
- Returns
- The 2/3 char defining the language
§ getPaths()
const std::string& ewol::translate::getPaths | ( | const std::string & | _lib | ) |
Get the current paths of the library.
- Parameters
-
[in] _lib Library name that the path depend
- Returns
- Path name.
§ setLanguage()
void ewol::translate::setLanguage | ( | const std::string & | _lang | ) |
Set the language to load data. when no data availlable, we get the default language.
- Parameters
-
[in] _lang Language to load : ("EN" for english, "FR" for french, "DE" for German, "SP" for spanish ...)
§ setLanguageDefault()
void ewol::translate::setLanguageDefault | ( | const std::string & | _lang | ) |
Set the default language to load data (the default language might contain all internal data for the basic application)
- Parameters
-
[in] _lang Language to load : ("EN" for english, "FR" for french, "DE" for German, "SP" for spanish ...)