Class: QgsTranslationContext¶
- class qgis.core.QgsTranslationContext¶
Bases:
sip.wrapper
Used for the collecting of strings from projects for translation and creation of ts files.
New in version 3.4.
QgsTranslationContext() Constructor
QgsTranslationContext(
QgsTranslationContext
)Methods
Returns the TS fileName
Returns the project
Registers the
source
to be translated.Sets the
fileName
of the TS fileSets the
project
being translated.Writes the Ts-file
- fileName(self) str ¶
Returns the TS fileName
See also
- Return type
str
- project(self) QgsProject ¶
Returns the project
See also
- Return type
- registerTranslation(self, context: str, source: str)¶
Registers the
source
to be translated. It’s the text of the object needed to be translated. Thecontext
defines in what context the object is used. Means layer name and sub category of object needed to be translated.- Parameters
context (str) –
source (str) –
- setFileName(self, fileName: str)¶
Sets the
fileName
of the TS fileSee also
- Parameters
fileName (str) –
- setProject(self, project: QgsProject)¶
Sets the
project
being translated.See also
- Parameters
project (QgsProject) –
- writeTsFile(self, locale: str)¶
Writes the Ts-file
- Parameters
locale (str) –