Tr: More small fixes

Change-Id: I5d9324d3f64eaa522fa1d435efa39fa43d84798a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Eike Ziller
2023-10-18 09:59:28 +02:00
parent b519ebf1c9
commit ad7d559028
17 changed files with 63 additions and 45 deletions

View File

@@ -22,7 +22,7 @@ ShowPasswordButton::ShowPasswordButton(QWidget *parent)
{
setAttribute(Qt::WA_Hover);
setCheckable(true);
setToolTip(Tr::tr("Show/hide password"));
setToolTip(Tr::tr("Show/Hide Password"));
}
void ShowPasswordButton::paintEvent(QPaintEvent *e)

View File

@@ -27,7 +27,7 @@ expected_str<FilePath> defaultShellForDevice(const FilePath &deviceRoot)
shell = env->searchInPath(shell.nativePath());
if (shell.isEmpty())
return make_unexpected(Tr::tr("Could not find any shell"));
return make_unexpected(Tr::tr("Could not find any shell."));
return deviceRoot.withNewMappedPath(shell);
}

View File

@@ -105,8 +105,8 @@ void disableDiagnosticInCurrentProjectConfig(const ClangDiagnostic &diagnostic)
projectSettings.setDiagnosticConfigId(config.id());
// Notify the user about changed project specific settings
const QString text = Tr::tr("Changes applied to diagnostic configuration \"%1\"")
.arg(config.displayName());
const QString text
= Tr::tr("Changes applied to diagnostic configuration \"%1\".").arg(config.displayName());
FadingIndicator::showText(Core::ICore::mainWindow(),
text,
FadingIndicator::SmallText);

View File

@@ -98,7 +98,7 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferenc
static const int expectedMajorVersion = 17;
d->clangVersion = new QLabel(Tr::tr("Current clang-format version: ") + LLVM_VERSION_STRING,
d->clangVersion = new QLabel(Tr::tr("Current ClangFormat version: %1.").arg(LLVM_VERSION_STRING),
this);
d->clangWarningText
= new QLabel(Tr::tr("The widget was generated for ClangFormat %1. "

View File

@@ -484,7 +484,7 @@ void CompilerWidget::doCompile()
}
} catch (const std::exception &e) {
Core::MessageManager::writeDisrupting(
Tr::tr("Failed to compile: \"%1\"").arg(QString::fromUtf8(e.what())));
Tr::tr("Failed to compile: \"%1\".").arg(QString::fromUtf8(e.what())));
}
});

View File

@@ -210,7 +210,7 @@ void CompilerSettings::fillLibraries(const LibrarySelectionAspect::ResultCallbac
fillFromCache();
} catch (const std::exception &e) {
Core::MessageManager::writeDisrupting(
Tr::tr("Failed to fetch libraries: \"%1\"")
Tr::tr("Failed to fetch libraries: \"%1\".")
.arg(QString::fromUtf8(e.what())));
}
});
@@ -253,7 +253,7 @@ void SourceSettings::fillLanguageIdModel(const Utils::StringSelectionAspect::Res
fillFromCache();
} catch (const std::exception &e) {
Core::MessageManager::writeDisrupting(
Tr::tr("Failed to fetch languages: \"%1\"")
Tr::tr("Failed to fetch languages: \"%1\".")
.arg(QString::fromUtf8(e.what())));
}
});
@@ -295,7 +295,7 @@ void CompilerSettings::fillCompilerModel(const Utils::StringSelectionAspect::Res
fillFromCache(itCache);
} catch (const std::exception &e) {
Core::MessageManager::writeDisrupting(
Tr::tr("Failed to fetch compilers: \"%1\"")
Tr::tr("Failed to fetch compilers: \"%1\".")
.arg(QString::fromUtf8(e.what())));
}
});
@@ -311,7 +311,7 @@ CompilerExplorerSettings::CompilerExplorerSettings()
compilerExplorerUrl.setSettingsKey("CompilerExplorerUrl");
compilerExplorerUrl.setLabelText(Tr::tr("Compiler Explorer URL:"));
compilerExplorerUrl.setToolTip(Tr::tr("URL of the Compiler Explorer instance to use"));
compilerExplorerUrl.setToolTip(Tr::tr("URL of the Compiler Explorer instance to use."));
compilerExplorerUrl.setDefaultValue("https://godbolt.org/");
compilerExplorerUrl.setDisplayStyle(Utils::StringAspect::DisplayStyle::LineEditDisplay);
compilerExplorerUrl.setHistoryCompleter("CompilerExplorer.Url.History");

View File

@@ -463,14 +463,14 @@ private:
static QPointer<SettingsDialog> m_instance = nullptr;
SettingsDialog::SettingsDialog(QWidget *parent) :
QDialog(parent),
m_pages(sortedOptionsPages()),
m_stackedLayout(new QStackedLayout),
m_filterLineEdit(new Utils::FancyLineEdit),
m_sortCheckBox(new QCheckBox(Tr::tr("Sort Categories"))),
m_categoryList(new CategoryListView),
m_headerLabel(new QLabel)
SettingsDialog::SettingsDialog(QWidget *parent)
: QDialog(parent)
, m_pages(sortedOptionsPages())
, m_stackedLayout(new QStackedLayout)
, m_filterLineEdit(new Utils::FancyLineEdit)
, m_sortCheckBox(new QCheckBox(Tr::tr("Sort categories")))
, m_categoryList(new CategoryListView)
, m_headerLabel(new QLabel)
{
m_filterLineEdit->setFiltering(true);

View File

@@ -139,12 +139,12 @@ GeneralSettingsWidget::GeneralSettingsWidget()
!= Qt::HighDpiScaleFactorRoundingPolicy::Unset) {
using Policy = Qt::HighDpiScaleFactorRoundingPolicy;
m_policyComboBox = new QComboBox;
m_policyComboBox->addItem(Tr::tr("Round up for .5 and above"), int(Policy::Round));
m_policyComboBox->addItem(Tr::tr("Always round up"), int(Policy::Ceil));
m_policyComboBox->addItem(Tr::tr("Always round down"), int(Policy::Floor));
m_policyComboBox->addItem(Tr::tr("Round up for .75 and above"),
m_policyComboBox->addItem(Tr::tr("Round Up for .5 and Above"), int(Policy::Round));
m_policyComboBox->addItem(Tr::tr("Always Round Up"), int(Policy::Ceil));
m_policyComboBox->addItem(Tr::tr("Always Round Down"), int(Policy::Floor));
m_policyComboBox->addItem(Tr::tr("Round Up for .75 and Above"),
int(Policy::RoundPreferFloor));
m_policyComboBox->addItem(Tr::tr("Don't round"), int(Policy::PassThrough));
m_policyComboBox->addItem(Tr::tr("Don't Round"), int(Policy::PassThrough));
m_policyComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
const Policy userPolicy =
@@ -153,7 +153,7 @@ GeneralSettingsWidget::GeneralSettingsWidget()
.value<Policy>();
m_policyComboBox->setCurrentIndex(m_policyComboBox->findData(int(userPolicy)));
form.addRow({Tr::tr("DPI Rounding Policy:"), m_policyComboBox, st});
form.addRow({Tr::tr("DPI rounding policy:"), m_policyComboBox, st});
}
form.addRow({empty, generalSettings().showShortcutsInContextMenus});

View File

@@ -9329,8 +9329,8 @@ public:
m_wasCxxStyle(m_kind == T_CPP_COMMENT || m_kind == T_CPP_DOXY_COMMENT),
m_isDoxygen(m_kind == T_DOXY_COMMENT || m_kind == T_CPP_DOXY_COMMENT)
{
setDescription(m_wasCxxStyle ? Tr::tr("Convert comment to C style")
: Tr::tr("Convert comment to C++ style"));
setDescription(m_wasCxxStyle ? Tr::tr("Convert Comment to C-Style")
: Tr::tr("Convert Comment to C++-Style"));
}
private:
@@ -9552,8 +9552,8 @@ public:
: CppQuickFixOperation(interface), m_symbol(symbol), m_commentTokens(commentTokens)
{
setDescription(direction == Direction::ToDecl
? Tr::tr("Move function documentation to declaration")
: Tr::tr("Move function documentation to definition"));
? Tr::tr("Move Function Documentation to Declaration")
: Tr::tr("Move Function Documentation to Definition"));
}
private:

View File

@@ -173,7 +173,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device)
deviceSettings->tag, br,
deviceSettings->imageId, br,
daemonStateLabel, m_daemonReset, m_daemonState, br,
Tr::tr("Container State:"), deviceSettings->containerStatus, br,
Tr::tr("Container state:"), deviceSettings->containerStatus, br,
deviceSettings->useLocalUidGid, br,
deviceSettings->keepEntryPoint, br,
deviceSettings->enableLldbFlags, br,
@@ -187,7 +187,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device)
If { dockerDevice->isAutoDetected(), {}, {detectionControls} },
noMargin,
},br,
Tr::tr("Command Line:"), createLineLabel, br,
Tr::tr("Command line:"), createLineLabel, br,
}.attachTo(this);
// clang-format on

View File

@@ -10,6 +10,7 @@
#include "gitconstants.h"
#include "giteditor.h"
#include "gitgrep.h"
#include "gitsettings.h"
#include "gitsubmiteditor.h"
#include "gittr.h"
#include "gitutils.h"
@@ -247,8 +248,14 @@ public:
if (settings().instantBlameIgnoreSpaceChanges()
|| settings().instantBlameIgnoreLineMoves()) {
result.append(Tr::tr("<p><b>Note:</b> Ignore whitespace changes or line moves"
" is enabled in the instant blame settings.</p>"));
result.append(
"<p>"
//: %1 and %2 are the "ignore whitespace changes" and "ignore line moves" options
+ Tr::tr("<b>Note:</b> \"%1\" or \"%2\""
" is enabled in the instant blame settings.")
.arg(GitSettings::trIgnoreWhitespaceChanges(),
GitSettings::trIgnoreLineMoves())
+ "</p>");
}
return result;
}

View File

@@ -91,14 +91,12 @@ GitSettings::GitSettings()
Tr::tr("Annotate the current line in the editor with Git \"blame\" output."));
instantBlameIgnoreSpaceChanges.setSettingsKey("GitInstantIgnoreSpaceChanges");
instantBlameIgnoreSpaceChanges.setDefaultValue(false);
instantBlameIgnoreSpaceChanges.setLabelText(
Tr::tr("Ignore whitespace changes"));
instantBlameIgnoreSpaceChanges.setLabelText(trIgnoreWhitespaceChanges());
instantBlameIgnoreSpaceChanges.setToolTip(
Tr::tr("Finds the commit that introduced the last real code changes to the line."));
instantBlameIgnoreLineMoves.setSettingsKey("GitInstantIgnoreLineMoves");
instantBlameIgnoreLineMoves.setDefaultValue(false);
instantBlameIgnoreLineMoves.setLabelText(
Tr::tr("Ignore line moves"));
instantBlameIgnoreLineMoves.setLabelText(trIgnoreLineMoves());
instantBlameIgnoreLineMoves.setToolTip(
Tr::tr("Finds the commit that introduced the line before it was moved."));
@@ -187,6 +185,16 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const
return resolvedBinPath;
}
QString GitSettings::trIgnoreWhitespaceChanges()
{
return Tr::tr("Ignore whitespace changes");
}
QString GitSettings::trIgnoreLineMoves()
{
return Tr::tr("Ignore line moves");
}
// GitSettingsPage
class GitSettingsPage final : public Core::IOptionsPage

View File

@@ -45,6 +45,9 @@ public:
mutable bool tryResolve = true;
Utils::FilePath gitExecutable(bool *ok = nullptr, QString *errorMessage = nullptr) const;
static QString trIgnoreWhitespaceChanges();
static QString trIgnoreLineMoves();
};
GitSettings &settings();

View File

@@ -127,7 +127,7 @@ void PySideInstaller::installPyside(const FilePath &python,
install->setPackages({PipPackage(pySide)});
} else {
QDialog dialog;
dialog.setWindowTitle(Tr::tr("Select PySide version"));
dialog.setWindowTitle(Tr::tr("Select PySide Version"));
dialog.setLayout(new QVBoxLayout());
dialog.layout()->addWidget(new QLabel(Tr::tr("Select which PySide version to install:")));
QComboBox *pySideSelector = new QComboBox();
@@ -135,7 +135,7 @@ void PySideInstaller::installPyside(const FilePath &python,
for (const Utils::FilePath &version : std::as_const(availablePySides)) {
const FilePath dir = version.parentDir();
const QString text
= Tr::tr("PySide %1 wheel (%2)").arg(dir.fileName(), dir.toUserOutput());
= Tr::tr("PySide %1 Wheel (%2)").arg(dir.fileName(), dir.toUserOutput());
pySideSelector->addItem(text, version.toVariant());
}
dialog.layout()->addWidget(pySideSelector);

View File

@@ -85,7 +85,7 @@ void TerminalWidget::setupPty()
CommandLine{settings().shell(), settings().shellArguments(), CommandLine::Raw});
if (shellCommand.executable().isRootPath()) {
writeToTerminal(Tr::tr("Connecting ...\r\n").toUtf8(), true);
writeToTerminal((Tr::tr("Connecting...") + "\r\n").toUtf8(), true);
// We still have to find the shell to start ...
m_findShellWatcher.reset(new QFutureWatcher<expected_str<FilePath>>());
connect(m_findShellWatcher.get(), &QFutureWatcher<FilePath>::finished, this, [this] {
@@ -107,7 +107,7 @@ void TerminalWidget::setupPty()
shellCommand.executable());
if (result && !result->isExecutableFile())
return make_unexpected(
Tr::tr("'%1' is not executable.").arg(result->toUserOutput()));
Tr::tr("\"%1\" is not executable.").arg(result->toUserOutput()));
return result;
}));

View File

@@ -99,7 +99,7 @@ public:
{
const QIcon vcpkgIcon = Utils::Icon({{":/vcpkg/images/vcpkgicon.png",
Utils::Theme::IconsBaseColor}}).icon();
m_searchPkgAction = toolBar()->addAction(vcpkgIcon, Tr::tr("Add vcpkg package..."));
m_searchPkgAction = toolBar()->addAction(vcpkgIcon, Tr::tr("Add vcpkg Package..."));
connect(m_searchPkgAction, &QAction::triggered, this, [this] {
const Search::VcpkgManifest package =
Search::showVcpkgPackageSearchDialog(documentToManifest());
@@ -111,7 +111,7 @@ public:
});
const QIcon cmakeIcon = ProjectExplorer::Icons::CMAKE_LOGO_TOOLBAR.icon();
m_cmakeCodeAction = toolBar()->addAction(cmakeIcon, Tr::tr("CMake code..."));
m_cmakeCodeAction = toolBar()->addAction(cmakeIcon, Tr::tr("CMake Code..."));
connect(m_cmakeCodeAction, &QAction::triggered, this, [this] {
CMakeCodeDialog dlg(documentToManifest().dependencies);
dlg.exec();

View File

@@ -60,7 +60,7 @@ VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(const VcpkgManifest &preexist
, m_projectManifest(preexistingPackages)
{
resize(920, 400);
setWindowTitle(Tr::tr("Add vcpkg package"));
setWindowTitle(Tr::tr("Add vcpkg Package"));
m_packagesFilter = new FancyLineEdit;
m_packagesFilter->setFiltering(true);
@@ -98,7 +98,7 @@ VcpkgPackageSearchDialog::VcpkgPackageSearchDialog(const VcpkgManifest &preexist
m_packagesList,
},
Group {
title(Tr::tr("Package details")),
title(Tr::tr("Package Details")),
Form {
Tr::tr("Name:"), m_vcpkgName, br,
Tr::tr("Version:"), m_vcpkgVersion, br,