QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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
 
QString fileName () const
 Returns the TS fileName.
 
QgsProjectproject () const
 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) const
 Writes the Ts-file.
 

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

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: