summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lupdate/ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/linguist/lupdate/ui.cpp')
-rw-r--r--tools/linguist/lupdate/ui.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/tools/linguist/lupdate/ui.cpp b/tools/linguist/lupdate/ui.cpp
index 9e22922..797ab1f 100644
--- a/tools/linguist/lupdate/ui.cpp
+++ b/tools/linguist/lupdate/ui.cpp
@@ -43,6 +43,7 @@
#include <translator.h>
+#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtCore/QFile>
#include <QtCore/QString>
@@ -55,6 +56,10 @@
QT_BEGIN_NAMESPACE
+class LU {
+ Q_DECLARE_TR_FUNCTIONS(LUpdate)
+};
+
class UiReader : public QXmlDefaultHandler
{
public:
@@ -152,11 +157,10 @@ bool UiReader::characters(const QString &ch)
bool UiReader::fatalError(const QXmlParseException &exception)
{
- QString msg;
- msg.sprintf("XML error: Parse error at line %d, column %d (%s).",
- exception.lineNumber(), exception.columnNumber(),
- exception.message().toLatin1().data());
- m_cd.appendError(msg);
+ QString msg = LU::tr("XML error: Parse error at line %1, column %2 (%3).")
+ .arg(exception.lineNumber()).arg(exception.columnNumber())
+ .arg(exception.message());
+ m_cd.appendError(msg);
return false;
}
@@ -181,8 +185,7 @@ bool loadUI(Translator &translator, const QString &filename, ConversionData &cd)
cd.m_sourceFileName = filename;
QFile file(filename);
if (!file.open(QIODevice::ReadOnly)) {
- cd.appendError(QString::fromLatin1("Cannot open %1: %2")
- .arg(filename, file.errorString()));
+ cd.appendError(LU::tr("Cannot open %1: %2").arg(filename, file.errorString()));
return false;
}
QXmlInputSource in(&file);
@@ -196,7 +199,7 @@ bool loadUI(Translator &translator, const QString &filename, ConversionData &cd)
reader.setErrorHandler(&handler);
bool result = reader.parse(in);
if (!result)
- cd.appendError(QLatin1String("Parse error in UI file"));
+ cd.appendError(LU::tr("Parse error in UI file"));
reader.setContentHandler(0);
reader.setErrorHandler(0);
return result;