Commit 12c3b9e4 authored by Leena Miettinen's avatar Leena Miettinen

Beautifier: edit UI text

Make error message wording more consistent. Fix some
punctuation and grammar issues.

Change-Id: I21298fea201ff51635d4b6fa9f57445bc94dd0db
Reviewed-by: default avatarLorenz Haas <lykurg@gmail.com>
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 6c6f47f8
......@@ -177,7 +177,7 @@ void AbstractSettings::save()
const QString path = m_styleDir.absolutePath();
if (!(m_styleDir.mkpath(path)
&& m_styleDir.cd(path))) {
BeautifierPlugin::showError(tr("Failed to save styles. %1 does not exist.").arg(path));
BeautifierPlugin::showError(tr("Cannot save styles. %1 does not exist.").arg(path));
return;
}
}
......@@ -197,13 +197,13 @@ void AbstractSettings::save()
Utils::FileSaver saver(styleFileName(iStyles.key()));
if (saver.hasError()) {
BeautifierPlugin::showError(tr("Could not open file \"%1\": %2.")
BeautifierPlugin::showError(tr("Cannot open file \"%1\": %2.")
.arg(saver.fileName())
.arg(saver.errorString()));
} else {
saver.write(iStyles.value().toLocal8Bit());
if (!saver.finalize()) {
BeautifierPlugin::showError(tr("Error while saving file \"%1\": %2.")
BeautifierPlugin::showError(tr("Cannot save file \"%1\": %2.")
.arg(saver.fileName())
.arg(saver.errorString()));
}
......@@ -275,7 +275,7 @@ void AbstractSettings::readDocumentation()
createDocumentationFile();
if (!file.open(QIODevice::ReadOnly)) {
BeautifierPlugin::showError(tr("Could not open documentation file \"%1\".").arg(filename));
BeautifierPlugin::showError(tr("Cannot open documentation file \"%1\".").arg(filename));
return;
}
......@@ -314,7 +314,7 @@ void AbstractSettings::readDocumentation()
}
if (xml.hasError()) {
BeautifierPlugin::showError(tr("Could not read documentation file \"%1\". Error: %2.")
BeautifierPlugin::showError(tr("Cannot read documentation file \"%1\": %2.")
.arg(filename).arg(xml.errorString()));
}
}
......
......@@ -131,7 +131,7 @@ void ArtisticStyle::formatFile()
cfgFileName = m_settings->styleFileName(m_settings->customStyle());
if (cfgFileName.isEmpty()) {
BeautifierPlugin::showError(tr("Could not get configuration file for Artistic Style."));
BeautifierPlugin::showError(tr("Cannot get configuration file for Artistic Style."));
} else {
BeautifierPlugin::formatCurrentFile(QStringList()
<< m_settings->command()
......
......@@ -58,7 +58,7 @@
<item>
<widget class="QCheckBox" name="useCustomStyle">
<property name="text">
<string>Use selfdefined style:</string>
<string>Use self-defined style:</string>
</property>
</widget>
</item>
......
......@@ -127,7 +127,7 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
sourceFile.setAutoRemove(true);
sourceFile.write(text.toUtf8());
if (!sourceFile.finalize()) {
showError(tr("Couldn't create temporary file %1: %2.")
showError(tr("Cannot create temporary file \"%1\": %2.")
.arg(sourceFile.fileName()).arg(sourceFile.errorString()));
return QString();
}
......@@ -138,7 +138,7 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
const QString processProgram = command.takeFirst();
process.start(processProgram, command);
if (!process.waitForFinished()) {
showError(tr("Failed to call %1 or an error occurred.").arg(processProgram));
showError(tr("Cannot call %1 or some other error occurred.").arg(processProgram));
return QString();
}
const QByteArray output = process.readAllStandardError();
......@@ -148,7 +148,7 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
// Read text back
Utils::FileReader reader;
if (!reader.fetch(sourceFile.fileName(), QIODevice::Text)) {
showError(tr("Couldn't read file %1: %2.")
showError(tr("Cannot read file \"%1\": %2.")
.arg(sourceFile.fileName()).arg(reader.errorString()));
return QString();
}
......
......@@ -53,7 +53,7 @@ ClangFormatOptionsPageWidget::ClangFormatOptionsPageWidget(ClangFormatSettings *
ui->options->setEnabled(false);
ui->predefinedStyle->addItems(m_settings->predefinedStyles());
ui->command->setExpectedKind(Utils::PathChooser::ExistingCommand);
ui->command->setPromptDialogTitle(tr("ClangFormat Command"));
ui->command->setPromptDialogTitle(tr("Clang Format Command"));
connect(ui->command, SIGNAL(validChanged(bool)), ui->options, SLOT(setEnabled(bool)));
ui->configurations->setSettings(m_settings);
}
......@@ -112,7 +112,7 @@ ClangFormatOptionsPage::ClangFormatOptionsPage(ClangFormatSettings *settings, QO
m_searchKeywords()
{
setId(Constants::ClangFormat::OPTION_ID);
setDisplayName(tr("ClangFormat"));
setDisplayName(tr("Clang Format"));
setCategory(Constants::OPTION_CATEGORY);
setDisplayCategory(QCoreApplication::translate("Beautifier", Constants::OPTION_TR_CATEGORY));
setCategoryIcon(QLatin1String(Constants::OPTION_CATEGORY_ICON));
......
......@@ -23,7 +23,7 @@
<item>
<widget class="QLabel" name="commandLabel">
<property name="text">
<string>ClangFormat command:</string>
<string>Clang Format command:</string>
</property>
</widget>
</item>
......@@ -74,7 +74,7 @@
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="formatEntireFileFallback">
<property name="text">
<string>Format entire file if no text was selected. (For action &quot;Format Selected Text&quot;)</string>
<string>Format entire file if no text was selected. (For action Format Selected Text)</string>
</property>
</widget>
</item>
......
......@@ -143,7 +143,7 @@ void ClangFormatSettings::createDocumentationFile() const
const QString options = line.right(line.size() - firstSpace).trimmed();
const QString text = QLatin1String("<p><span class=\"option\">") + keyword
+ QLatin1String("</span> <span class=\"param\">") + options
+ QLatin1String("</span></p><p>") + tr("Yet no description available.")
+ QLatin1String("</span></p><p>") + tr("No description available.")
+ QLatin1String("</p>");
stream.writeStartElement(QLatin1String(Constants::DOCUMENTATION_XMLENTRY));
stream.writeTextElement(QLatin1String(Constants::DOCUMENTATION_XMLKEY), keyword);
......
......@@ -126,7 +126,7 @@ void Uncrustify::formatFile()
cfgFileName = m_settings->styleFileName(m_settings->customStyle());
if (cfgFileName.isEmpty()) {
BeautifierPlugin::showError(tr("Could not get configuration file for uncrustify."));
BeautifierPlugin::showError(tr("Cannot get configuration file for uncrustify."));
} else {
BeautifierPlugin::formatCurrentFile(QStringList()
<< m_settings->command()
......
......@@ -58,7 +58,7 @@
<item>
<widget class="QCheckBox" name="useCustomStyle">
<property name="text">
<string>Use selfdefined style:</string>
<string>Use self-defined style:</string>
</property>
</widget>
</item>
......
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