diff --git a/src/plugins/bazaar/bazaarsettings.h b/src/plugins/bazaar/bazaarsettings.h index 5810325d600..d4ca3065dab 100644 --- a/src/plugins/bazaar/bazaarsettings.h +++ b/src/plugins/bazaar/bazaarsettings.h @@ -34,6 +34,8 @@ namespace Internal { class BazaarSettings final : public VcsBase::VcsBaseSettings { + Q_DECLARE_TR_FUNCTIONS(Bazaar::Internal::BazaarSettings) + public: BazaarSettings(); diff --git a/src/plugins/cmakeprojectmanager/cmakespecificsettings.cpp b/src/plugins/cmakeprojectmanager/cmakespecificsettings.cpp index 8c00c4f5a35..8a87865057f 100644 --- a/src/plugins/cmakeprojectmanager/cmakespecificsettings.cpp +++ b/src/plugins/cmakeprojectmanager/cmakespecificsettings.cpp @@ -72,7 +72,7 @@ CMakeSpecificSettings::CMakeSpecificSettings() CMakeSpecificSettingsPage::CMakeSpecificSettingsPage(CMakeSpecificSettings *settings) { setId("CMakeSpecificSettings"); - setDisplayName(CMakeSpecificSettings::tr("CMake")); + setDisplayName(::CMakeProjectManager::Internal::CMakeSpecificSettings::tr("CMake")); setCategory(ProjectExplorer::Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); setSettings(settings); @@ -81,7 +81,7 @@ CMakeSpecificSettingsPage::CMakeSpecificSettingsPage(CMakeSpecificSettings *sett using namespace Layouting; Column { Group { - Title(CMakeSpecificSettings::tr("Adding Files")), + Title(::CMakeProjectManager::Internal::CMakeSpecificSettings::tr("Adding Files")), s.afterAddFileSetting }, s.packageManagerAutoSetup, diff --git a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp index 494ba78f32d..71479ee0bb1 100644 --- a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp +++ b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp @@ -64,7 +64,7 @@ FileShareProtocolSettingsPage::FileShareProtocolSettingsPage(FileShareProtocolSe setLayouter([&s = *settings](QWidget *widget) { using namespace Layouting; - auto label = new QLabel(FileShareProtocolSettingsPage::tr( + auto label = new QLabel(FileShareProtocolSettings::tr( "The fileshare-based paster protocol allows for sharing code snippets using " "simple files on a shared network drive. Files are never deleted.")); label->setWordWrap(true); diff --git a/src/plugins/docker/dockerbuildstep.cpp b/src/plugins/docker/dockerbuildstep.cpp index 309171ff967..debda46aba9 100644 --- a/src/plugins/docker/dockerbuildstep.cpp +++ b/src/plugins/docker/dockerbuildstep.cpp @@ -48,6 +48,8 @@ const char DEFAULT_DOCKER_COMMAND[] = "run --read-only --rm %{BuildDevice:Docker class DockerBuildStep : public AbstractProcessStep { + Q_DECLARE_TR_FUNCTIONS(Docker::Internal::DockerBuildStep) + public: DockerBuildStep(BuildStepList *bsl, Id id) : AbstractProcessStep(bsl, id) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 83d6d3c40fb..42359391480 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -1203,7 +1203,7 @@ public: DockerDeviceSetupWizard() : QDialog(ICore::dialogParent()) { - setWindowTitle(tr("Docker Image Selection")); + setWindowTitle(DockerDevice::tr("Docker Image Selection")); resize(800, 600); m_model.setHeader({"Image", "Repository", "Tag", "Size"}); @@ -1232,7 +1232,7 @@ public: m_buttons->button(QDialogButtonBox::Ok)->setEnabled(false); CommandLine cmd{"docker", {"images", "--format", "{{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.Size}}"}}; - m_log->append(tr("Running \"%1\"\n").arg(cmd.toUserOutput())); + m_log->append(DockerDevice::tr("Running \"%1\"\n").arg(cmd.toUserOutput())); m_process = new QtcProcess(this); m_process->setCommand(cmd); @@ -1243,7 +1243,7 @@ public: for (const QString &line : out.split('\n')) { const QStringList parts = line.trimmed().split('\t'); if (parts.size() != 4) { - m_log->append(tr("Unexpected result: %1").arg(line) + '\n'); + m_log->append(DockerDevice::tr("Unexpected result: %1").arg(line) + '\n'); continue; } auto item = new DockerImageItem; @@ -1253,12 +1253,12 @@ public: item->size = parts.at(3); m_model.rootItem()->appendChild(item); } - m_log->append(tr("Done.")); + m_log->append(DockerDevice::tr("Done.")); }); connect(m_process, &Utils::QtcProcess::readyReadStandardError, this, [this] { - const QString out = tr("Error: %1").arg(m_process->stdErr()); - m_log->append(tr("Error: %1").arg(out)); + const QString out = DockerDevice::tr("Error: %1").arg(m_process->stdErr()); + m_log->append(DockerDevice::tr("Error: %1").arg(out)); }); connect(m_view->selectionModel(), &QItemSelectionModel::selectionChanged, [this] { diff --git a/src/plugins/docker/dockersettings.h b/src/plugins/docker/dockersettings.h index 42470427cb0..71854a3ce85 100644 --- a/src/plugins/docker/dockersettings.h +++ b/src/plugins/docker/dockersettings.h @@ -35,6 +35,8 @@ namespace Internal { class DockerSettings : public Utils::AspectContainer { + Q_DECLARE_TR_FUNCTIONS(Docker::Internal::DockerSettings) + public: DockerSettings(); static DockerSettings *instance(); diff --git a/src/plugins/mercurial/mercurialsettings.h b/src/plugins/mercurial/mercurialsettings.h index 14af6d92bdb..a95713903cd 100644 --- a/src/plugins/mercurial/mercurialsettings.h +++ b/src/plugins/mercurial/mercurialsettings.h @@ -34,6 +34,8 @@ namespace Internal { class MercurialSettings : public VcsBase::VcsBaseSettings { + Q_DECLARE_TR_FUNCTIONS(Mercurial::Internal::MercurialSettings) + public: Utils::StringAspect diffIgnoreWhiteSpace; Utils::StringAspect diffIgnoreBlankLines; diff --git a/src/plugins/perforce/perforcesettings.cpp b/src/plugins/perforce/perforcesettings.cpp index f8292729b0a..224bbadd818 100644 --- a/src/plugins/perforce/perforcesettings.cpp +++ b/src/plugins/perforce/perforcesettings.cpp @@ -254,7 +254,8 @@ PerforceSettingsPage::PerforceSettingsPage(PerforceSettings *settings) connect(checker, &PerforceChecker::succeeded, errorLabel, [errorLabel, testButton, checker](const QString &repo) { errorLabel->setStyleSheet({}); - errorLabel->setText(tr("Test succeeded (%1).").arg(QDir::toNativeSeparators(repo))); + errorLabel->setText(PerforceSettings::tr("Test succeeded (%1).") + .arg(QDir::toNativeSeparators(repo))); testButton->setEnabled(true); checker->deleteLater(); }); diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 40ef10ef00a..85fea189901 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -121,7 +121,7 @@ BuildSystemOutputWindow::BuildSystemOutputWindow() m_filterActionRegexp = new QAction(this); m_filterActionRegexp->setCheckable(true); - m_filterActionRegexp->setText(tr("Use Regular Expressions")); + m_filterActionRegexp->setText(ProjectWindow::tr("Use Regular Expressions")); connect(m_filterActionRegexp, &QAction::toggled, this, &BuildSystemOutputWindow::updateFilter); Core::ActionManager::registerAction(m_filterActionRegexp, kRegExpActionId, @@ -129,7 +129,7 @@ BuildSystemOutputWindow::BuildSystemOutputWindow() m_filterActionCaseSensitive = new QAction(this); m_filterActionCaseSensitive->setCheckable(true); - m_filterActionCaseSensitive->setText(tr("Case Sensitive")); + m_filterActionCaseSensitive->setText(ProjectWindow::tr("Case Sensitive")); connect(m_filterActionCaseSensitive, &QAction::toggled, this, @@ -140,7 +140,7 @@ BuildSystemOutputWindow::BuildSystemOutputWindow() m_invertFilterAction = new QAction(this); m_invertFilterAction->setCheckable(true); - m_invertFilterAction->setText(tr("Show Non-matching Lines")); + m_invertFilterAction->setText(ProjectWindow::tr("Show Non-matching Lines")); connect(m_invertFilterAction, &QAction::toggled, this, &BuildSystemOutputWindow::updateFilter); Core::ActionManager::registerAction(m_invertFilterAction, kInvertActionId, diff --git a/src/plugins/qmldesigner/designercore/metainfo/metainforeader.cpp b/src/plugins/qmldesigner/designercore/metainfo/metainforeader.cpp index c79a506ea6f..5baf856dce9 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/metainforeader.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/metainforeader.cpp @@ -100,7 +100,8 @@ void MetaInfoReader::elementStart(const QString &name) case ParsingHints: case Finished: case Undefined: setParserState(Error); - addError(tr("Illegal state while parsing."), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Illegal state while parsing."), + currentSourceLocation()); case Error: default: return; } @@ -120,7 +121,8 @@ void MetaInfoReader::elementEnd() case ParsingDocument: case Finished: case Undefined: setParserState(Error); - addError(tr("Illegal state while parsing."), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Illegal state while parsing."), + currentSourceLocation()); case Error: default: return; } @@ -135,12 +137,16 @@ void MetaInfoReader::propertyDefinition(const QString &name, const QVariant &val case ParsingProperty: readPropertyProperty(name, value); break; case ParsingQmlSource: readQmlSourceProperty(name, value); break; case ParsingExtraFile: readExtraFileProperty(name, value); break; - case ParsingMetaInfo: addError(tr("No property definition allowed."), currentSourceLocation()); break; + case ParsingMetaInfo: + addError(::QmlDesigner::Internal::MetaInfoReader::tr("No property definition allowed."), + currentSourceLocation()); + break; case ParsingDocument: case ParsingHints: readHint(name, value); break; case Finished: case Undefined: setParserState(Error); - addError(tr("Illegal state while parsing."), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Illegal state while parsing."), + currentSourceLocation()); case Error: default: return; } @@ -203,26 +209,30 @@ MetaInfoReader::ParserSate MetaInfoReader::readItemLibraryEntryElement(const QSt } else if (name == ExtraFileElementName) { return ParsingExtraFile; } else { - addError(tr("Invalid type %1").arg(name), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(name), + currentSourceLocation()); return Error; } } MetaInfoReader::ParserSate MetaInfoReader::readPropertyElement(const QString &name) { - addError(tr("Invalid type %1").arg(name), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(name), + currentSourceLocation()); return Error; } MetaInfoReader::ParserSate MetaInfoReader::readQmlSourceElement(const QString &name) { - addError(tr("Invalid type %1").arg(name), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(name), + currentSourceLocation()); return Error; } MetaInfoReader::ParserSate MetaInfoReader::readExtraFileElement(const QString &name) { - addError(tr("Invalid type %1").arg(name), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(name), + currentSourceLocation()); return Error; } @@ -237,7 +247,9 @@ void MetaInfoReader::readImportsProperty(const QString &name, const QVariant &va // imports to keep compatibility with old metainfo files. m_metaInfo.itemLibraryInfo()->addPriorityImports(Utils::toSet(values)); } else { - addError(tr("Unknown property for Imports %1").arg(name), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for Imports %1") + .arg(name), + currentSourceLocation()); setParserState(Error); } } @@ -251,7 +263,9 @@ void MetaInfoReader::readTypeProperty(const QString &name, const QVariant &value } else if (name == QStringLiteral("icon")) { m_currentIcon = absoluteFilePathForDocument(value.toString()); } else { - addError(tr("Unknown property for Type %1").arg(name), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for Type %1") + .arg(name), + currentSourceLocation()); setParserState(Error); } } @@ -269,7 +283,10 @@ void MetaInfoReader::readItemLibraryEntryProperty(const QString &name, const QVa } else if (name == QStringLiteral("requiredImport")) { m_currentEntry.setRequiredImport(value.toString()); } else { - addError(tr("Unknown property for ItemLibraryEntry %1").arg(name), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr( + "Unknown property for ItemLibraryEntry %1") + .arg(name), + currentSourceLocation()); setParserState(Error); } } @@ -299,7 +316,9 @@ void MetaInfoReader::readPropertyProperty(const QString &name, const QVariant &v } else if (name == QStringLiteral("value")) { m_currentPropertyValue = deEscapeVariant(value); } else { - addError(tr("Unknown property for Property %1").arg(name), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for Property %1") + .arg(name), + currentSourceLocation()); setParserState(Error); } } @@ -309,7 +328,9 @@ void MetaInfoReader::readQmlSourceProperty(const QString &name, const QVariant & if (name == QLatin1String("source")) { m_currentEntry.setQmlPath(absoluteFilePathForDocument(value.toString())); } else { - addError(tr("Unknown property for QmlSource %1").arg(name), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for QmlSource %1") + .arg(name), + currentSourceLocation()); setParserState(Error); } } @@ -319,7 +340,9 @@ void MetaInfoReader::readExtraFileProperty(const QString &name, const QVariant & if (name == QLatin1String("source")) { m_currentEntry.addExtraFilePath(absoluteFilePathForDocument(value.toString())); } else { - addError(tr("Unknown property for ExtraFile %1").arg(name), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for ExtraFile %1") + .arg(name), + currentSourceLocation()); setParserState(Error); } } @@ -366,7 +389,10 @@ void MetaInfoReader::syncItemLibraryEntries() try { m_metaInfo.itemLibraryInfo()->addEntries(m_bufferedEntries, m_overwriteDuplicates); } catch (const InvalidMetaInfoException &) { - addError(tr("Invalid or duplicate library entry %1").arg(m_currentEntry.name()), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr( + "Invalid or duplicate library entry %1") + .arg(m_currentEntry.name()), + currentSourceLocation()); } m_bufferedEntries.clear(); } @@ -383,7 +409,8 @@ void MetaInfoReader::insertProperty() void MetaInfoReader::addErrorInvalidType(const QString &typeName) { - addError(tr("Invalid type %1").arg(typeName), currentSourceLocation()); + addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(typeName), + currentSourceLocation()); } QString MetaInfoReader::absoluteFilePathForDocument(const QString &relativeFilePath) diff --git a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp index 57759022ba2..7466604d054 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/subcomponentmanager.cpp @@ -407,7 +407,7 @@ void SubComponentManager::parseQuick3DAssetsItem(const QString &importUrl, const ItemLibraryEntry itemLibraryEntry; itemLibraryEntry.setType(type.toUtf8(), 1, 0); itemLibraryEntry.setName(name); - itemLibraryEntry.setCategory(tr("My 3D Components")); + itemLibraryEntry.setCategory(::QmlDesigner::SubComponentManager::tr("My 3D Components")); itemLibraryEntry.setRequiredImport(importUrl); QString iconPath = qmlIt.fileInfo().absolutePath() + '/' + Constants::QUICK_3D_ASSET_ICON_DIR + '/' + name diff --git a/src/plugins/qmldesigner/designercore/model/documentmessage.cpp b/src/plugins/qmldesigner/designercore/model/documentmessage.cpp index 1d0c124b52f..7039caca6c8 100644 --- a/src/plugins/qmldesigner/designercore/model/documentmessage.cpp +++ b/src/plugins/qmldesigner/designercore/model/documentmessage.cpp @@ -70,9 +70,9 @@ QString DocumentMessage::toString() const QString str; if (m_type == ParseError) - str += tr("Error parsing"); + str += ::QmlDesigner::DocumentMessage::tr("Error parsing"); else if (m_type == InternalError) - str += tr("Internal error"); + str += ::QmlDesigner::DocumentMessage::tr("Internal error"); if (url().isValid()) { if (!str.isEmpty()) @@ -84,14 +84,14 @@ QString DocumentMessage::toString() const if (line() != -1) { if (!str.isEmpty()) str += QLatin1Char(' '); - str += tr("line %1").arg(line()); + str += ::QmlDesigner::DocumentMessage::tr("line %1").arg(line()); } if (column() != -1) { if (!str.isEmpty()) str += QLatin1Char(' '); - str += tr("column %1").arg(column()); + str += ::QmlDesigner::DocumentMessage::tr("column %1").arg(column()); } if (!str.isEmpty()) diff --git a/src/plugins/remotelinux/remotelinuxkillappservice.cpp b/src/plugins/remotelinux/remotelinuxkillappservice.cpp index 73e7b697e5c..ddbe72b1f0d 100644 --- a/src/plugins/remotelinux/remotelinuxkillappservice.cpp +++ b/src/plugins/remotelinux/remotelinuxkillappservice.cpp @@ -26,7 +26,7 @@ #include "remotelinuxkillappservice.h" #include -# + namespace RemoteLinux { namespace Internal { class RemoteLinuxKillAppServicePrivate diff --git a/src/plugins/valgrind/valgrindsettings.h b/src/plugins/valgrind/valgrindsettings.h index f5011587bbd..63072dba668 100644 --- a/src/plugins/valgrind/valgrindsettings.h +++ b/src/plugins/valgrind/valgrindsettings.h @@ -40,6 +40,8 @@ class SuppressionAspectPrivate; class SuppressionAspect final : public Utils::BaseAspect { + Q_DECLARE_TR_FUNCTIONS(Valgrind::Internal::SuppressionAspect) + public: explicit SuppressionAspect(bool global); ~SuppressionAspect() final;