Class: QgsProjectTranslator

class qgis.core.QgsProjectTranslator

Bases: sip.wrapper

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

New in version 3.4: Enums

Methods

translate

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

Signals

Attributes

translate(self, context: str, sourceText: str, disambiguation: str = None, n: int = -1) → str

The derived translate() translates with QTranslator and qm file the sourceText. It :return: 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
  • context – describing layer etc.

  • sourceText – is the identifier of this text

  • disambiguation – it’s the disambiguation

  • n – if -1 uses the appropriate form

New in version 3.4.