diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp index f8cc7a8dee1..44bbc5ffdbf 100644 --- a/src/libs/advanceddockingsystem/dockmanager.cpp +++ b/src/libs/advanceddockingsystem/dockmanager.cpp @@ -952,7 +952,7 @@ namespace ADS const bool success = write(workspace, data, &errorString); if (!success) QMessageBox::critical(parent, - QCoreApplication::translate("Utils::FileSaverBase", "File Error"), + QCoreApplication::translate("::Utils", "File Error"), errorString); return success; } diff --git a/src/plugins/clangcodemodel/clangtextmark.cpp b/src/plugins/clangcodemodel/clangtextmark.cpp index a8608458797..c67a5cab182 100644 --- a/src/plugins/clangcodemodel/clangtextmark.cpp +++ b/src/plugins/clangcodemodel/clangtextmark.cpp @@ -121,8 +121,7 @@ void disableDiagnosticInCurrentProjectConfig(const ClangDiagnostic &diagnostic) // Create copy if needed if (config.isReadOnly()) { - const QString name = QCoreApplication::translate("ClangDiagnosticConfig", - "Project: %1 (based on %2)") + const QString name = Tr::tr("Project: %1 (based on %2)") .arg(project->displayName(), config.displayName()); config = ClangDiagnosticConfigsModel::createCustomConfig(config, name); } @@ -141,9 +140,7 @@ void disableDiagnosticInCurrentProjectConfig(const ClangDiagnostic &diagnostic) projectSettings.setDiagnosticConfigId(config.id()); // Notify the user about changed project specific settings - const QString text - = QCoreApplication::translate("ClangDiagnosticConfig", - "Changes applied in Projects Mode > Clang Code Model"); + const QString text = Tr::tr("Changes applied in Projects Mode > Clang Code Model"); FadingIndicator::showText(Core::ICore::mainWindow(), text, FadingIndicator::SmallText); diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp index f577cbed4b7..f236fa81b07 100644 --- a/src/plugins/clangcodemodel/clangutils.cpp +++ b/src/plugins/clangcodemodel/clangutils.cpp @@ -154,15 +154,14 @@ GenerateCompilationDbResult generateCompilationDB(QList p FilePath clangIncludeDir) { QTC_ASSERT(!baseDir.isEmpty(), return GenerateCompilationDbResult(QString(), - QCoreApplication::translate("ClangUtils", "Could not retrieve build directory."))); + Tr::tr("Could not retrieve build directory."))); QTC_ASSERT(!projectInfoList.isEmpty(), return GenerateCompilationDbResult(QString(), "Could not retrieve project info.")); QTC_CHECK(baseDir.ensureWritableDir()); QFile compileCommandsFile(baseDir.pathAppended("compile_commands.json").toFSPathString()); const bool fileOpened = compileCommandsFile.open(QIODevice::WriteOnly | QIODevice::Truncate); if (!fileOpened) { - return GenerateCompilationDbResult(QString(), - QCoreApplication::translate("ClangUtils", "Could not create \"%1\": %2") + return GenerateCompilationDbResult(QString(), Tr::tr("Could not create \"%1\": %2") .arg(compileCommandsFile.fileName(), compileCommandsFile.errorString())); } compileCommandsFile.write("["); diff --git a/src/plugins/clangtools/settingswidget.cpp b/src/plugins/clangtools/settingswidget.cpp index 8e67df96766..bbac5aa7068 100644 --- a/src/plugins/clangtools/settingswidget.cpp +++ b/src/plugins/clangtools/settingswidget.cpp @@ -116,7 +116,7 @@ ClangToolsOptionsPage::ClangToolsOptionsPage() setId(Constants::SETTINGS_PAGE_ID); setDisplayName(Tr::tr("Clang Tools")); setCategory("T.Analyzer"); - setDisplayCategory(QCoreApplication::translate("Analyzer", "Analyzer")); + setDisplayCategory(QCoreApplication::translate("::Debugger", "Analyzer")); setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); setWidgetCreator([] { return new SettingsWidget; }); } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index b7908db22ae..e37e40337d9 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -246,7 +246,7 @@ bool CMakeBuildStep::init() RunConfiguration *rc = target()->activeRunConfiguration(); if (!rc || rc->buildKey().isEmpty()) { emit addTask(BuildSystemTask(Task::Error, - QCoreApplication::translate("ProjectExplorer::Task", + QCoreApplication::translate("::ProjectExplorer", "You asked to build the current Run Configuration's build target only, " "but it is not associated with a build target. " "Update the Make Step in your build settings."))); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp index e0288716573..bb0270d16ef 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectplugin.cpp @@ -181,7 +181,7 @@ void CMakeProjectPlugin::initialize() }); Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::CMAKEFORMATTER_MENU_ID); - menu->menu()->setTitle(QCoreApplication::translate("CMakeFormatter", "CMakeFormatter")); + menu->menu()->setTitle(Tr::tr("CMakeFormatter")); menu->setOnAllDisabledBehavior(Core::ActionContainer::Show); Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu); diff --git a/src/plugins/cppcheck/cppcheckoptions.cpp b/src/plugins/cppcheck/cppcheckoptions.cpp index e78f2d59fe9..217a8e9063f 100644 --- a/src/plugins/cppcheck/cppcheckoptions.cpp +++ b/src/plugins/cppcheck/cppcheckoptions.cpp @@ -126,7 +126,7 @@ CppcheckOptionsPage::CppcheckOptionsPage(CppcheckTool &tool, CppcheckTrigger &tr setId(Constants::OPTIONS_PAGE_ID); setDisplayName(Tr::tr("Cppcheck")); setCategory("T.Analyzer"); - setDisplayCategory(QCoreApplication::translate("Analyzer", "Analyzer")); + setDisplayCategory(QCoreApplication::translate("::Debugger", "Analyzer")); setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); CppcheckOptions options; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 9797a354bba..b420104afb5 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -5077,7 +5077,7 @@ void GdbEngine::handleFetchVariables(const DebuggerResponse &response) QString GdbEngine::msgPtraceError(DebuggerStartMode sm) { if (sm == StartInternal) { - return QCoreApplication::translate("QtDumperHelper", + return Tr::tr( "ptrace: Operation not permitted.\n\n" "Could not attach to the process. " "Make sure no other debugger traces this process.\n" @@ -5085,7 +5085,7 @@ QString GdbEngine::msgPtraceError(DebuggerStartMode sm) "/proc/sys/kernel/yama/ptrace_scope\n" "For more details, see /etc/sysctl.d/10-ptrace.conf\n"); } - return QCoreApplication::translate("QtDumperHelper", + return Tr::tr( "ptrace: Operation not permitted.\n\n" "Could not attach to the process. " "Make sure no other debugger traces this process.\n" diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 1e7c6c6c677..204d6c4437c 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -1079,7 +1079,7 @@ void QmlEnginePrivate::updateScriptSource(const QString &fileName, int lineOffse } //update open editors - QString titlePattern = QCoreApplication::translate("QmlEngine", "JS Source for %1").arg(fileName); + QString titlePattern = Tr::tr("JS Source for %1").arg(fileName); //Check if there are open editors with the same title const QList documents = DocumentModel::openedDocuments(); for (IDocument *doc: documents) { @@ -2044,7 +2044,7 @@ StackFrame QmlEnginePrivate::extractStackFrame(const QVariant &bodyVal) stackFrame.function = extractString(body.value("func")); if (stackFrame.function.isEmpty()) - stackFrame.function = QCoreApplication::translate("QmlEngine", "Anonymous Function"); + stackFrame.function = Tr::tr("Anonymous Function"); stackFrame.file = FilePath::fromString( engine->toFileInProject(extractString(body.value("script")))); stackFrame.usable = stackFrame.file.isReadableFile(); diff --git a/src/plugins/designer/formtemplatewizardpage.cpp b/src/plugins/designer/formtemplatewizardpage.cpp index 7eb2d47c0bc..a77b5b4321b 100644 --- a/src/plugins/designer/formtemplatewizardpage.cpp +++ b/src/plugins/designer/formtemplatewizardpage.cpp @@ -46,7 +46,7 @@ bool FormPageFactory::validateData(Utils::Id typeId, const QVariant &data, QStri { QTC_ASSERT(canCreate(typeId), return false); if (!data.isNull() && (data.type() != QVariant::Map || !data.toMap().isEmpty())) { - *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonWizard", + *errorMessage = QCoreApplication::translate("::ProjectExplorer", "\"data\" for a \"Form\" page needs to be unset or an empty object."); return false; } diff --git a/src/plugins/git/gerrit/gerritserver.cpp b/src/plugins/git/gerrit/gerritserver.cpp index 793586f54f0..1ac7a649934 100644 --- a/src/plugins/git/gerrit/gerritserver.cpp +++ b/src/plugins/git/gerrit/gerritserver.cpp @@ -281,10 +281,8 @@ bool GerritServer::resolveRoot() case CertificateError: if (QMessageBox::question( Core::ICore::dialogParent(), - QCoreApplication::translate( - "Gerrit::Internal::GerritDialog", "Certificate Error"), - QCoreApplication::translate( - "Gerrit::Internal::GerritDialog", + Tr::tr("Certificate Error"), + Tr::tr( "Server certificate for %1 cannot be authenticated.\n" "Do you want to disable SSL verification for this server?\n" "Note: This can expose you to man-in-the-middle attack.") diff --git a/src/plugins/perfprofiler/perfoptionspage.cpp b/src/plugins/perfprofiler/perfoptionspage.cpp index 0ca8230b13f..c67d18d63f7 100644 --- a/src/plugins/perfprofiler/perfoptionspage.cpp +++ b/src/plugins/perfprofiler/perfoptionspage.cpp @@ -16,7 +16,7 @@ PerfOptionsPage::PerfOptionsPage(PerfSettings *settings) setId(Constants::PerfSettingsId); setDisplayName(Tr::tr("CPU Usage")); setCategory("T.Analyzer"); - setDisplayCategory(QCoreApplication::translate("Analyzer", "Analyzer")); + setDisplayCategory(QCoreApplication::translate("::Debugger", "Analyzer")); setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); setWidgetCreator([settings] { return new PerfConfigWidget(settings); }); } diff --git a/src/plugins/projectexplorer/extraabi.cpp b/src/plugins/projectexplorer/extraabi.cpp index f4505d10019..53eb954bcfe 100644 --- a/src/plugins/projectexplorer/extraabi.cpp +++ b/src/plugins/projectexplorer/extraabi.cpp @@ -4,6 +4,7 @@ #include "extraabi.h" #include "abi.h" +#include "projectexplorertr.h" #include @@ -39,8 +40,7 @@ public: }; AbiFlavorAccessor::AbiFlavorAccessor() : - UpgradingSettingsAccessor("QtCreatorExtraAbi", - QCoreApplication::translate("ProjectExplorer::ToolChainManager", "ABI"), + UpgradingSettingsAccessor("QtCreatorExtraAbi", Tr::tr("ABI") Core::Constants::IDE_DISPLAY_NAME) { setBaseFilePath(Core::ICore::installerResourcePath("abi.xml")); diff --git a/src/plugins/qtsupport/profilereader.cpp b/src/plugins/qtsupport/profilereader.cpp index 556a1256f84..6e8877566bf 100644 --- a/src/plugins/qtsupport/profilereader.cpp +++ b/src/plugins/qtsupport/profilereader.cpp @@ -3,6 +3,8 @@ #include "profilereader.h" +#include "qtsupporttr.h" + #include #include @@ -26,7 +28,7 @@ ProMessageHandler::ProMessageHandler(bool verbose, bool exact) : m_verbose(verbose) , m_exact(exact) //: Prefix used for output from the cumulative evaluation of project files. - , m_prefix(QCoreApplication::translate("ProMessageHandler", "[Inexact] ")) + , m_prefix(Tr::tr("[Inexact] ")) { } diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index 85cea13c079..fa0e3b5e4a2 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -2,7 +2,9 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "resourcenode.h" + #include "resourceeditorconstants.h" +#include "resourceeditortr.h" #include "qrceditor/resourcefile_p.h" #include @@ -433,9 +435,7 @@ bool ResourceTopLevelNode::removeNonExistingFiles() FolderNode::AddNewInformation ResourceTopLevelNode::addNewInformation(const FilePaths &files, Node *context) const { - QString name = QCoreApplication::translate("ResourceTopLevelNode", "%1 Prefix: %2") - .arg(filePath().fileName()) - .arg(QLatin1Char('/')); + const QString name = Tr::tr("%1 Prefix: %2").arg(filePath().fileName()).arg(QLatin1Char('/')); int p = getPriorityFromContextNode(this, context); if (p == -1 && hasPriority(files)) { // images/* and qml/js mimetypes @@ -574,8 +574,7 @@ bool ResourceFolderNode::renamePrefix(const QString &prefix, const QString &lang FolderNode::AddNewInformation ResourceFolderNode::addNewInformation(const FilePaths &files, Node *context) const { - QString name = QCoreApplication::translate("ResourceTopLevelNode", "%1 Prefix: %2") - .arg(m_topLevelNode->filePath().fileName()) + const QString name = Tr::tr("%1 Prefix: %2").arg(m_topLevelNode->filePath().fileName()) .arg(displayName()); int p = getPriorityFromContextNode(this, context);