summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-11-19 18:04:23 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-11-19 18:04:23 (GMT)
commit6a5aebd47fca17663074c323795e37f3581154c2 (patch)
treead322ee0cd3e3729aadd36a9de81f7a4069b1a59 /tools/qdoc3
parentc9ff1b8851b166b786864ee7bbe0eceb0220660e (diff)
downloadQt-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.h14
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