#include <QtCore/QTextStream>
#include <QtCore/QLibraryInfo>
-#include <iostream>
-
QT_USE_NAMESPACE
#ifdef QT_BOOTSTRAPPED
stream << out;
}
+static void printErr(const QString & out)
+{
+ QTextStream stream(stderr);
+ stream << out;
+}
+
static void printUsage()
{
printOut(LR::tr(
ConversionData cd;
bool ok = tor.load(tsFileName, cd, QLatin1String("auto"));
if (!ok) {
- std::cerr << qPrintable(LR::tr("lrelease error: %1").arg(cd.error()));
+ printErr(LR::tr("lrelease error: %1").arg(cd.error()));
} else {
if (!cd.errors().isEmpty())
printOut(cd.error());
QFile file(qmFileName);
if (!file.open(QIODevice::WriteOnly)) {
- std::cerr << qPrintable(LR::tr("lrelease error: cannot create '%1': %2\n")
+ printErr(LR::tr("lrelease error: cannot create '%1': %2\n")
.arg(qmFileName, file.errorString()));
return false;
}
file.close();
if (!ok) {
- std::cerr << qPrintable(LR::tr("lrelease error: cannot save '%1': %2")
+ printErr(LR::tr("lrelease error: cannot save '%1': %2")
.arg(qmFileName, cd.error()));
} else if (!cd.errors().isEmpty()) {
printOut(cd.error());
visitor.setVerbose(cd.isVerbose());
if (!visitor.queryProFile(&pro)) {
- std::cerr << qPrintable(LR::tr(
+ printErr(LR::tr(
"lrelease error: cannot read project file '%1'.\n")
.arg(inputFile));
continue;
}
if (!visitor.accept(&pro)) {
- std::cerr << qPrintable(LR::tr(
+ printErr(LR::tr(
"lrelease error: cannot process project file '%1'.\n")
.arg(inputFile));
continue;
QStringList translations = visitor.values(QLatin1String("TRANSLATIONS"));
if (translations.isEmpty()) {
- std::cerr << qPrintable(LR::tr(
+ printErr(LR::tr(
"lrelease warning: Met no 'TRANSLATIONS' entry in project file '%1'\n")
.arg(inputFile));
} else {