QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Classes | Public Member Functions | List of all members
QgsTranslationContext Class Reference

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

#include <qgstranslationcontext.h>

Public Member Functions

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

Detailed Description

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

Since
QGIS 3.4

Definition at line 35 of file qgstranslationcontext.h.

Constructor & Destructor Documentation

◆ QgsTranslationContext()

QgsTranslationContext::QgsTranslationContext ( )
default

Constructor.

Member Function Documentation

◆ fileName()

QString QgsTranslationContext::fileName ( ) const

Returns the TS fileName.

See also
setFileName()

Definition at line 35 of file qgstranslationcontext.cpp.

◆ project()

QgsProject * QgsTranslationContext::project ( ) const

Returns the project.

See also
setProject()

Definition at line 25 of file qgstranslationcontext.cpp.

◆ registerTranslation()

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.

Definition at line 45 of file qgstranslationcontext.cpp.

◆ setFileName()

void QgsTranslationContext::setFileName ( const QString &  fileName)

Sets the fileName of the TS file.

See also
fileName()

Definition at line 40 of file qgstranslationcontext.cpp.

◆ setProject()

void QgsTranslationContext::setProject ( QgsProject project)

Sets the project being translated.

See also
project()

Definition at line 30 of file qgstranslationcontext.cpp.

◆ writeTsFile()

void QgsTranslationContext::writeTsFile ( const QString &  locale) const

Writes the Ts-file.

Definition at line 53 of file qgstranslationcontext.cpp.


The documentation for this class was generated from the following files: