Classified ads
|
Class for translating strings. More...
#include <catranslator.h>
Public Member Functions | |
CATranslator (QObject *aParent=NULL) | |
~CATranslator () | |
virtual QString | translate (const char *aContext, const char *aSourceText, const char *aDisambiguation=0) const |
virtual bool | isEmpty () const |
Class for translating strings.
Class for providing translations. In practice this wraps gnu gettext but may have also other sources of translations. Note that Qt allows multiple translators to be in cascade.
CATranslator::CATranslator | ( | QObject * | aParent = NULL | ) |
Constructor.
Has side-effect of initializing gnu gettext library inside. This same class may contain gnu gettext .po-file that is loaded here at constructor. It is still possible to use the QTranslator::load method to load Qt-format translation and when CATranslator::translate is called, this class will first search for .po file contents and if no match is made, then it will return the translation from possibly loaded Qt translation file.
CATranslator::~CATranslator | ( | ) |
Destructor
|
virtual |
|
virtual |
Actual translator method. This is used to return actual strings
aContext | string that tells in which context the aSourceText appears in. |
aSourceText | the actual string to be translated. |
aDisambiguation | if sourceText appears multiple times in same context, this may be used to further refine the translation. |
aPluralForm | Maybe used to select for singular/plural form of the translation e.g. "message received" or "messages received" |