diff options
author | David Boddie <david.boddie@nokia.com> | 2010-11-19 18:04:23 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2010-11-19 18:04:23 (GMT) |
commit | 6a5aebd47fca17663074c323795e37f3581154c2 (patch) | |
tree | ad322ee0cd3e3729aadd36a9de81f7a4069b1a59 /tools/qdoc3 | |
parent | c9ff1b8851b166b786864ee7bbe0eceb0220660e (diff) | |
download | Qt-6a5aebd47fca17663074c323795e37f3581154c2.zip Qt-6a5aebd47fca17663074c323795e37f3581154c2.tar.gz Qt-6a5aebd47fca17663074c323795e37f3581154c2.tar.bz2 |
Improved translation support, using the application object if possible.
Diffstat (limited to 'tools/qdoc3')
-rw-r--r-- | tools/qdoc3/tr.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/qdoc3/tr.h b/tools/qdoc3/tr.h index 4d601e9..4ba7aa4 100644 --- a/tools/qdoc3/tr.h +++ b/tools/qdoc3/tr.h @@ -46,14 +46,26 @@ #ifndef TR_H #define TR_H +#ifndef QT_BOOTSTRAPPED +# include "qcoreapplication.h" +#endif + #include <qstring.h> QT_BEGIN_NAMESPACE -inline QString tr( const char *sourceText, const char * /* comment */ = 0 ) +#if defined(QT_BOOTSTRAPPED) || defined(QT_NO_TRANSLATION) +inline QString tr(const char *sourceText, const char *comment = 0) { + Q_UNUSED(comment); return QString( QLatin1String(sourceText) ); } +#else +inline QString tr(const char *sourceText, const char *comment = 0) +{ + return QCoreApplication::instance()->translate("", sourceText, comment); +} +#endif QT_END_NAMESPACE |