System documentation of the GNU Image-Finding Tool

Public Member Functions | Static Public Member Functions | List of all members
CI18nTranslator Class Reference

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 CXMLElementgetLanguagesXML () 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. More...
 
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. More...
 
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
 

Detailed Description

This class offers runtime translation of strings.

In contrast to GNU gettext we can chose during runtime the language without additional overhead.

Member Function Documentation

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.

Returns
pair: first, if the string should be translated, second, 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.

Returns
pair: first, if the string should be translated, second, its value

The documentation for this class was generated from the following file:

Need for discussion? Want to contribute? Contact
help-gift@gnu.org Generated using Doxygen