Commit 119548a0 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Remove most leading/trailing blanks from translated messages.



They are a hassle for translators and reviewers alike.

Change-Id: I363138212b692cf75fe1605df8af3721315d37e1
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 4de3b948
......@@ -336,7 +336,7 @@ void AndroidDeployQtStep::runCommand(const QString &program, const QStringList &
QString mainMessage = tr("Packaging Error: Command '%1 %2' failed.")
.arg(program).arg(arguments.join(QLatin1String(" ")));
if (buildProc.error() != QProcess::UnknownError)
mainMessage += tr(" Reason: %1").arg(buildProc.errorString());
mainMessage += QLatin1Char(' ') + tr("Reason: %1").arg(buildProc.errorString());
else
mainMessage += tr("Exit code: %1").arg(buildProc.exitCode());
emit addOutput(mainMessage, BuildStep::ErrorMessageOutput);
......
......@@ -239,7 +239,7 @@ bool AndroidDeployStep::runCommand(QProcess *buildProc,
QString mainMessage = tr("Packaging Error: Command '%1 %2' failed.")
.arg(program).arg(arguments.join(QLatin1String(" ")));
if (buildProc->error() != QProcess::UnknownError)
mainMessage += tr(" Reason: %1").arg(buildProc->errorString());
mainMessage += QLatin1Char(' ') + tr("Reason: %1").arg(buildProc->errorString());
else
mainMessage += tr("Exit code: %1").arg(buildProc->exitCode());
writeOutput(mainMessage, BuildStep::ErrorMessageOutput);
......
......@@ -803,7 +803,7 @@ bool AndroidPackageCreationStep::runCommand(QProcess *buildProc
QString mainMessage = tr("Packaging Error: Command '%1 %2' failed.")
.arg(program).arg(arguments.join(QLatin1String(" ")));
if (buildProc->error() != QProcess::UnknownError)
mainMessage += tr(" Reason: %1").arg(buildProc->errorString());
mainMessage += QLatin1Char(' ') + tr("Reason: %1").arg(buildProc->errorString());
else
mainMessage += tr("Exit code: %1").arg(buildProc->exitCode());
raiseError(mainMessage);
......
......@@ -86,7 +86,8 @@ void SettingsPageWidget::setSettings(const ClearCaseSettings &s)
} else {
QString diffWarning = tr("In order to use External diff, 'diff' command needs to be accessible.");
if (HostOsInfo::isWindowsHost()) {
diffWarning.append(tr(" DiffUtils is available for free download "
diffWarning += QLatin1Char(' ');
diffWarning.append(tr("DiffUtils is available for free download "
"<a href=\"http://gnuwin32.sourceforge.net/packages/diffutils.htm\">here</a>. "
"Please extract it to a directory in your PATH."));
}
......
......@@ -455,7 +455,7 @@ ShadowBuildPage::ShadowBuildPage(CMakeOpenProjectWizard *cmakeWizard, bool chang
QLabel *label = new QLabel(this);
label->setWordWrap(true);
if (change)
label->setText(tr("Please enter the directory in which you want to build your project. "));
label->setText(tr("Please enter the directory in which you want to build your project.") + QLatin1Char(' '));
else
label->setText(tr("Please enter the directory in which you want to build your project. "
"Qt Creator recommends to not use the source directory for building. "
......@@ -507,13 +507,14 @@ void ChooseCMakePage::updateErrorText()
} else {
QString text = tr("Specify the path to the CMake executable. No CMake executable was found in the path.");
if (!cmakeExecutable.isEmpty()) {
text += QLatin1Char(' ');
QFileInfo fi(cmakeExecutable);
if (!fi.exists())
text += tr(" The CMake executable (%1) does not exist.").arg(cmakeExecutable);
text += tr("The CMake executable (%1) does not exist.").arg(cmakeExecutable);
else if (!fi.isExecutable())
text += tr(" The path %1 is not an executable.").arg(cmakeExecutable);
text += tr("The path %1 is not an executable.").arg(cmakeExecutable);
else
text += tr(" The path %1 is not a valid CMake executable.").arg(cmakeExecutable);
text += tr("The path %1 is not a valid CMake executable.").arg(cmakeExecutable);
}
m_cmakeLabel->setText(text);
}
......
......@@ -193,7 +193,12 @@ QString CMakeRunConfiguration::defaultDisplayName() const
{
if (m_title.isEmpty())
return tr("Run CMake kit");
return m_title + (m_enabled ? QString() : tr(" (disabled)"));
QString result = m_title;
if (!m_enabled) {
result += QLatin1Char(' ');
result += tr("(disabled)");
}
return result;
}
QWidget *CMakeRunConfiguration::createConfigurationWidget()
......
......@@ -407,9 +407,9 @@ BaseFileWizard::OverwriteResult BaseFileWizard::promptOverwrite(GeneratedFiles *
QStringList existingFiles;
bool oddStuffFound = false;
static const QString readOnlyMsg = tr(" [read only]");
static const QString directoryMsg = tr(" [folder]");
static const QString symLinkMsg = tr(" [symbolic link]");
static const QString readOnlyMsg = tr("[read only]");
static const QString directoryMsg = tr("[folder]");
static const QString symLinkMsg = tr("[symbolic link]");
foreach (const GeneratedFile &file, *files) {
const QFileInfo fi(file.path());
......@@ -432,17 +432,17 @@ BaseFileWizard::OverwriteResult BaseFileWizard::promptOverwrite(GeneratedFiles *
do {
if (fi.isDir()) {
oddStuffFound = true;
fileNamesMsgPart += directoryMsg;
fileNamesMsgPart += QLatin1Char(' ') + directoryMsg;
break;
}
if (fi.isSymLink()) {
oddStuffFound = true;
fileNamesMsgPart += symLinkMsg;
fileNamesMsgPart += QLatin1Char(' ') + symLinkMsg;
break;
}
if (!fi.isWritable()) {
oddStuffFound = true;
fileNamesMsgPart += readOnlyMsg;
fileNamesMsgPart += QLatin1Char(' ') + readOnlyMsg;
}
} while (false);
}
......
......@@ -117,11 +117,11 @@ QVariant CppIncludeHierarchyModel::data(const QModelIndex &index, int role) cons
if (role == Qt::DisplayRole) {
if ((item == m_includesItem && m_includesItem->childCount() == 0)
|| (item == m_includedByItem && m_includedByItem->childCount() == 0)) {
return QString(item->fileName() + tr(" (none)"));
return QString(item->fileName() + QLatin1Char(' ') + tr("(none)"));
}
if (item->isCyclic())
return QString(item->fileName() + tr(" (cyclic)"));
return QString(item->fileName() + QLatin1Char(' ') + tr("(cyclic)"));
return item->fileName();
}
......
......@@ -633,7 +633,7 @@ AddressDialog::AddressDialog(QWidget *parent) :
setWindowTitle(tr("Select Start Address"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QHBoxLayout *hLayout = new QHBoxLayout;
hLayout->addWidget(new QLabel(tr("Enter an address: ")));
hLayout->addWidget(new QLabel(tr("Enter an address:") + QLatin1Char(' ')));
hLayout->addWidget(m_lineEdit);
QVBoxLayout *vLayout = new QVBoxLayout;
vLayout->addLayout(hLayout);
......
......@@ -1676,9 +1676,9 @@ QString DebuggerEngine::msgInterrupted()
void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name)
{
if (name.isEmpty())
name = tr(" <Unknown> ", "name");
name = QLatin1Char(' ') + tr("<Unknown>", "name") + QLatin1Char(' ');
if (meaning.isEmpty())
meaning = tr(" <Unknown> ", "meaning");
meaning = QLatin1Char(' ') + tr("<Unknown>", "meaning") + QLatin1Char(' ');
const QString msg = tr("<p>The inferior stopped because it received a "
"signal from the Operating System.<p>"
"<table><tr><td>Signal name : </td><td>%1</td></tr>"
......
......@@ -382,7 +382,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
|| server.listen(QHostAddress::LocalHostIPv6);
if (!canListen) {
if (errorMessage)
*errorMessage = DebuggerPlugin::tr("Not enough free ports for QML debugging. ");
*errorMessage = DebuggerPlugin::tr("Not enough free ports for QML debugging.") + QLatin1Char(' ');
return sp;
}
sp.qmlServerAddress = server.serverAddress().toString();
......
......@@ -296,7 +296,7 @@ QString GdbEngine::errorMessage(QProcess::ProcessError error)
return tr("An error occurred when attempting to read from "
"the gdb process. For example, the process may not be running.");
default:
return tr("An unknown error in the gdb process occurred. ");
return tr("An unknown error in the gdb process occurred.");
}
}
......@@ -338,7 +338,7 @@ static inline QString msgWinException(const QByteArray &data, unsigned *exCodeIn
const quint64 address = data.mid(addressPos).trimmed().toULongLong(0, 0);
QString rc;
QTextStream str(&rc);
str << GdbEngine::tr("An exception was triggered: ");
str << GdbEngine::tr("An exception was triggered:") << ' ';
formatWindowsException(exCode, address, 0, 0, 0, str);
str << '.';
return rc;
......@@ -5215,7 +5215,7 @@ void GdbEngine::handleBreakOnQFatal(const GdbResponse &response)
void GdbEngine::notifyInferiorSetupFailed(const QString &msg)
{
showStatusMessage(tr("Failed to start application: ") + msg);
showStatusMessage(tr("Failed to start application:") + QLatin1Char(' ') + msg);
if (state() == EngineSetupFailed) {
showMessage(_("INFERIOR START FAILED, BUT ADAPTER DIED ALREADY"));
return; // Adapter crashed meanwhile, so this notification is meaningless.
......
......@@ -812,7 +812,7 @@ QString LldbEngine::errorMessage(QProcess::ProcessError error) const
return tr("An error occurred when attempting to read from "
"the Lldb process. For example, the process may not be running.");
default:
return tr("An unknown error in the Lldb process occurred. ");
return tr("An unknown error in the Lldb process occurred.") + QLatin1Char(' ');
}
}
......
......@@ -596,7 +596,7 @@ QString PdbEngine::errorMessage(QProcess::ProcessError error) const
return tr("An error occurred when attempting to read from "
"the Pdb process. For example, the process may not be running.");
default:
return tr("An unknown error in the Pdb process occurred. ");
return tr("An unknown error in the Pdb process occurred.") + QLatin1Char(' ');
}
}
......
......@@ -1167,7 +1167,7 @@ void QmlEngine::updateCurrentContext()
QmlJS::ConsoleManagerInterface *consoleManager = qmlConsoleManager();
if (consoleManager)
consoleManager->setContext(tr("Context: ").append(context));
consoleManager->setContext(tr("Context:") + QLatin1Char(' ') + context);
}
void QmlEngine::appendDebugOutput(QtMsgType type, const QString &message,
......
......@@ -454,7 +454,8 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value,
} else if (type == "SET_BINDING_R"
|| type == "RESET_BINDING_R"
|| type == "SET_METHOD_BODY_R") {
QString msg = QLatin1String(type) + tr("Success: ");
QString msg = QLatin1String(type) + tr("Success:");
msg += QLatin1Char(' ');
msg += value.toBool() ? QLatin1Char('1') : QLatin1Char('0');
if (!value.toBool())
emit automaticUpdateFailed();
......
......@@ -392,7 +392,8 @@ QString WatchData::toToolTip() const
}
if (val.size() > 1000) {
val.truncate(1000);
val += tr(" ... <cut off>");
val += QLatin1Char(' ');
val += tr("... <cut off>");
}
formatToolTipRow(str, tr("Value"), val);
if (address)
......
......@@ -649,7 +649,7 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
QString msg = (individualFormat == -1 && typeFormat != -1)
? tr("Use Format for Type (Currently %1)")
.arg(alternativeFormats.at(typeFormat))
: tr("Use Display Format Based on Type ");
: tr("Use Display Format Based on Type") + QLatin1Char(' ');
clearIndividualFormatAction = formatMenu.addAction(spacer + msg);
clearIndividualFormatAction->setCheckable(true);
clearIndividualFormatAction->setChecked(individualFormat == -1);
......
......@@ -5396,7 +5396,7 @@ bool FakeVimHandler::Private::handleExSetCommand(const ExCommand &cmd)
if (!error.isEmpty())
showMessage(MessageError, error);
} else {
showMessage(MessageError, FakeVimHandler::tr("Unknown option: ") + cmd.args);
showMessage(MessageError, FakeVimHandler::tr("Unknown option:") + QLatin1Char(' ') + cmd.args);
}
updateMiniBuffer();
updateEditor();
......
......@@ -101,7 +101,7 @@ GerritDialog::GerritDialog(const QSharedPointer<GerritParameters> &p,
, m_filterLineEdit(new Utils::FilterLineEdit)
, m_repositoryChooser(new Utils::PathChooser)
, m_buttonBox(new QDialogButtonBox(QDialogButtonBox::Close))
, m_repositoryChooserLabel(new QLabel(tr("Apply in: "), this))
, m_repositoryChooserLabel(new QLabel(tr("Apply in:") + QLatin1Char(' '), this))
, m_fetchRunning(false)
{
setWindowTitle(tr("Gerrit %1@%2").arg(p->user, p->host));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment