2 #ifndef _CI18NTRANSLATOR
3 #define _CI18NTRANSLATOR
30 #include "libMRML/include/CXMLElement.h"
40 typedef map<string,string> CTranslatorMap;
43 typedef map<string,bool> CShouldBeTranslatedMap;
45 typedef map<string,CTranslatorMap> CLanguageMap;
51 CLanguageMap mLanguageMap;
55 CShouldBeTranslatedMap mShouldBeTranslatedAttribute;
59 string mCurrentLanguage;
88 const string& inAttribute,
89 const string& inValue)
const;
95 const string& inContainingTag,
96 const string& inText);
102 const char *inElementName,
103 const char **inAttributes);
106 const char *inElementName);
void translateXMLTree(string inLanguageCode, CXMLElement &inoutToBeTranslated) const
Translate a complete XML Tree.
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.
const pair< bool, string > translateAttribute(string inLanguageCode, const string &inAttribute, const string &inValue) const
Translate an attribute given by its name and its value.
string getCurrentLanguage() const
set the current language during construction
This class captures the structure of an XML element.
Definition: CXMLElement.h:51
bool shouldBeTranslatedText(string inContainingTag) const
should a given attribute string be translated?
bool shouldBeTranslatedAttribute(string inAttribute) const
should a given attribute string be translated?
CI18nTranslator(string inTranslationFileName)
The constructor.
void setShouldBeTranslatedAttribute(string inString)
Should the attribute be translated.
This class offers runtime translation of strings.
Definition: CI18nTranslator.h:38
void addTranslationPair(string inString, string inTranslatedString)
Add one translation pair.
static void endXMLElement(void *inUserData, const char *inElementName)
for parsing the config file
static void startXMLElement(void *inUserData, const char *inElementName, const char **inAttributes)
for parsing the config file
void setCurrentLanguage(const string &inLanguage)
set the current language during construction
const CXMLElement * getLanguagesXML() const
Get an MRML tag containing all offered languages.
bool hasLanguage(string inLanguageCode) const
Get a string list containing all languages.