Skip to content
Permalink
Browse files
Add QgsApplication::translation as counterpart to QgsApplication::set…
…Translation
  • Loading branch information
manisandro authored and nyalldawson committed Jun 21, 2021
1 parent a8c1be6 commit a29ce541a42876de1e1504dd6efa4b053a973b80
Showing with 23 additions and 2 deletions.
  1. +10 −1 python/core/auto_generated/qgsapplication.sip.in
  2. +5 −0 src/core/qgsapplication.cpp
  3. +8 −1 src/core/qgsapplication.h
@@ -994,9 +994,18 @@ The maximum number of concurrent connections per connections pool.

static void setTranslation( const QString &translation );
%Docstring
Set translation
Set translation locale code

.. versionadded:: 3.4
%End

QString translation() const;
%Docstring
Returns the current application translation locale code

.. seealso:: :py:func:`setTranslation`

.. versionadded:: 3.22
%End

void collectTranslatableObjects( QgsTranslationContext *translationContext );
@@ -1922,6 +1922,11 @@ void QgsApplication::setTranslation( const QString &translation )
*sTranslation() = translation;
}

QString QgsApplication::translation() const
{
return *sTranslation();
}

void QgsApplication::collectTranslatableObjects( QgsTranslationContext *translationContext )
{
emit requestForTranslatableObjects( translationContext );
@@ -934,12 +934,19 @@ class CORE_EXPORT QgsApplication : public QApplication
int maxConcurrentConnectionsPerPool() const;

/**
* Set translation
* Set translation locale code
*
* \since QGIS 3.4
*/
static void setTranslation( const QString &translation );

/**
* Returns the current application translation locale code
* \see setTranslation()
* \since QGIS 3.22
*/
QString translation() const;

/**
* Emits the signal to collect all the strings of .qgs to be included in ts file
*

0 comments on commit a29ce54

Please sign in to comment.