From 85744e7456a8ab62ef759f69d15eabf4e1b7c136 Mon Sep 17 00:00:00 2001 From: GermanAizek Date: Mon, 29 Jan 2024 08:38:31 -0600 Subject: [PATCH] Additionals translate strings --- src/CutterApplication.cpp | 4 ++-- src/dialogs/VersionInfoDialog.cpp | 12 ++++++------ src/dialogs/preferences/AnalysisOptionsWidget.cpp | 12 ++++++------ src/dialogs/preferences/InitializationFileEditor.cpp | 2 +- src/tools/basefind/BaseFindDialog.cpp | 2 +- src/widgets/OverviewWidget.cpp | 4 ++-- src/widgets/SearchWidget.cpp | 12 ++++++------ src/widgets/VisualNavbar.cpp | 4 ++-- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/CutterApplication.cpp b/src/CutterApplication.cpp index 79a48b59..1bb2c158 100644 --- a/src/CutterApplication.cpp +++ b/src/CutterApplication.cpp @@ -534,10 +534,10 @@ bool CutterApplication::parseCommandLineOptions() opts.fileOpenOptions.analysisCmd = {}; break; case AutomaticAnalysisLevel::AAA: - opts.fileOpenOptions.analysisCmd = { { "aaa", "Auto analysis" } }; + opts.fileOpenOptions.analysisCmd = { { "aaa", tr("Auto analysis") } }; break; case AutomaticAnalysisLevel::AAAA: - opts.fileOpenOptions.analysisCmd = { { "aaaa", "Auto analysis (experimental)" } }; + opts.fileOpenOptions.analysisCmd = { { "aaaa", tr("Auto analysis (experimental)") } }; break; } opts.fileOpenOptions.script = cmd_parser.value(scriptOption); diff --git a/src/dialogs/VersionInfoDialog.cpp b/src/dialogs/VersionInfoDialog.cpp index dd43f23e..02b2e774 100644 --- a/src/dialogs/VersionInfoDialog.cpp +++ b/src/dialogs/VersionInfoDialog.cpp @@ -41,17 +41,17 @@ void VersionInfoDialog::fillVersionInfo() // Left tree QTreeWidgetItem *addrItemL = new QTreeWidgetItem(); - addrItemL->setText(0, "Address:"); + addrItemL->setText(0, tr("Address:")); addrItemL->setText(1, RzAddressString(sdb_num_get(sdb, "addr", 0))); ui->leftTreeWidget->addTopLevelItem(addrItemL); QTreeWidgetItem *offItemL = new QTreeWidgetItem(); - offItemL->setText(0, "Offset:"); + offItemL->setText(0, tr("Offset:")); offItemL->setText(1, RzAddressString(sdb_num_get(sdb, "offset", 0))); ui->leftTreeWidget->addTopLevelItem(offItemL); QTreeWidgetItem *entriesItemL = new QTreeWidgetItem(); - entriesItemL->setText(0, "Entries:"); + entriesItemL->setText(0, tr("Entries:")); const ut64 num_entries = sdb_num_get(sdb, "num_entries", 0); for (size_t i = 0; i < num_entries; ++i) { auto key = QString("entry%0").arg(i); @@ -72,17 +72,17 @@ void VersionInfoDialog::fillVersionInfo() // Right tree QTreeWidgetItem *addrItemR = new QTreeWidgetItem(); - addrItemR->setText(0, "Address:"); + addrItemR->setText(0, tr("Address:")); addrItemR->setText(1, RzAddressString(sdb_num_get(sdb, "addr", 0))); ui->rightTreeWidget->addTopLevelItem(addrItemR); QTreeWidgetItem *offItemR = new QTreeWidgetItem(); - offItemR->setText(0, "Offset:"); + offItemR->setText(0, tr("Offset:")); offItemR->setText(1, RzAddressString(sdb_num_get(sdb, "offset", 0))); ui->rightTreeWidget->addTopLevelItem(offItemR); QTreeWidgetItem *entriesItemR = new QTreeWidgetItem(); - entriesItemR->setText(0, "Entries:"); + entriesItemR->setText(0, tr("Entries:")); for (size_t num_version = 0;; num_version++) { auto path_version = QString("bin/cur/info/versioninfo/verneed/version%0").arg(num_version); diff --git a/src/dialogs/preferences/AnalysisOptionsWidget.cpp b/src/dialogs/preferences/AnalysisOptionsWidget.cpp index 53d00f2f..8fab39e2 100644 --- a/src/dialogs/preferences/AnalysisOptionsWidget.cpp +++ b/src/dialogs/preferences/AnalysisOptionsWidget.cpp @@ -9,12 +9,12 @@ #include "core/MainWindow.h" static const QHash analysisBoundaries { - { "io.maps.x", "All executable maps" }, - { "io.maps", "All maps" }, - { "io.map", "Current map" }, - { "raw", "Raw" }, - { "bin.section", "Current mapped section" }, - { "bin.sections", "All mapped sections" }, + { "io.maps.x", QObject::tr("All executable maps") }, + { "io.maps", QObject::tr("All maps") }, + { "io.map", QObject::tr("Current map") }, + { "raw", QObject::tr("Raw") }, + { "bin.section", QObject::tr("Current mapped section") }, + { "bin.sections", QObject::tr("All mapped sections") }, }; AnalysisOptionsWidget::AnalysisOptionsWidget(PreferencesDialog *dialog) diff --git a/src/dialogs/preferences/InitializationFileEditor.cpp b/src/dialogs/preferences/InitializationFileEditor.cpp index 6bd31c80..20fa0150 100644 --- a/src/dialogs/preferences/InitializationFileEditor.cpp +++ b/src/dialogs/preferences/InitializationFileEditor.cpp @@ -36,7 +36,7 @@ InitializationFileEditor::InitializationFileEditor(PreferencesDialog *dialog) .arg(QUrl::fromLocalFile(cutterRCDirectory.absolutePath()).toString(), cutterRCLocation.toHtmlEscaped())); - ui->executeNow->button(QDialogButtonBox::Retry)->setText("Execute"); + ui->executeNow->button(QDialogButtonBox::Retry)->setText(tr("Execute")); ui->ConfigFileEdit->clear(); if (cutterRCFileInfo.exists()) { QFile cutterRC(cutterRCLocation); diff --git a/src/tools/basefind/BaseFindDialog.cpp b/src/tools/basefind/BaseFindDialog.cpp index 17adc133..2f8ff722 100644 --- a/src/tools/basefind/BaseFindDialog.cpp +++ b/src/tools/basefind/BaseFindDialog.cpp @@ -16,7 +16,7 @@ BaseFindDialog::BaseFindDialog(QWidget *parent) : QDialog(parent), ui(new Ui::Ba ui->nCoresCombo->clear(); for (size_t i = n_cores; i > 0; i--) { if (n_cores == i) { - ui->nCoresCombo->addItem("All Cores"); + ui->nCoresCombo->addItem(tr("All Cores")); continue; } ui->nCoresCombo->addItem(QString::number(i)); diff --git a/src/widgets/OverviewWidget.cpp b/src/widgets/OverviewWidget.cpp index e39dfcc1..931cf003 100644 --- a/src/widgets/OverviewWidget.cpp +++ b/src/widgets/OverviewWidget.cpp @@ -5,8 +5,8 @@ OverviewWidget::OverviewWidget(MainWindow *main) : CutterDockWidget(main) { - setWindowTitle("Graph Overview"); - setObjectName("Graph Overview"); + setWindowTitle(tr("Graph Overview")); + setObjectName(tr("Graph Overview")); setAllowedAreas(Qt::AllDockWidgetAreas); graphView = new OverviewView(this); setWidget(graphView); diff --git a/src/widgets/SearchWidget.cpp b/src/widgets/SearchWidget.cpp index 86242dd6..067d4a4d 100644 --- a/src/widgets/SearchWidget.cpp +++ b/src/widgets/SearchWidget.cpp @@ -17,12 +17,12 @@ static const int kMaxTooltipHexdumpBytes = 64; } static const QMap searchBoundaries { - { "io.maps", "All maps" }, - { "io.map", "Current map" }, - { "raw", "Raw" }, - { "block", "Current block" }, - { "bin.section", "Current mapped section" }, - { "bin.sections", "All mapped sections" }, + { "io.maps", QObject::tr("All maps") }, + { "io.map", QObject::tr("Current map") }, + { "raw", QObject::tr("Raw") }, + { "block", QObject::tr("Current block") }, + { "bin.section", QObject::tr("Current mapped section") }, + { "bin.sections", QObject::tr("All mapped sections") }, }; static const QMap searchBoundariesDebug { { "dbg.maps", "All memory maps" }, diff --git a/src/widgets/VisualNavbar.cpp b/src/widgets/VisualNavbar.cpp index 53d93826..c5d58fc5 100644 --- a/src/widgets/VisualNavbar.cpp +++ b/src/widgets/VisualNavbar.cpp @@ -39,8 +39,8 @@ VisualNavbar::VisualNavbar(MainWindow *main, QWidget *parent) /* QComboBox *addsCombo = new QComboBox(); addsCombo->addItem(""); - addsCombo->addItem("Entry points"); - addsCombo->addItem("Marks"); + addsCombo->addItem(tr("Entry points")); + addsCombo->addItem(tr("Marks")); */ addWidget(this->graphicsView); // addWidget(addsCombo); -- 2.39.2