Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix translations on Keyboard Shortcuts Widget #11154

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 20 additions & 23 deletions share/translations/keepassxc_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8898,6 +8898,26 @@ This option is deprecated, use --set-key-file instead.</source>
<source>Only PBKDF and Argon2 are supported, cannot decrypt json file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reset Shortcuts</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Double click an action to change its shortcut</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Filter...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Shortcut Conflict</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Shortcut %1 conflicts with &apos;%2&apos;. Overwrite shortcut?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot generate valid passphrases because the wordlist is too short</source>
<translation type="unfinished"></translation>
Expand Down Expand Up @@ -9776,29 +9796,6 @@ This option is deprecated, use --set-key-file instead.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ShortcutSettingsWidget</name>
<message>
<source>Double click an action to change its shortcut</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Shortcut Conflict</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Filter...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Shortcut %1 conflicts with &apos;%2&apos;. Overwrite shortcut?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reset Shortcuts</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TagModel</name>
<message>
Expand Down
12 changes: 5 additions & 7 deletions src/gui/ShortcutSettingsPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "gui/MessageBox.h"
#include "gui/widgets/ShortcutWidget.h"

#include <QAbstractButton>
#include <QDebug>
#include <QDialog>
#include <QDialogButtonBox>
Expand Down Expand Up @@ -81,7 +80,6 @@ class KeySequenceDialog final : public QDialog
}
}

private:
bool m_restoreDefault = false;
ShortcutWidget* const m_keySeqEdit;
QDialogButtonBox* const m_btnBox;
Expand All @@ -94,15 +92,15 @@ class ShortcutSettingsWidget final : public QWidget
: 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);
h->addWidget(m_resetShortcutsButton);
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);

Expand All @@ -113,7 +111,7 @@ class ShortcutSettingsWidget final : public QWidget
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]() {
Expand Down Expand Up @@ -227,8 +225,8 @@ class ShortcutSettingsWidget final : public QWidget

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) {
Expand Down