KDeclarative

translationcontext.h
1/*
2 SPDX-FileCopyrightText: 2014 Kevin Ottens <ervin@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef TRANSLATIONCONTEXT_H
8#define TRANSLATIONCONTEXT_H
9
10#include <QObject>
11
12#include <qqmlregistration.h>
13
14class TranslationContext : public QObject
15{
17 QML_ELEMENT
18 Q_PROPERTY(QString domain READ domain WRITE setDomain NOTIFY domainChanged)
19
20public:
21 explicit TranslationContext(QObject *parent = nullptr);
22 ~TranslationContext() override;
23
24 QString domain() const;
25
26public Q_SLOTS:
27 void setDomain(const QString &domain);
28
30 void domainChanged(const QString &domain);
31
32public:
33 Q_INVOKABLE QString i18n(const QString &message,
34 const QString &param1 = QString(),
35 const QString &param2 = QString(),
36 const QString &param3 = QString(),
37 const QString &param4 = QString(),
38 const QString &param5 = QString(),
39 const QString &param6 = QString(),
40 const QString &param7 = QString(),
41 const QString &param8 = QString(),
42 const QString &param9 = QString(),
43 const QString &param10 = QString()) const;
44
45 Q_INVOKABLE QString i18nc(const QString &context,
46 const QString &message,
47 const QString &param1 = QString(),
48 const QString &param2 = QString(),
49 const QString &param3 = QString(),
50 const QString &param4 = QString(),
51 const QString &param5 = QString(),
52 const QString &param6 = QString(),
53 const QString &param7 = QString(),
54 const QString &param8 = QString(),
55 const QString &param9 = QString(),
56 const QString &param10 = QString()) const;
57
58 Q_INVOKABLE QString i18np(const QString &singular,
59 const QString &plural,
60 const QString &param1 = QString(),
61 const QString &param2 = QString(),
62 const QString &param3 = QString(),
63 const QString &param4 = QString(),
64 const QString &param5 = QString(),
65 const QString &param6 = QString(),
66 const QString &param7 = QString(),
67 const QString &param8 = QString(),
68 const QString &param9 = QString(),
69 const QString &param10 = QString()) const;
70
71 Q_INVOKABLE QString i18ncp(const QString &context,
72 const QString &singular,
73 const QString &plural,
74 const QString &param1 = QString(),
75 const QString &param2 = QString(),
76 const QString &param3 = QString(),
77 const QString &param4 = QString(),
78 const QString &param5 = QString(),
79 const QString &param6 = QString(),
80 const QString &param7 = QString(),
81 const QString &param8 = QString(),
82 const QString &param9 = QString(),
83 const QString &param10 = QString()) const;
84
85private:
86 Q_DISABLE_COPY(TranslationContext)
87
88 QString m_domain;
89};
90
91#endif // TRANSLATIONCONTEXT_H
QObject(QObject *parent)
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:52:24 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.