etranslate Namespace Reference

Functions

void init (int _argc, const char **_argv)
 
void unInit ()
 
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

void etranslate::addPath ( const std::string &  _lib,
const std::string &  _path,
bool  _major = false 
)

Set the path folder of the translation files.

Parameters
[in]_libLibrary name that the path depend
[in]_pathETK generic path (DATA:... or /xxx)
[in]_majorThis path is the major path (The last loaded, the one which overload all)
void etranslate::autoDetectLanguage ( )

Automatic detection of the system language.

std::string etranslate::get ( const std::string &  _instance)

Translate a specific text (if not find, it will be retured the same text).

Parameters
[in]_instanceText to translate.
Returns
The tranlated text.
const std::string& etranslate::getLanguage ( )

Get the current language loaded.

Returns
The 2/3 char defining the language
const std::string& etranslate::getLanguageDefault ( )

Get the current language selected.

Returns
The 2/3 char defining the language
const std::string& etranslate::getPaths ( const std::string &  _lib)

Get the current paths of the library.

Parameters
[in]_libLibrary name that the path depend
Returns
Path name.
void etranslate::init ( int  _argc,
const char **  _argv 
)

Initialize etranslate.

Parameters
[in]_argcNumber of argument list
[in]_argvList of arguments
void etranslate::setLanguage ( const std::string &  _lang)

Set the language to load data. when no data availlable, we get the default language.

Parameters
[in]_langLanguage to load : ("EN" for english, "FR" for french, "DE" for German, "SP" for spanish ...)
void etranslate::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]_langLanguage to load : ("EN" for english, "FR" for french, "DE" for German, "SP" for spanish ...)
void etranslate::unInit ( )

Un-Initialize etranslate.