From c35dca17b80be4c364f7be92bd819b9c0256ff87 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 13 Jun 2023 15:39:19 +0200 Subject: [PATCH] Some more tr fixes - avoid manual line breaks - fix plural - add some translator comments - explicitly name an output pane - use imperative for placeholder text - it is a Markdown editor nowadays, not a viewer Change-Id: I8418cfe0294c028b7d873305db0af4c25bc1097f Reviewed-by: hjk Reviewed-by: Leena Miettinen Reviewed-by: --- .../clangformatglobalconfigwidget.cpp | 18 +++++++++--------- src/plugins/perfprofiler/perftimelinemodel.cpp | 2 +- .../devicesupport/devicesettingswidget.cpp | 1 + .../environmentaspectwidget.cpp | 3 ++- .../runconfigurationaspects.cpp | 2 +- src/plugins/qbsprojectmanager/qbssession.cpp | 1 + src/plugins/qbsprojectmanager/qbssettings.cpp | 1 + .../qmljseditor/qmljseditingsettingspage.cpp | 8 +++++--- src/plugins/texteditor/markdowneditor.cpp | 2 +- 9 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/plugins/clangformat/clangformatglobalconfigwidget.cpp b/src/plugins/clangformat/clangformatglobalconfigwidget.cpp index af8a0846b15..64aa2c7c0fa 100644 --- a/src/plugins/clangformat/clangformatglobalconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatglobalconfigwidget.cpp @@ -177,15 +177,15 @@ void ClangFormatGlobalConfigWidget::initOverrideCheckBox() connect(m_indentingOrFormatting, &QComboBox::currentIndexChanged, this, setEnableOverrideCheckBox); - m_overrideDefault->setToolTip(Tr::tr( - "When this option is enabled, ClangFormat will use a\n" - "user-specified configuration from the widget below,\n" - "instead of the project .clang-format file. You can\n" - "customize the formatting options for your code by\n" - "adjusting the settings in the widget. Note that any\n" - "changes made there will only affect the current\n" - "configuration, and will not modify the project\n" - ".clang-format file.")); + m_overrideDefault->setToolTip("" + + Tr::tr("When this option is enabled, ClangFormat will use a " + "user-specified configuration from the widget below, " + "instead of the project .clang-format file. You can " + "customize the formatting options for your code by " + "adjusting the settings in the widget. Note that any " + "changes made there will only affect the current " + "configuration, and will not modify the project " + ".clang-format file.")); m_overrideDefault->setChecked(getProjectOverriddenSettings(m_project)); setTemporarilyReadOnly(); diff --git a/src/plugins/perfprofiler/perftimelinemodel.cpp b/src/plugins/perfprofiler/perftimelinemodel.cpp index 03f0b80f094..2354d33ae84 100644 --- a/src/plugins/perfprofiler/perftimelinemodel.cpp +++ b/src/plugins/perfprofiler/perftimelinemodel.cpp @@ -145,7 +145,7 @@ QVariantMap PerfTimelineModel::details(int index) const manager->traceDuration())); const int guessedFrames = -frame.numSamples; if (guessedFrames > 0) - result.insert(Tr::tr("Guessed"), Tr::tr("%n frames", nullptr, guessedFrames)); + result.insert(Tr::tr("Guessed"), Tr::tr("%n frame(s)", nullptr, guessedFrames)); for (int i = 0, end = numAttributes(index); i < end; ++i) { const auto &name = orUnknown(manager->string( manager->attribute(attributeId(index, i)).name)); diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp index a35387a3c28..280b6139f87 100644 --- a/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicesettingswidget.cpp @@ -121,6 +121,7 @@ void DeviceSettingsWidget::initGui() if (!factory->quickCreationAllowed()) continue; + //: Add QAction *action = new QAction(Tr::tr("Add %1").arg(factory->displayName())); deviceTypeMenu->addAction(action); diff --git a/src/plugins/projectexplorer/environmentaspectwidget.cpp b/src/plugins/projectexplorer/environmentaspectwidget.cpp index 34e48af42c9..c167cd4e52f 100644 --- a/src/plugins/projectexplorer/environmentaspectwidget.cpp +++ b/src/plugins/projectexplorer/environmentaspectwidget.cpp @@ -65,7 +65,8 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect) topLayout->addWidget(m_environmentWidget); if (m_aspect->isPrintOnRunAllowed()) { - const auto printOnRunCheckBox = new QCheckBox(Tr::tr("Show in output pane when running")); + const auto printOnRunCheckBox = new QCheckBox( + Tr::tr("Show in Application Output when running")); printOnRunCheckBox->setChecked(m_aspect->isPrintOnRunEnabled()); connect(printOnRunCheckBox, &QCheckBox::toggled, m_aspect, &EnvironmentAspect::setPrintOnRun); diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 2257b1922a1..a685f0691ea 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -502,7 +502,7 @@ ExecutableAspect::ExecutableAspect(Target *target, ExecutionDeviceSelector selec setId("ExecutableAspect"); addDataExtractor(this, &ExecutableAspect::executable, &Data::executable); - m_executable.setPlaceHolderText(Tr::tr("path to the executable cannot be empty")); + m_executable.setPlaceHolderText(Tr::tr("Enter the path to the executable")); m_executable.setLabelText(Tr::tr("Executable:")); m_executable.setDisplayStyle(StringAspect::LabelDisplay); diff --git a/src/plugins/qbsprojectmanager/qbssession.cpp b/src/plugins/qbsprojectmanager/qbssession.cpp index 13121cfb66e..d2e5d130f0e 100644 --- a/src/plugins/qbsprojectmanager/qbssession.cpp +++ b/src/plugins/qbsprojectmanager/qbssession.cpp @@ -240,6 +240,7 @@ QString QbsSession::errorString(QbsSession::Error error) case Error::ProtocolError: return Tr::tr("The qbs process sent unexpected data."); case Error::VersionMismatch: + //: %1 == "Qt Creator" or "Qt Design Studio" return Tr::tr("The qbs API level is not compatible with " "what %1 expects.") .arg(Core::Constants::IDE_DISPLAY_NAME); diff --git a/src/plugins/qbsprojectmanager/qbssettings.cpp b/src/plugins/qbsprojectmanager/qbssettings.cpp index 91e4763bf25..58c9b96c698 100644 --- a/src/plugins/qbsprojectmanager/qbssettings.cpp +++ b/src/plugins/qbsprojectmanager/qbssettings.cpp @@ -150,6 +150,7 @@ public: m_qbsExePathChooser.setFilePath(QbsSettings::qbsExecutableFilePath()); m_defaultInstallDirLineEdit.setText(QbsSettings::defaultInstallDirTemplate()); m_versionLabel.setText(getQbsVersionString()); + //: %1 == "Qt Creator" or "Qt Design Studio" m_settingsDirCheckBox.setText(Tr::tr("Use %1 settings directory for Qbs") .arg(Core::Constants::IDE_DISPLAY_NAME)); m_settingsDirCheckBox.setChecked(QbsSettings::useCreatorSettingsDirForQbs()); diff --git a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp index c40000b09f1..3b53185bcfe 100644 --- a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp +++ b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp @@ -417,9 +417,11 @@ public: QObject::connect(useCustomAnalyzer, &QCheckBox::stateChanged, this, [this](int checked){ analyzerMessagesView->setEnabled(checked != Qt::Unchecked); }); - analyzerMessagesView->setToolTip(Tr::tr("Enabled checks can be disabled for non Qt Quick UI" - " files,\nbut disabled checks cannot get explicitly" - " enabled for non Qt Quick UI files.")); + analyzerMessagesView->setToolTip( + "" + + Tr::tr("Enabled checks can be disabled for non Qt Quick UI" + " files, but disabled checks cannot get explicitly" + " enabled for non Qt Quick UI files.")); analyzerMessagesView->setContextMenuPolicy(Qt::CustomContextMenu); connect(analyzerMessagesView, &QTreeView::customContextMenuRequested, this, &QmlJsEditingSettingsPageWidget::showContextMenu); diff --git a/src/plugins/texteditor/markdowneditor.cpp b/src/plugins/texteditor/markdowneditor.cpp index 90ca41283ec..fdde77e9dbd 100644 --- a/src/plugins/texteditor/markdowneditor.cpp +++ b/src/plugins/texteditor/markdowneditor.cpp @@ -322,7 +322,7 @@ MarkdownEditorFactory::MarkdownEditorFactory() }) { setId(MARKDOWNVIEWER_ID); - setDisplayName(::Core::Tr::tr("Markdown Viewer")); + setDisplayName(::Core::Tr::tr("Markdown Editor")); addMimeType(MARKDOWNVIEWER_MIME_TYPE); setEditorCreator([] { return new MarkdownEditor; }); }