Beautifier: edit UI text

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

Change-Id: I21298fea201ff51635d4b6fa9f57445bc94dd0db
Reviewed-by: Lorenz Haas <lykurg@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Leena Miettinen
2014-02-24 10:33:56 +01:00
parent 6c6f47f86c
commit 12c3b9e489
9 changed files with 17 additions and 17 deletions

View File

@@ -177,7 +177,7 @@ void AbstractSettings::save()
const QString path = m_styleDir.absolutePath(); const QString path = m_styleDir.absolutePath();
if (!(m_styleDir.mkpath(path) if (!(m_styleDir.mkpath(path)
&& m_styleDir.cd(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; return;
} }
} }
@@ -197,13 +197,13 @@ void AbstractSettings::save()
Utils::FileSaver saver(styleFileName(iStyles.key())); Utils::FileSaver saver(styleFileName(iStyles.key()));
if (saver.hasError()) { 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.fileName())
.arg(saver.errorString())); .arg(saver.errorString()));
} else { } else {
saver.write(iStyles.value().toLocal8Bit()); saver.write(iStyles.value().toLocal8Bit());
if (!saver.finalize()) { 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.fileName())
.arg(saver.errorString())); .arg(saver.errorString()));
} }
@@ -275,7 +275,7 @@ void AbstractSettings::readDocumentation()
createDocumentationFile(); createDocumentationFile();
if (!file.open(QIODevice::ReadOnly)) { 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; return;
} }
@@ -314,7 +314,7 @@ void AbstractSettings::readDocumentation()
} }
if (xml.hasError()) { 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())); .arg(filename).arg(xml.errorString()));
} }
} }

View File

@@ -131,7 +131,7 @@ void ArtisticStyle::formatFile()
cfgFileName = m_settings->styleFileName(m_settings->customStyle()); cfgFileName = m_settings->styleFileName(m_settings->customStyle());
if (cfgFileName.isEmpty()) { 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 { } else {
BeautifierPlugin::formatCurrentFile(QStringList() BeautifierPlugin::formatCurrentFile(QStringList()
<< m_settings->command() << m_settings->command()

View File

@@ -58,7 +58,7 @@
<item> <item>
<widget class="QCheckBox" name="useCustomStyle"> <widget class="QCheckBox" name="useCustomStyle">
<property name="text"> <property name="text">
<string>Use selfdefined style:</string> <string>Use self-defined style:</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -127,7 +127,7 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
sourceFile.setAutoRemove(true); sourceFile.setAutoRemove(true);
sourceFile.write(text.toUtf8()); sourceFile.write(text.toUtf8());
if (!sourceFile.finalize()) { 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())); .arg(sourceFile.fileName()).arg(sourceFile.errorString()));
return QString(); return QString();
} }
@@ -138,7 +138,7 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
const QString processProgram = command.takeFirst(); const QString processProgram = command.takeFirst();
process.start(processProgram, command); process.start(processProgram, command);
if (!process.waitForFinished()) { 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(); return QString();
} }
const QByteArray output = process.readAllStandardError(); const QByteArray output = process.readAllStandardError();
@@ -148,7 +148,7 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
// Read text back // Read text back
Utils::FileReader reader; Utils::FileReader reader;
if (!reader.fetch(sourceFile.fileName(), QIODevice::Text)) { 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())); .arg(sourceFile.fileName()).arg(reader.errorString()));
return QString(); return QString();
} }

View File

@@ -53,7 +53,7 @@ ClangFormatOptionsPageWidget::ClangFormatOptionsPageWidget(ClangFormatSettings *
ui->options->setEnabled(false); ui->options->setEnabled(false);
ui->predefinedStyle->addItems(m_settings->predefinedStyles()); ui->predefinedStyle->addItems(m_settings->predefinedStyles());
ui->command->setExpectedKind(Utils::PathChooser::ExistingCommand); 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))); connect(ui->command, SIGNAL(validChanged(bool)), ui->options, SLOT(setEnabled(bool)));
ui->configurations->setSettings(m_settings); ui->configurations->setSettings(m_settings);
} }
@@ -112,7 +112,7 @@ ClangFormatOptionsPage::ClangFormatOptionsPage(ClangFormatSettings *settings, QO
m_searchKeywords() m_searchKeywords()
{ {
setId(Constants::ClangFormat::OPTION_ID); setId(Constants::ClangFormat::OPTION_ID);
setDisplayName(tr("ClangFormat")); setDisplayName(tr("Clang Format"));
setCategory(Constants::OPTION_CATEGORY); setCategory(Constants::OPTION_CATEGORY);
setDisplayCategory(QCoreApplication::translate("Beautifier", Constants::OPTION_TR_CATEGORY)); setDisplayCategory(QCoreApplication::translate("Beautifier", Constants::OPTION_TR_CATEGORY));
setCategoryIcon(QLatin1String(Constants::OPTION_CATEGORY_ICON)); setCategoryIcon(QLatin1String(Constants::OPTION_CATEGORY_ICON));

View File

@@ -23,7 +23,7 @@
<item> <item>
<widget class="QLabel" name="commandLabel"> <widget class="QLabel" name="commandLabel">
<property name="text"> <property name="text">
<string>ClangFormat command:</string> <string>Clang Format command:</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -74,7 +74,7 @@
<item row="2" column="0" colspan="2"> <item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="formatEntireFileFallback"> <widget class="QCheckBox" name="formatEntireFileFallback">
<property name="text"> <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> </property>
</widget> </widget>
</item> </item>

View File

@@ -143,7 +143,7 @@ void ClangFormatSettings::createDocumentationFile() const
const QString options = line.right(line.size() - firstSpace).trimmed(); const QString options = line.right(line.size() - firstSpace).trimmed();
const QString text = QLatin1String("<p><span class=\"option\">") + keyword const QString text = QLatin1String("<p><span class=\"option\">") + keyword
+ QLatin1String("</span> <span class=\"param\">") + options + 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>"); + QLatin1String("</p>");
stream.writeStartElement(QLatin1String(Constants::DOCUMENTATION_XMLENTRY)); stream.writeStartElement(QLatin1String(Constants::DOCUMENTATION_XMLENTRY));
stream.writeTextElement(QLatin1String(Constants::DOCUMENTATION_XMLKEY), keyword); stream.writeTextElement(QLatin1String(Constants::DOCUMENTATION_XMLKEY), keyword);

View File

@@ -126,7 +126,7 @@ void Uncrustify::formatFile()
cfgFileName = m_settings->styleFileName(m_settings->customStyle()); cfgFileName = m_settings->styleFileName(m_settings->customStyle());
if (cfgFileName.isEmpty()) { if (cfgFileName.isEmpty()) {
BeautifierPlugin::showError(tr("Could not get configuration file for uncrustify.")); BeautifierPlugin::showError(tr("Cannot get configuration file for uncrustify."));
} else { } else {
BeautifierPlugin::formatCurrentFile(QStringList() BeautifierPlugin::formatCurrentFile(QStringList()
<< m_settings->command() << m_settings->command()

View File

@@ -58,7 +58,7 @@
<item> <item>
<widget class="QCheckBox" name="useCustomStyle"> <widget class="QCheckBox" name="useCustomStyle">
<property name="text"> <property name="text">
<string>Use selfdefined style:</string> <string>Use self-defined style:</string>
</property> </property>
</widget> </widget>
</item> </item>