Fix various translatable strings

Change-Id: I08e81f188a68c8e820f20a35249d1b318178a7b9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Eike Ziller
2024-06-26 14:15:33 +02:00
parent 269fc1fd6b
commit e20f33cd4c
14 changed files with 48 additions and 36 deletions

View File

@@ -55,12 +55,12 @@ static std::optional<QDomElement> documentElement(const FilePath &fileName)
{
QFile file(fileName.toString());
if (!file.open(QIODevice::ReadOnly)) {
MessageManager::writeDisrupting(Tr::tr("Cannot open: %1").arg(fileName.toUserOutput()));
MessageManager::writeDisrupting(Tr::tr("Cannot open \"%1\".").arg(fileName.toUserOutput()));
return {};
}
QDomDocument doc;
if (!doc.setContent(file.readAll())) {
MessageManager::writeDisrupting(Tr::tr("Cannot parse: %1").arg(fileName.toUserOutput()));
MessageManager::writeDisrupting(Tr::tr("Cannot parse \"%1\".").arg(fileName.toUserOutput()));
return {};
}
return doc.documentElement();

View File

@@ -313,7 +313,7 @@ static GroupItem updateRecipe(const Storage<DialogStorage> &dialogStorage)
const QStringList args = {"--update", sdkRootArg()};
QuestionProgressDialog *dialog = dialogStorage->m_dialog.get();
setupSdkProcess(args, &process, dialog, 0, 1);
dialog->appendMessage(Tr::tr("Updating installed packages....") + '\n', NormalMessageFormat);
dialog->appendMessage(Tr::tr("Updating installed packages...") + '\n', NormalMessageFormat);
dialog->setProgress(0);
};
const auto onDone = [dialogStorage](DoneWith result) {

View File

@@ -69,7 +69,7 @@ ProjectTestSettingsWidget::ProjectTestSettingsWidget(Project *project)
m_pathFilters = new QTreeWidget;
m_pathFilters->setHeaderHidden(true);
m_pathFilters->setRootIsDecorated(false);
QLabel *filterLabel = new QLabel(Tr::tr("Wildcard expressions for filtering"), this);
QLabel *filterLabel = new QLabel(Tr::tr("Wildcard expressions for filtering:"), this);
QPushButton *addFilter = new QPushButton(Tr::tr("Add"), this);
QPushButton *removeFilter = new QPushButton(Tr::tr("Remove"), this);
removeFilter->setEnabled(false);

View File

@@ -35,7 +35,7 @@ TestSettings::TestSettings()
useTimeout.setSettingsKey("UseTimeout");
useTimeout.setDefaultValue(false);
useTimeout.setLabelText(Tr::tr("Timeout"));
useTimeout.setLabelText(Tr::tr("Timeout:"));
useTimeout.setToolTip(Tr::tr("Use a timeout while executing test cases."));
timeout.setSettingsKey("Timeout");

View File

@@ -879,17 +879,17 @@ public:
dashboardUrl.setQuery(search.toUrlQuery(QueryMode::FilterQuery));
QMenu *menu = new QMenu;
auto action = new QAction(Tr::tr("Open issue in Dashboard"), menu);
auto action = new QAction(Tr::tr("Open Issue in Dashboard"), menu);
menu->addAction(action);
QObject::connect(action, &QAction::triggered, menu, [issueBaseUrl] {
QDesktopServices::openUrl(issueBaseUrl);
});
action = new QAction(Tr::tr("Open table in Dashboard"), menu);
action = new QAction(Tr::tr("Open Table in Dashboard"), menu);
QObject::connect(action, &QAction::triggered, menu, [dashboardUrl] {
QDesktopServices::openUrl(dashboardUrl);
});
menu->addAction(action);
action = new QAction(Tr::tr("Copy Dashboard link to clipboard"), menu);
action = new QAction(Tr::tr("Copy Dashboard Link to Clipboard"), menu);
QObject::connect(action, &QAction::triggered, menu, [dashboardUrl] {
if (auto clipboard = QGuiApplication::clipboard())
clipboard->setText(dashboardUrl.toString());

View File

@@ -308,16 +308,17 @@ AxivionSettingsWidget::AxivionSettingsWidget()
auto addButton = new QPushButton(Tr::tr("Add..."), this);
m_edit = new QPushButton(Tr::tr("Edit..."), this);
m_remove = new QPushButton(Tr::tr("Remove"), this);
Column {
Row {
Form {
Tr::tr("Default dashboard server"), m_dashboardServers, br
}, st,
Column { addButton, m_edit, st, m_remove },
Column{
Row{
Form{Tr::tr("Default dashboard server:"), m_dashboardServers, br},
st,
Column{addButton, m_edit, st, m_remove},
},
Space(10), br,
Row { settings().highlightMarks }, st
}.attachTo(this);
Space(10),
br,
Row{settings().highlightMarks},
st}
.attachTo(this);
connect(addButton, &QPushButton::clicked, this, [this] {
// add an empty item unconditionally
@@ -357,10 +358,11 @@ void AxivionSettingsWidget::updateEnabledStates()
void AxivionSettingsWidget::removeCurrentServerConfig()
{
const QString config = m_dashboardServers->currentData().value<AxivionServer>().displayString();
if (QMessageBox::question(ICore::dialogParent(), Tr::tr("Remove Server Configuration"),
Tr::tr("Do you really want to remove the server configuration "
"\"%1\"?").arg(config))
!= QMessageBox::Yes) {
if (QMessageBox::question(
ICore::dialogParent(),
Tr::tr("Remove Server Configuration"),
Tr::tr("Remove the server configuration \"%1\"?").arg(config))
!= QMessageBox::Yes) {
return;
}
m_dashboardServers->removeItem(m_dashboardServers->currentIndex());

View File

@@ -110,7 +110,7 @@ ClangFormatGlobalConfigWidget::ClangFormatGlobalConfigWidget(ICodeStylePreferenc
// clang-format off
Group globalSettingsGroupBox {
bindTo(&globalSettingsGroupBoxWidget),
title(Tr::tr("ClangFormat Settings:")),
title(Tr::tr("ClangFormat Settings")),
Column {
m_useGlobalSettings,
Form {

View File

@@ -518,7 +518,7 @@ bool PresetsParser::parse(const Utils::FilePath &jsonFile, QString &errorMessage
m_presetsData.configurePresets,
jsonFile.parentDir())) {
errorMessage = ::CMakeProjectManager::Tr::tr(
"Invalid \"configurePresets\" section in %1 file")
"Invalid \"configurePresets\" section in file \"%1\".")
.arg(jsonFile.fileName());
return false;
}
@@ -527,14 +527,15 @@ bool PresetsParser::parse(const Utils::FilePath &jsonFile, QString &errorMessage
if (!parseBuildPresets(root.value("buildPresets"),
m_presetsData.buildPresets,
jsonFile.parentDir())) {
errorMessage = ::CMakeProjectManager::Tr::tr("Invalid \"buildPresets\" section in %1 file.")
errorMessage = ::CMakeProjectManager::Tr::tr(
"Invalid \"buildPresets\" section in file \"%1\".")
.arg(jsonFile.fileName());
return false;
}
// optional
if (!parseVendor(root.value("vendor"), m_presetsData.vendor)) {
errorMessage = ::CMakeProjectManager::Tr::tr("Invalid \"vendor\" section in %1 file.")
errorMessage = ::CMakeProjectManager::Tr::tr("Invalid \"vendor\" section in file \"%1\".")
.arg(jsonFile.fileName());
}

View File

@@ -47,7 +47,7 @@ class HeaderGuardExpander : public MacroExpander
public:
HeaderGuardExpander(const FilePath &filePath) : m_filePath(filePath)
{
setDisplayName(Tr::tr("Header file variables"));
setDisplayName(Tr::tr("Header File Variables"));
registerFileVariables("Header", Tr::tr("Header file"), [this] {
return m_filePath;
});

View File

@@ -447,8 +447,10 @@ void ElementTasks::openLinkedFile(const qmt::MElement *element)
(void) Core::EditorManager::openEditor(filepath);
}
} else {
QMessageBox::critical(Core::ICore::dialogParent(), Tr::tr("Opening File"),
Tr::tr("File %1 does not exist.").arg(filepath.toUserOutput()));
QMessageBox::critical(
Core::ICore::dialogParent(),
Tr::tr("Opening File"),
Tr::tr("File \"%1\" does not exist.").arg(filepath.toUserOutput()));
}
}
}

View File

@@ -257,8 +257,10 @@ void ExtPropertiesMView::onImagePathChanged(const QString &path)
assignModelElement<qmt::DObject, QImage>(m_diagramElements, SelectionSingle, image,
&qmt::DObject::image, &qmt::DObject::setImage);
} else {
QMessageBox::critical(Core::ICore::dialogParent(), Tr::tr("Selecting Image"),
Tr::tr("Unable to read image file %1").arg(path));
QMessageBox::critical(
Core::ICore::dialogParent(),
Tr::tr("Selecting Image"),
Tr::tr("Unable to read image file \"%1\".").arg(path));
}
}
}

View File

@@ -57,7 +57,7 @@ BuildPropertiesSettings::BuildPropertiesSettings()
buildDirectoryTemplate.setToolTip(
Tr::tr("Template used to construct the default build directory.<br><br>"
"The default value can be set using the environment variable "
"<tt>%1</tt>")
"<tt>%1</tt>.")
.arg(Constants::QTC_DEFAULT_BUILD_DIRECTORY_TEMPLATE));
buildDirectoryTemplate.setUseResetButton();

View File

@@ -310,10 +310,11 @@ ProjectExplorerSettingsWidget::ProjectExplorerSettingsWidget()
{
m_reaperTimeoutSpinBox = new QSpinBox;
m_reaperTimeoutSpinBox->setMinimum(1);
//: Suffix for "seconds"
m_reaperTimeoutSpinBox->setSuffix(Tr::tr("s"));
m_reaperTimeoutSpinBox->setToolTip(
Tr::tr("The amount of seconds to wait between a \"soft kill\" and a \"hard kill\" of a "
"running application"));
"running application."));
m_currentDirectoryRadioButton = new QRadioButton(Tr::tr("Current directory"));
m_directoryRadioButton = new QRadioButton(Tr::tr("Directory"));

View File

@@ -711,8 +711,11 @@ void SshProcessInterfacePrivate::start()
auto linuxDevice = std::dynamic_pointer_cast<const LinuxDevice>(m_device);
QTC_ASSERT(linuxDevice, handleDone(); return);
if (linuxDevice->isDisconnected()) {
emit q->done({-1, QProcess::CrashExit, QProcess::FailedToStart,
Tr::tr("Device \"%1\" is disconnected").arg(linuxDevice->displayName())});
emit q->done(
{-1,
QProcess::CrashExit,
QProcess::FailedToStart,
Tr::tr("Device \"%1\" is disconnected.").arg(linuxDevice->displayName())});
return;
}
linuxDevice->connectionAccess()
@@ -1646,7 +1649,7 @@ private:
const expected_str<void> result = async.result();
if (result)
emit progress(
Tr::tr("Created directory: %1\n").arg(iteratorParentDirs->toUserOutput()));
Tr::tr("Created directory: \"%1\".\n").arg(iteratorParentDirs->toUserOutput()));
else
emit progress(result.error());
};
@@ -1665,7 +1668,8 @@ private:
++counter;
if (result) {
emit progress(Tr::tr("Copied %1/%2: %3 -> %4\n")
//: %1/%2 = progress in the form 4/15, %3 and %4 = source and target file paths
emit progress(Tr::tr("Copied %1/%2: \"%3\" -> \"%4\".\n")
.arg(counter)
.arg(m_setup.m_files.size())
.arg(iterator->m_source.toUserOutput())