QgsTranslationContext class

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

Constructors, destructors, conversion operators

QgsTranslationContext() defaulted
Constructor.

Public functions

auto fileName() const -> QString
Returns the TS fileName.
auto project() const -> QgsProject*
Returns the project.
void registerTranslation(const QString& context, const QString& source)
Registers the source to be translated.
void setFileName(const QString& fileName)
Sets the fileName of the TS file.
void setProject(QgsProject* project)
Sets the project being translated.
void writeTsFile(const QString& locale)
Writes the Ts-file.

Function documentation

QString QgsTranslationContext::fileName() const

Returns the TS fileName.

QgsProject* QgsTranslationContext::project() const

Returns the project.

void QgsTranslationContext::registerTranslation(const QString& context, const QString& source)

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.

void QgsTranslationContext::setFileName(const QString& fileName)

Sets the fileName of the TS file.

void QgsTranslationContext::setProject(QgsProject* project)

Sets the project being translated.