Subgroup: other

Class: QgsTranslationContext

class qgis.core.QgsTranslationContext

Bases: sip.wrapper

Constructor

QgsTranslationContext(QgsTranslationContext)

Used for the collecting of strings from projects for translation and creation of ts files.

New in version 3.4: Methods

fileName Returns the TS fileName
project Returns the project
registerTranslation Registers the source to be translated.
setFileName Sets the fileName of the TS file
setProject Sets the project being translated.
writeTsFile Writes the Ts-file

Signals

Attributes

fileName(self) → str

Returns the TS fileName

See also

setFileName()

project(self) → QgsProject

Returns the project

See also

setProject()

registerTranslation(self, context: str, source: str)

Registers the source to be translated. It’s the text of the object needed to be translated. The context defines in what context the object is used. Means layer name and sub category of object needed to be translated.

setFileName(self, fileName: str)

Sets the fileName of the TS file

See also

fileName()

setProject(self, project: QgsProject)

Sets the project being translated.

See also

project()

writeTsFile(self, locale: str)

Writes the Ts-file