QgsProjectTranslator class

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

Contents

Derived classes

class QgsProject
Reads and writes project states.

Public functions

auto translate(const QString& context, const QString& sourceText, const char* disambiguation = nullptr, int n = -1) const -> QString pure virtual
The derived translate() translates with QTranslator and qm file the sourceText.

Function documentation

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.

Parameters
context describing layer etc.
sourceText is the identifier of this text
disambiguation it's the disambiguation
n if -1 uses the appropriate form
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.

It