From 4fc0e2842f82d38c7dd372f8e6625bc15c3a7603 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sat, 10 Aug 2024 18:27:35 -0400 Subject: [PATCH] Fix translations on Keyboard Shortcuts Widget * Fixes #10335 --- share/translations/keepassxc_en.ts | 43 ++++++++++++++---------------- src/gui/ShortcutSettingsPage.cpp | 12 ++++----- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/share/translations/keepassxc_en.ts b/share/translations/keepassxc_en.ts index 6bb5ae88d..6d2dbbc9c 100644 --- a/share/translations/keepassxc_en.ts +++ b/share/translations/keepassxc_en.ts @@ -8898,6 +8898,26 @@ This option is deprecated, use --set-key-file instead. Only PBKDF and Argon2 are supported, cannot decrypt json file + + Reset Shortcuts + + + + Double click an action to change its shortcut + + + + Filter... + + + + Shortcut Conflict + + + + Shortcut %1 conflicts with '%2'. Overwrite shortcut? + + Cannot generate valid passphrases because the wordlist is too short @@ -9776,29 +9796,6 @@ This option is deprecated, use --set-key-file instead. - - ShortcutSettingsWidget - - Double click an action to change its shortcut - - - - Shortcut Conflict - - - - Filter... - - - - Shortcut %1 conflicts with '%2'. Overwrite shortcut? - - - - Reset Shortcuts - - - TagModel diff --git a/src/gui/ShortcutSettingsPage.cpp b/src/gui/ShortcutSettingsPage.cpp index fe00bfd8e..ffc6d32e8 100644 --- a/src/gui/ShortcutSettingsPage.cpp +++ b/src/gui/ShortcutSettingsPage.cpp @@ -23,7 +23,6 @@ #include "gui/MessageBox.h" #include "gui/widgets/ShortcutWidget.h" -#include #include #include #include @@ -81,7 +80,6 @@ private: } } -private: bool m_restoreDefault = false; ShortcutWidget* const m_keySeqEdit; QDialogButtonBox* const m_btnBox; @@ -94,7 +92,7 @@ public: : QWidget(parent) , m_tableView(new QTableView(this)) , m_filterLineEdit(new QLineEdit(this)) - , m_resetShortcutsButton(new QPushButton(tr("Reset Shortcuts"), this)) + , m_resetShortcutsButton(new QPushButton(QObject::tr("Reset Shortcuts"), this)) { auto h = new QHBoxLayout(); h->addWidget(m_filterLineEdit); @@ -102,7 +100,7 @@ public: h->setStretch(0, 1); auto l = new QVBoxLayout(this); - l->addWidget(new QLabel(tr("Double click an action to change its shortcut"))); + l->addWidget(new QLabel(QObject::tr("Double click an action to change its shortcut"))); l->addLayout(h); l->addWidget(m_tableView); @@ -113,7 +111,7 @@ public: m_proxy.setFilterCaseSensitivity(Qt::CaseInsensitive); m_proxy.setSourceModel(&m_model); - m_filterLineEdit->setPlaceholderText(tr("Filter...")); + m_filterLineEdit->setPlaceholderText(QObject::tr("Filter...")); connect(m_filterLineEdit, &QLineEdit::textChanged, &m_proxy, &QSortFilterProxyModel::setFilterFixedString); connect(m_resetShortcutsButton, &QPushButton::clicked, this, [this]() { @@ -227,8 +225,8 @@ private: auto ans = MessageBox::question( this, - tr("Shortcut Conflict"), - tr("Shortcut %1 conflicts with '%2'. Overwrite shortcut?").arg(conflictSeq, conflictName), + QObject::tr("Shortcut Conflict"), + QObject::tr("Shortcut %1 conflicts with '%2'. Overwrite shortcut?").arg(conflictSeq, conflictName), MessageBox::Overwrite | MessageBox::Discard, MessageBox::Discard); if (ans == MessageBox::Discard) {