Fix lupdate issues

Some wrong tr calls / missing tr functions.
Some places where we need to bring lupdate to the right track with
regard to namespace resolution.

Change-Id: Idf552054a34e24d9671db68c816bf37f4d403dbc
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Eike Ziller
2021-03-19 10:46:11 +01:00
parent 49a2e14357
commit e9bf841dc9
13 changed files with 35 additions and 23 deletions

View File

@@ -237,7 +237,7 @@ ClangTextMark::ClangTextMark(const FilePath &fileName,
QVector<QAction *> actions;
QAction *action = new QAction();
action->setIcon(QIcon::fromTheme("edit-copy", Icons::COPY.icon()));
action->setToolTip(tr("Copy to Clipboard"));
action->setToolTip(QApplication::translate("Clang Code Model Marks", "Copy to Clipboard"));
QObject::connect(action, &QAction::triggered, [diagnostic]() {
const QString text = ClangDiagnosticWidget::createText({diagnostic},
ClangDiagnosticWidget::InfoBar);
@@ -250,7 +250,8 @@ ClangTextMark::ClangTextMark(const FilePath &fileName,
if (project && isDiagnosticConfigChangable(project, diagnostic)) {
action = new QAction();
action->setIcon(Icons::BROKEN.icon());
action->setToolTip(tr("Disable Diagnostic in Current Project"));
action->setToolTip(QApplication::translate("Clang Code Model Marks",
"Disable Diagnostic in Current Project"));
QObject::connect(action, &QAction::triggered, [diagnostic]() {
disableDiagnosticInCurrentProjectConfig(diagnostic);
});

View File

@@ -101,6 +101,8 @@ namespace Internal {
class CMakeBuildSettingsWidget : public NamedWidget
{
Q_DECLARE_TR_FUNCTIONS(CMakeProjectManager::Internal::CMakeBuildSettingsWidget)
public:
CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc);

View File

@@ -35,6 +35,8 @@ namespace Internal {
class CMakeProjectImporter : public QtSupport::QtProjectImporter
{
Q_DECLARE_TR_FUNCTIONS(CMakeProjectManager::Internal::CMakeProjectImporter)
public:
CMakeProjectImporter(const Utils::FilePath &path);

View File

@@ -125,11 +125,12 @@ static const char preferredEditorFactoriesKey[] = "EditorManager/PreferredEditor
static const char scratchBufferKey[] = "_q_emScratchBuffer";
// for lupdate
using namespace Core;
using namespace Core::Internal;
using namespace Utils;
namespace Core {
//===================EditorManager=====================
/*!
@@ -3876,5 +3877,3 @@ void CorePlugin::testSplitLineAndColumnNumber_data()
}
#endif // WITH_TESTS
} // namespace Core

View File

@@ -8530,7 +8530,7 @@ public:
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
switch (section) {
case 0:
return tr("Base Class Constructors");
return CppQuickFixFactory::tr("Base Class Constructors");
}
}
return {};

View File

@@ -177,13 +177,13 @@ class Filter : public Core::SearchResultFilter
const auto widget = new QWidget;
const auto layout = new QVBoxLayout(widget);
layout->setContentsMargins(0, 0, 0, 0);
const auto readsCheckBox = new QCheckBox(tr("Reads"));
const auto readsCheckBox = new QCheckBox(CppFindReferences::tr("Reads"));
readsCheckBox->setChecked(m_showReads);
const auto writesCheckBox = new QCheckBox(tr("Writes"));
const auto writesCheckBox = new QCheckBox(CppFindReferences::tr("Writes"));
writesCheckBox->setChecked(m_showWrites);
const auto declsCheckBox = new QCheckBox(tr("Declarations"));
const auto declsCheckBox = new QCheckBox(CppFindReferences::tr("Declarations"));
declsCheckBox->setChecked(m_showDecls);
const auto otherCheckBox = new QCheckBox(tr("Other"));
const auto otherCheckBox = new QCheckBox(CppFindReferences::tr("Other"));
otherCheckBox->setChecked(m_showOther);
layout->addWidget(readsCheckBox);
layout->addWidget(writesCheckBox);

View File

@@ -193,7 +193,7 @@ LanguageClientSettingsPageWidget::LanguageClientSettingsPageWidget(LanguageClien
auto addMenu = new QMenu;
addMenu->clear();
for (const ClientType &type : clientTypes()) {
auto action = new QAction(tr("New %1").arg(type.name));
auto action = new QAction(LanguageClientSettingsPage::tr("New %1").arg(type.name));
connect(action, &QAction::triggered, this, [this, id = type.id]() { addItem(id); });
addMenu->addAction(action);
}

View File

@@ -235,7 +235,7 @@ LspLogWidget::LspLogWidget()
m_clientDetails = new MessageDetailWidget;
m_clientDetails->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
m_clientDetails->setTitle(tr("Client Message"));
m_clientDetails->setTitle(LspInspector::tr("Client Message"));
addWidget(m_clientDetails);
setStretchFactor(0, 1);
@@ -243,7 +243,7 @@ LspLogWidget::LspLogWidget()
m_messages = new QListView;
m_messages->setModel(&m_model);
m_messages->setAlternatingRowColors(true);
m_model.setHeader({tr("Messages")});
m_model.setHeader({LspInspector::tr("Messages")});
m_messages->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);
m_messages->setSelectionMode(QAbstractItemView::MultiSelection);
addWidget(m_messages);
@@ -251,7 +251,7 @@ LspLogWidget::LspLogWidget()
m_serverDetails = new MessageDetailWidget;
m_serverDetails->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
m_serverDetails->setTitle(tr("Server Message"));
m_serverDetails->setTitle(LspInspector::tr("Server Message"));
addWidget(m_serverDetails);
setStretchFactor(2, 1);
@@ -341,7 +341,7 @@ void LspLogWidget::saveLog()
stream << "\n\n";
});
const QString fileName = QFileDialog::getSaveFileName(this, tr("Log File"));
const QString fileName = QFileDialog::getSaveFileName(this, LspInspector::tr("Log File"));
if (fileName.isEmpty())
return;
Utils::FileSaver saver(fileName, QIODevice::Text);

View File

@@ -744,7 +744,7 @@ QMakeStepFactory::QMakeStepFactory()
setSupportedConfiguration(Constants::QMAKE_BC_ID);
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
//: QMakeStep default display name
setDisplayName(QMakeStep::tr("qmake"));
setDisplayName(::QmakeProjectManager::QMakeStep::tr("qmake"));
setFlags(BuildStepInfo::UniqueStep);
}

View File

@@ -96,7 +96,8 @@ void SignalList::prepareDialog()
m_dialog = new SignalListDialog(Core::ICore::dialogParent());
m_dialog->setAttribute(Qt::WA_DeleteOnClose);
m_dialog->initialize(m_model);
m_dialog->setWindowTitle(tr("Signal List for ") + m_modelNode.validId());
m_dialog->setWindowTitle(::QmlDesigner::SignalList::tr("Signal List for ")
+ m_modelNode.validId());
auto *delegate = static_cast<SignalListDelegate *>(m_dialog->tableView()->itemDelegate());
connect(delegate, &SignalListDelegate::connectClicked, this, &SignalList::connectClicked);

View File

@@ -285,7 +285,8 @@ void NodeInstanceView::handleCrash()
if (elaspsedTimeSinceLastCrash > forceRestartTime)
restartProcess();
else
emitDocumentMessage(tr("Qt Quick emulation layer crashed."));
emitDocumentMessage(
::QmlDesigner::NodeInstanceView::tr("Qt Quick emulation layer crashed."));
emitCustomNotification(QStringLiteral("puppet crashed"));
}
@@ -1507,7 +1508,7 @@ void NodeInstanceView::token(const TokenCommand &command)
void NodeInstanceView::debugOutput(const DebugOutputCommand & command)
{
DocumentMessage error(tr("Qt Quick emulation layer crashed."));
DocumentMessage error(::QmlDesigner::NodeInstanceView::tr("Qt Quick emulation layer crashed."));
if (command.instanceIds().isEmpty()) {
emitDocumentMessage(command.text());
} else {
@@ -1695,7 +1696,8 @@ QVariant NodeInstanceView::previewImageDataForImageNode(const ModelNode &modelNo
imageData.pixmap.setDevicePixelRatio(ratio);
}
imageData.info = QObject::tr("Source item: %1").arg(boundNode.id());
imageData.info = ::QmlDesigner::NodeInstanceView::tr("Source item: %1")
.arg(boundNode.id());
}
}
} else {
@@ -1746,7 +1748,10 @@ QVariant NodeInstanceView::previewImageDataForImageNode(const ModelNode &modelNo
imageData.pixmap.setDevicePixelRatio(ratio);
double imgSize = double(imageFi.size());
static QStringList units({QObject::tr("B"), QObject::tr("KB"), QObject::tr("MB"), QObject::tr("GB")});
static QStringList units({::QmlDesigner::NodeInstanceView::tr("B"),
::QmlDesigner::NodeInstanceView::tr("KB"),
::QmlDesigner::NodeInstanceView::tr("MB"),
::QmlDesigner::NodeInstanceView::tr("GB")});
int unitIndex = 0;
while (imgSize > 1024. && unitIndex < units.size() - 1) {
++unitIndex;

View File

@@ -504,7 +504,7 @@ void SubmitEditorWidget::hideDescription()
setDescriptionMandatory(false);
}
void VcsBase::SubmitEditorWidget::verifyDescription()
void SubmitEditorWidget::verifyDescription()
{
auto fontColor = [](Utils::Theme::Color color) {
return QString("<font color=\"%1\">")

View File

@@ -33,6 +33,8 @@ namespace Internal {
class WebAssemblyQtVersion : public QtSupport::BaseQtVersion
{
Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::WebAssemblyQtVersion)
public:
WebAssemblyQtVersion();