From a6f2ee5b8c18d309dd675a5bb7a81687fae2370b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 13 Jun 2023 15:25:38 +0200 Subject: [PATCH] Python: Tr fixes Add missing colons, quotes and full stops, and don't use book style capitalization for labels. Change-Id: If338922c7221eac498612ad5a152f24cd921e884 Reviewed-by: Leena Miettinen --- src/plugins/projectexplorer/runconfigurationaspects.cpp | 2 +- src/plugins/python/pipsupport.cpp | 5 +++-- src/plugins/python/pythonsettings.cpp | 4 ++-- src/plugins/python/pythonwizardpage.cpp | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 5a155794460..2257b1922a1 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -845,7 +845,7 @@ void InterpreterAspect::addToLayout(LayoutItem &builder) Core::ICore::showOptionsDialog(m_settingsDialogId); }); - builder.addItems({Tr::tr("Interpreter"), m_comboBox.data(), manageButton}); + builder.addItems({Tr::tr("Interpreter:"), m_comboBox.data(), manageButton}); } void InterpreterAspect::updateCurrentInterpreter() diff --git a/src/plugins/python/pipsupport.cpp b/src/plugins/python/pipsupport.cpp index b420f24aa50..d6070663fb6 100644 --- a/src/plugins/python/pipsupport.cpp +++ b/src/plugins/python/pipsupport.cpp @@ -92,8 +92,9 @@ void PipInstallTask::handleDone() m_future.reportFinished(); const bool success = m_process.result() == ProcessResult::FinishedWithSuccess; if (!success) { - Core::MessageManager::writeFlashing(Tr::tr("Installing %1 failed with exit code %2") - .arg(packagesDisplayName()).arg(m_process.exitCode())); + Core::MessageManager::writeFlashing(Tr::tr("Installing \"%1\" failed with exit code %2.") + .arg(packagesDisplayName()) + .arg(m_process.exitCode())); } emit finished(success); } diff --git a/src/plugins/python/pythonsettings.cpp b/src/plugins/python/pythonsettings.cpp index daa4f591c03..da3c6e647e7 100644 --- a/src/plugins/python/pythonsettings.cpp +++ b/src/plugins/python/pythonsettings.cpp @@ -811,12 +811,12 @@ void PythonSettings::createVirtualEnvironmentInteractive( if (!preselectedId.isEmpty() && interpreter.id == preselectedId) interpreters->setCurrentIndex(interpreters->count() - 1); } - layout->addRow(Tr::tr("Python Interpreter"), interpreters); + layout->addRow(Tr::tr("Python interpreter:"), interpreters); auto pathChooser = new PathChooser(); pathChooser->setInitialBrowsePathBackup(startDirectory); pathChooser->setExpectedKind(PathChooser::Directory); pathChooser->setPromptDialogTitle(Tr::tr("New Python Virtual Environment Directory")); - layout->addRow(Tr::tr("Virtual Environment Directory"), pathChooser); + layout->addRow(Tr::tr("Virtual environment directory:"), pathChooser); auto buttons = new QDialogButtonBox(QDialogButtonBox::Cancel); auto createButton = buttons->addButton(Tr::tr("Create"), QDialogButtonBox::AcceptRole); createButton->setEnabled(false); diff --git a/src/plugins/python/pythonwizardpage.cpp b/src/plugins/python/pythonwizardpage.cpp index bcbca5a7072..253422ed20c 100644 --- a/src/plugins/python/pythonwizardpage.cpp +++ b/src/plugins/python/pythonwizardpage.cpp @@ -65,7 +65,7 @@ bool PythonWizardPageFactory::validateData(Id typeId, const QVariant &data, QStr if (items.isEmpty()) { if (errorMessage) { *errorMessage = Tr::tr("'data' of a Python wizard page expects a map with 'items' " - "containing a list of objects"); + "containing a list of objects."); } return false; } @@ -92,16 +92,16 @@ PythonWizardPage::PythonWizardPage(const QList> &pySide this, &PythonWizardPage::updateInterpreters); - m_pySideVersion.setLabelText(Tr::tr("PySide version")); + m_pySideVersion.setLabelText(Tr::tr("PySide version:")); m_pySideVersion.setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox); for (auto [name, data] : pySideAndData) m_pySideVersion.addOption(SelectionAspect::Option(name, {}, data)); if (defaultPyside >= 0) m_pySideVersion.setDefaultValue(defaultPyside); - m_createVenv.setLabelText(Tr::tr("Create new Virtual Environment")); + m_createVenv.setLabelText(Tr::tr("Create new virtual environment")); - m_venvPath.setLabelText(Tr::tr("Path to virtual environment")); + m_venvPath.setLabelText(Tr::tr("Path to virtual environment:")); m_venvPath.setEnabler(&m_createVenv); m_venvPath.setExpectedKind(PathChooser::Directory);