QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgstranslationcontext.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgstranslationcontext.h
3
4
---------------------
5
begin : 23.5.2018
6
copyright : (C) 2018 by David Signer
7
email : david at opengis dot ch
8
***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
#ifndef QGSTRANSLATIONCONTEXT_H
17
#define QGSTRANSLATIONCONTEXT_H
18
19
#include "qgis_core.h"
20
#include "
qgis_sip.h
"
21
22
#include <QList>
23
#include <QString>
24
25
class
QgsProject
;
26
34
35
class
CORE_EXPORT
QgsTranslationContext
36
{
40
struct
TranslatableObject
41
{
42
QString context;
43
QString source;
44
45
bool
operator==
(
const
TranslatableObject &other )
const
{
return
context == other.context && source == other.source; }
46
};
47
48
public
:
49
QgsTranslationContext
() =
default
;
50
55
QgsProject
*
project
()
const
;
56
62
void
setProject
(
QgsProject
*
project
);
63
68
QString
fileName
()
const
;
69
75
void
setFileName
(
const
QString &
fileName
);
76
81
void
registerTranslation
(
const
QString &context,
const
QString &source );
82
86
void
writeTsFile
(
const
QString &locale )
const
;
87
88
private
:
89
QgsProject
*mProject =
nullptr
;
90
QString mFileName;
91
QList< TranslatableObject > mTranslatableObjects;
92
};
93
94
#endif
// QGSTRANSLATIONCONTEXT_H
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition
qgsproject.h:114
QgsTranslationContext::fileName
QString fileName() const
Returns the TS fileName.
Definition
qgstranslationcontext.cpp:38
QgsTranslationContext::registerTranslation
void registerTranslation(const QString &context, const QString &source)
Registers the source to be translated.
Definition
qgstranslationcontext.cpp:48
QgsTranslationContext::project
QgsProject * project() const
Returns the project.
Definition
qgstranslationcontext.cpp:28
QgsTranslationContext::QgsTranslationContext
QgsTranslationContext()=default
QgsTranslationContext::setFileName
void setFileName(const QString &fileName)
Sets the fileName of the TS file.
Definition
qgstranslationcontext.cpp:43
QgsTranslationContext::writeTsFile
void writeTsFile(const QString &locale) const
Writes the Ts-file.
Definition
qgstranslationcontext.cpp:59
QgsTranslationContext::setProject
void setProject(QgsProject *project)
Sets the project being translated.
Definition
qgstranslationcontext.cpp:33
qgis_sip.h
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition
qgsfeatureiterator.h:427
Generated on
for QGIS API Documentation by
1.17.0