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
12class TranslationContext : public QObject
13{
15 Q_PROPERTY(QString domain READ domain WRITE setDomain NOTIFY domainChanged)
16
17public:
18 explicit TranslationContext(QObject *parent = nullptr);
19 ~TranslationContext() override;
20
21 QString domain() const;
22
23public Q_SLOTS:
24 void setDomain(const QString &domain);
25
27 void domainChanged(const QString &domain);
28
29public:
30 Q_INVOKABLE QString i18n(const QString &message,
31 const QString &param1 = QString(),
32 const QString &param2 = QString(),
33 const QString &param3 = QString(),
34 const QString &param4 = QString(),
35 const QString &param5 = QString(),
36 const QString &param6 = QString(),
37 const QString &param7 = QString(),
38 const QString &param8 = QString(),
39 const QString &param9 = QString(),
40 const QString &param10 = QString()) const;
41
42 Q_INVOKABLE QString i18nc(const QString &context,
43 const QString &message,
44 const QString &param1 = QString(),
45 const QString &param2 = QString(),
46 const QString &param3 = QString(),
47 const QString &param4 = QString(),
48 const QString &param5 = QString(),
49 const QString &param6 = QString(),
50 const QString &param7 = QString(),
51 const QString &param8 = QString(),
52 const QString &param9 = QString(),
53 const QString &param10 = QString()) const;
54
55 Q_INVOKABLE QString i18np(const QString &singular,
56 const QString &plural,
57 const QString &param1 = QString(),
58 const QString &param2 = QString(),
59 const QString &param3 = QString(),
60 const QString &param4 = QString(),
61 const QString &param5 = QString(),
62 const QString &param6 = QString(),
63 const QString &param7 = QString(),
64 const QString &param8 = QString(),
65 const QString &param9 = QString(),
66 const QString &param10 = QString()) const;
67
68 Q_INVOKABLE QString i18ncp(const QString &context,
69 const QString &singular,
70 const QString &plural,
71 const QString &param1 = QString(),
72 const QString &param2 = QString(),
73 const QString &param3 = QString(),
74 const QString &param4 = QString(),
75 const QString &param5 = QString(),
76 const QString &param6 = QString(),
77 const QString &param7 = QString(),
78 const QString &param8 = QString(),
79 const QString &param9 = QString(),
80 const QString &param10 = QString()) const;
81
82private:
83 Q_DISABLE_COPY(TranslationContext)
84
85 QString m_domain;
86};
87
88#endif // TRANSLATIONCONTEXT_H
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-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.