Add missing QT_TRID_N_NOOP definition
Amends c74bd2b93, properly following up on qttools/bc47b5190.
[ChangeLog][QtCore] Added missing QT_TRID_N_NOOP() macro. Lupdate
actually recognizes it since Qt 5.12.
Fixes: QTBUG-98277
Fixes: QTBUG-3945
Change-Id: I0ea15ceb49b2ead5c8bb40d2a55a0ae8577e8850
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
bb10
parent
4515c5e4fc
commit
fb33e2a8e8
|
|
@ -512,6 +512,20 @@ void TheClass::addLabels()
|
|||
}
|
||||
//! [qttrid_noop]
|
||||
|
||||
//! [qttrid_n_noop]
|
||||
static const char * const ids[] = {
|
||||
//% "%n foo(s) found."
|
||||
QT_TRID_N_NOOP("qtn_foo"),
|
||||
//% "%n bar(s) found."
|
||||
QT_TRID_N_NOOP("qtn_bar"),
|
||||
0
|
||||
};
|
||||
|
||||
QString result(int type, int n)
|
||||
{
|
||||
return qtTrId(ids[type], n);
|
||||
}
|
||||
//! [qttrid_n_noop]
|
||||
|
||||
//! [37]
|
||||
qWarning("%s: %s", qUtf8Printable(key), qUtf8Printable(value));
|
||||
|
|
|
|||
|
|
@ -4060,6 +4060,26 @@ bool qunsetenv(const char *varName)
|
|||
\sa qtTrId(), {Internationalization with Qt}
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro QT_TRID_N_NOOP(id)
|
||||
\relates <QtGlobal>
|
||||
\since 6.3
|
||||
|
||||
\brief The QT_TRID_N_NOOP macro marks an id for numerator
|
||||
dependent dynamic translation.
|
||||
|
||||
The only purpose of this macro is to provide an anchor for attaching
|
||||
meta data like to qtTrId().
|
||||
|
||||
The macro expands to \a id.
|
||||
|
||||
Example:
|
||||
|
||||
\snippet code/src_corelib_global_qglobal.cpp qttrid_n_noop
|
||||
|
||||
\sa qtTrId(), {Internationalization with Qt}
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro Q_LIKELY(expr)
|
||||
\relates <QtGlobal>
|
||||
|
|
|
|||
|
|
@ -1358,6 +1358,7 @@ template <typename Ptr> inline auto qGetPtrHelper(Ptr &ptr) noexcept -> decltype
|
|||
Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1);
|
||||
|
||||
#define QT_TRID_NOOP(id) id
|
||||
#define QT_TRID_N_NOOP(id) id
|
||||
|
||||
#endif // QT_NO_TRANSLATION
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue