QGIS API Documentation  3.6.0-Noosa (5873452)
Public Member Functions | List of all members
QgsProjectTranslator Class Referenceabstract

Wherever an object of this class is available, the derived translate function can be called from. More...

#include <qgsprojecttranslator.h>

Inheritance diagram for QgsProjectTranslator:
Inheritance graph
[legend]

Public Member Functions

virtual ~QgsProjectTranslator ()=default
 
virtual QString translate (const QString &context, const QString &sourceText, const char *disambiguation=nullptr, int n=-1) const =0
 The derived translate() translates with QTranslator and qm file the sourceText. More...
 

Detailed Description

Wherever an object of this class is available, the derived translate function can be called from.

Since
QGIS 3.4

Definition at line 30 of file qgsprojecttranslator.h.

Constructor & Destructor Documentation

◆ ~QgsProjectTranslator()

virtual QgsProjectTranslator::~QgsProjectTranslator ( )
virtualdefault

Member Function Documentation

◆ translate()

virtual QString QgsProjectTranslator::translate ( const QString &  context,
const QString &  sourceText,
const char *  disambiguation = nullptr,
int  n = -1 
) const
pure virtual

The derived translate() translates with QTranslator and qm file the sourceText.

It

Returns
the result string and in case there is no QTranslator loaded, the sourceText. This function can be called from wherever the QgsReadWriteContext is available.
Parameters
contextdescribing layer etc.
sourceTextis the identifier of this text
disambiguationit's the disambiguation
nif -1 uses the appropriate form
Since
QGIS 3.4

Implemented in QgsProject.


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