This class offers runtime translation of strings. More...
#include <CI18nTranslator.h>
Public Member Functions | |
bool | shouldBeTranslatedAttribute (string inAttribute) const |
should a given attribute string be translated? | |
bool | shouldBeTranslatedText (string inContainingTag) const |
should a given attribute string be translated? | |
void | setCurrentLanguage (const string &inLanguage) |
set the current language during construction | |
string | getCurrentLanguage () const |
set the current language during construction | |
void | setShouldBeTranslatedAttribute (string inString) |
Should the attribute be translated. | |
void | addTranslationPair (string inString, string inTranslatedString) |
Add one translation pair. | |
CI18nTranslator (string inTranslationFileName) | |
The constructor. | |
const CXMLElement * | getLanguagesXML () const |
Get an MRML tag containing all offered languages. | |
bool | hasLanguage (string inLanguageCode) const |
Get a string list containing all languages. | |
const pair< bool, string > | translateAttribute (string inLanguageCode, const string &inAttribute, const string &inValue) const |
Translate an attribute given by its name and its value. | |
const pair< bool, string > | translateText (string inLanguageCode, const string &inContainingTag, const string &inText) |
Translate an tag containing pdata given by its name and its value. | |
void | translateXMLTree (string inLanguageCode, CXMLElement &inoutToBeTranslated) const |
Translate a complete XML Tree. |
Static Public Member Functions | |
static void | startXMLElement (void *inUserData, const char *inElementName, const char **inAttributes) |
for parsing the config file | |
static void | endXMLElement (void *inUserData, const char *inElementName) |
for parsing the config file |
This class offers runtime translation of strings.
In contrast to GNU gettext we can chose during runtime the language without additional overhead.
const pair<bool,string> CI18nTranslator::translateAttribute | ( | string | inLanguageCode, |
const string & | inAttribute, | ||
const string & | inValue | ||
) | const |
Translate an attribute given by its name and its value.
const pair<bool,string> CI18nTranslator::translateText | ( | string | inLanguageCode, |
const string & | inContainingTag, | ||
const string & | inText | ||
) |
Translate an tag containing pdata given by its name and its value.