Back to index

salome-gui  6.5.0
Public Member Functions
QtxTranslator Class Reference

Extended version of QTranslator. More...

#include <QtxTranslator.h>

List of all members.

Public Member Functions

 QtxTranslator (QObject *parent=0)
 ~QtxTranslator ()
virtual QString translate (const char *, const char *, const char *=0) const
 Returns the translation for the key.

Detailed Description

Extended version of QTranslator.

In addition to the functionality provided by QTranslator class, QtxTranslator allows translating resources defined in the global context (i.e. common resources). The QtxTranslator can be used to workaround QTranslator's limitation which does not allow to process messages with global context.

For the current moment global context should be specified in translation (*.ts/*.qm) files as "@default" string. For example:

        <translation>My translated message</translation>

Definition at line 28 of file QtxTranslator.h.

Constructor & Destructor Documentation


Definition at line 54 of file QtxTranslator.cxx.

: QTranslator( parent )


Definition at line 62 of file QtxTranslator.cxx.


Member Function Documentation

QString QtxTranslator::translate ( const char *  context,
const char *  sourceText,
const char *  comment = 0 
) const [virtual]

Returns the translation for the key.

contextmessage context
sourceTextmessage source name
commentmessage comment (optional)
Translated text if found or sourceText otherwise

Definition at line 73 of file QtxTranslator.cxx.

  QString res = QTranslator::translate( context, sourceText, comment );
  if( res.isNull() )
    res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment );
  return res;

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