diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-06-24 10:15:16 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-06-24 09:22:42 +0000 |
commit | 1e589e37a991b29076e9a661f92dfa178421c208 (patch) | |
tree | ccdae70edb75b1bc17f0efc61086e16554e3f4eb /tools/binarycreator/binarycreator.cpp | |
parent | 65a5d4d33c7dcb27ce99ce59535733a28991c544 (diff) |
Unify translated error messages
* Enclose file paths in ""
* Localize file paths with QDir::toNativeSeparators.
* Make sure sentences end with a '.'
* Append error details always by ':', e.g.
tr("Failed to copy file '%1': %2").(...)
* Use 'directory' instead of 'folder' everywhere
Change-Id: Ie045f429f72ad5045c96537465c5fb9d2e99d250
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'tools/binarycreator/binarycreator.cpp')
-rw-r--r-- | tools/binarycreator/binarycreator.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp index b5df76601..4f400e6f2 100644 --- a/tools/binarycreator/binarycreator.cpp +++ b/tools/binarycreator/binarycreator.cpp @@ -199,7 +199,7 @@ static int assemble(Input input, const QInstaller::Settings &settings) QTemporaryFile file(input.outputPath); if (!file.open()) { - throw Error(QString::fromLatin1("Could not copy %1 to %2: %3").arg(input.installerExePath, + throw Error(QString::fromLatin1("Cannot copy %1 to %2: %3").arg(input.installerExePath, input.outputPath, file.errorString())); } @@ -209,7 +209,7 @@ static int assemble(Input input, const QInstaller::Settings &settings) QFile instExe(input.installerExePath); if (!instExe.copy(tempFile)) { - throw Error(QString::fromLatin1("Could not copy %1 to %2: %3").arg(instExe.fileName(), + throw Error(QString::fromLatin1("Cannot copy %1 to %2: %3").arg(instExe.fileName(), tempFile, instExe.errorString())); } @@ -252,7 +252,7 @@ static int assemble(Input input, const QInstaller::Settings &settings) { QFile target(targetName); if (target.exists() && !target.remove()) { - qCritical("Could not remove target %s: %s", qPrintable(target.fileName()), + qCritical("Cannot remove target %s: %s", qPrintable(target.fileName()), qPrintable(target.errorString())); QFile::remove(tempFile); return EXIT_FAILURE; @@ -265,7 +265,7 @@ static int assemble(Input input, const QInstaller::Settings &settings) #ifdef Q_OS_OSX if (!exe.copy(input.outputPath)) { - throw Error(QString::fromLatin1("Could not copy %1 to %2: %3").arg(exe.fileName(), + throw Error(QString::fromLatin1("Cannot copy %1 to %2: %3").arg(exe.fileName(), input.outputPath, exe.errorString())); } #else @@ -297,7 +297,7 @@ static int assemble(Input input, const QInstaller::Settings &settings) } if (!out.rename(targetName)) { - qCritical("Could not write installer to %s: %s", targetName.toUtf8().constData(), + qCritical("Cannot write installer to %s: %s", targetName.toUtf8().constData(), out.errorString().toUtf8().constData()); QFile::remove(tempFile); return EXIT_FAILURE; @@ -373,7 +373,7 @@ static QSharedPointer<QInstaller::Resource> createDefaultResourceFile(const QStr { QTemporaryFile projectFile(directory + QLatin1String("/rccprojectXXXXXX.qrc")); if (!projectFile.open()) - throw Error(QString::fromLatin1("Could not create temporary file for generated rcc project file")); + throw Error(QString::fromLatin1("Cannot create temporary file for generated rcc project file")); projectFile.close(); const WorkingDirectoryChange wd(directory); @@ -382,13 +382,13 @@ static QSharedPointer<QInstaller::Resource> createDefaultResourceFile(const QStr // 1. create the .qrc file if (runRcc(QStringList() << QLatin1String("rcc") << QLatin1String("-project") << QLatin1String("-o") << projectFileName) != EXIT_SUCCESS) { - throw Error(QString::fromLatin1("Could not create rcc project file.")); + throw Error(QString::fromLatin1("Cannot create rcc project file.")); } // 2. create the binary resource file from the .qrc file if (runRcc(QStringList() << QLatin1String("rcc") << QLatin1String("-binary") << QLatin1String("-o") << binaryName << projectFileName) != EXIT_SUCCESS) { - throw Error(QString::fromLatin1("Could not compile rcc project file.")); + throw Error(QString::fromLatin1("Cannot compile rcc project file.")); } return QSharedPointer<QInstaller::Resource>(new QInstaller::Resource(binaryName, binaryName |