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 | class TranslationContext : public QObject |
13 | { |
14 | Q_OBJECT |
15 | Q_PROPERTY(QString domain READ domain WRITE setDomain NOTIFY domainChanged) |
16 | |
17 | public: |
18 | explicit TranslationContext(QObject *parent = nullptr); |
19 | ~TranslationContext() override; |
20 | |
21 | QString domain() const; |
22 | |
23 | public Q_SLOTS: |
24 | void setDomain(const QString &domain); |
25 | |
26 | Q_SIGNALS: |
27 | void domainChanged(const QString &domain); |
28 | |
29 | public: |
30 | Q_INVOKABLE QString i18n(const QString &message, |
31 | const QString ¶m1 = QString(), |
32 | const QString ¶m2 = QString(), |
33 | const QString ¶m3 = QString(), |
34 | const QString ¶m4 = QString(), |
35 | const QString ¶m5 = QString(), |
36 | const QString ¶m6 = QString(), |
37 | const QString ¶m7 = QString(), |
38 | const QString ¶m8 = QString(), |
39 | const QString ¶m9 = QString(), |
40 | const QString ¶m10 = QString()) const; |
41 | |
42 | Q_INVOKABLE QString i18nc(const QString &context, |
43 | const QString &message, |
44 | const QString ¶m1 = QString(), |
45 | const QString ¶m2 = QString(), |
46 | const QString ¶m3 = QString(), |
47 | const QString ¶m4 = QString(), |
48 | const QString ¶m5 = QString(), |
49 | const QString ¶m6 = QString(), |
50 | const QString ¶m7 = QString(), |
51 | const QString ¶m8 = QString(), |
52 | const QString ¶m9 = QString(), |
53 | const QString ¶m10 = QString()) const; |
54 | |
55 | Q_INVOKABLE QString i18np(const QString &singular, |
56 | const QString &plural, |
57 | const QString ¶m1 = QString(), |
58 | const QString ¶m2 = QString(), |
59 | const QString ¶m3 = QString(), |
60 | const QString ¶m4 = QString(), |
61 | const QString ¶m5 = QString(), |
62 | const QString ¶m6 = QString(), |
63 | const QString ¶m7 = QString(), |
64 | const QString ¶m8 = QString(), |
65 | const QString ¶m9 = QString(), |
66 | const QString ¶m10 = QString()) const; |
67 | |
68 | Q_INVOKABLE QString i18ncp(const QString &context, |
69 | const QString &singular, |
70 | const QString &plural, |
71 | const QString ¶m1 = QString(), |
72 | const QString ¶m2 = QString(), |
73 | const QString ¶m3 = QString(), |
74 | const QString ¶m4 = QString(), |
75 | const QString ¶m5 = QString(), |
76 | const QString ¶m6 = QString(), |
77 | const QString ¶m7 = QString(), |
78 | const QString ¶m8 = QString(), |
79 | const QString ¶m9 = QString(), |
80 | const QString ¶m10 = QString()) const; |
81 | |
82 | private: |
83 | Q_DISABLE_COPY(TranslationContext) |
84 | |
85 | QString m_domain; |
86 | }; |
87 | |
88 | #endif // TRANSLATIONCONTEXT_H |
89 | |