Class: QgsTranslationContext¶
Used for the collecting of strings from projects for translation and creation of ts files.
Added in version 3.4.
Methods
Returns the TS fileName  | 
|
Returns the project  | 
|
Registers the source to be translated.  | 
|
Sets the fileName of the TS file  | 
|
Sets the project being translated.  | 
|
Writes the Ts-file  | 
- class qgis.core.QgsTranslationContext[source]¶
 Bases:
object- project(self) QgsProject | None[source]¶
 Returns the project
See also
- Return type:
 Optional[QgsProject]
- registerTranslation(self, context: str | None, source: str | None)[source]¶
 Registers the
sourceto be translated. It’s the text of the object needed to be translated. Thecontextdefines in what context the object is used. Means layer name and sub category of object needed to be translated.- Parameters:
 context (Optional[str])
source (Optional[str])
- setFileName(self, fileName: str | None)[source]¶
 Sets the
fileNameof the TS fileSee also
- Parameters:
 fileName (Optional[str])
- setProject(self, project: QgsProject | None)[source]¶
 Sets the
projectbeing translated.See also
- Parameters:
 project (Optional[QgsProject])