From f3d88fbd369e4d516510771318f2699ed34c545b Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sun, 14 Feb 2021 19:15:10 -0500 Subject: [PATCH] Address translation feedback from Transifex --- src/autotype/AutoTypeSelectDialog.cpp | 2 +- src/browser/BrowserSettingsWidget.ui | 8 ++--- src/cli/Add.cpp | 2 +- src/cli/Analyze.cpp | 4 +-- src/cli/Clip.cpp | 15 +++++---- src/cli/Edit.cpp | 2 +- src/cli/Estimate.cpp | 19 +++++------ src/core/CsvParser.cpp | 5 ++- src/core/Database.cpp | 2 +- src/core/HibpOffline.cpp | 2 +- src/core/PasswordHealth.cpp | 33 ++++++++++--------- src/format/KeePass1Reader.cpp | 2 +- src/format/KeePass2Reader.cpp | 2 +- src/gui/CloneDialog.ui | 2 +- src/gui/DatabaseOpenWidget.cpp | 2 +- src/gui/DatabaseOpenWidget.ui | 6 ++-- src/gui/DatabaseWidget.cpp | 6 ++-- src/gui/EditWidgetIcons.ui | 2 +- src/gui/EntryPreviewWidget.cpp | 13 +++----- src/gui/IconDownloaderDialog.cpp | 6 ++-- src/gui/IconDownloaderDialog.ui | 2 +- src/gui/MainWindow.cpp | 8 ++--- src/gui/MainWindow.ui | 12 +++---- src/gui/SearchWidget.cpp | 2 +- src/gui/TotpSetupDialog.ui | 6 ++-- src/gui/UpdateCheckDialog.cpp | 32 ++++++++---------- src/gui/UpdateCheckDialog.h | 2 +- src/gui/UpdateCheckDialog.ui | 2 +- src/gui/databasekey/KeyFileEditWidget.cpp | 2 +- src/gui/databasekey/KeyFileEditWidget.ui | 2 +- .../DatabaseSettingsWidgetBrowser.cpp | 2 +- .../DatabaseSettingsWidgetDatabaseKey.cpp | 2 +- .../DatabaseSettingsWidgetEncryption.cpp | 4 +-- .../DatabaseSettingsWidgetGeneral.ui | 2 +- src/gui/entry/EditEntryWidgetMain.ui | 2 +- src/gui/entry/EditEntryWidgetSSHAgent.ui | 2 +- src/gui/reports/ReportsPageHealthcheck.cpp | 2 +- src/gui/reports/ReportsPageHibp.cpp | 2 +- src/gui/reports/ReportsPageStatistics.cpp | 2 +- src/gui/reports/ReportsWidgetHealthcheck.cpp | 4 +-- src/gui/reports/ReportsWidgetHibp.cpp | 18 +++++----- src/gui/reports/ReportsWidgetStatistics.cpp | 2 +- src/gui/wizard/NewDatabaseWizard.cpp | 2 +- src/keeshare/DatabaseSettingsPageKeeShare.cpp | 2 +- src/keeshare/SettingsPageKeeShare.cpp | 2 +- src/keeshare/group/EditGroupPageKeeShare.cpp | 2 +- src/keeshare/group/EditGroupWidgetKeeShare.ui | 2 +- src/keys/drivers/YubiKey.cpp | 14 ++++---- src/updatecheck/UpdateChecker.cpp | 3 +- src/updatecheck/UpdateChecker.h | 2 ++ src/zxcvbn/zxcvbn.c | 26 +++++++-------- src/zxcvbn/zxcvbn.h | 2 +- tests/gui/TestGui.cpp | 2 +- 53 files changed, 152 insertions(+), 156 deletions(-) diff --git a/src/autotype/AutoTypeSelectDialog.cpp b/src/autotype/AutoTypeSelectDialog.cpp index 514d3cf55..e91355f4a 100644 --- a/src/autotype/AutoTypeSelectDialog.cpp +++ b/src/autotype/AutoTypeSelectDialog.cpp @@ -92,7 +92,7 @@ AutoTypeSelectDialog::AutoTypeSelectDialog(QWidget* parent) connect(m_filterLineEdit, SIGNAL(keyDownPressed()), SLOT(moveSelectionDown())); connect(m_filterLineEdit, SIGNAL(escapeReleased()), SLOT(reject())); - m_filterLineEdit->setPlaceholderText(tr("Search...")); + m_filterLineEdit->setPlaceholderText(tr("Search…")); layout->addWidget(m_filterLineEdit); QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel, Qt::Horizontal, this); diff --git a/src/browser/BrowserSettingsWidget.ui b/src/browser/BrowserSettingsWidget.ui index 40064b541..9ef244b92 100644 --- a/src/browser/BrowserSettingsWidget.ui +++ b/src/browser/BrowserSettingsWidget.ui @@ -209,10 +209,10 @@ - Only entries with the same scheme (http://, https://, ...) are returned. + Only entries with the same scheme (http://, https://, …) are returned. - Match URL scheme (e.g., https://...) + Match URL scheme (e.g., https://example.com) @@ -400,7 +400,7 @@ Browser for custom proxy file - Browse... + Browse… @@ -539,7 +539,7 @@ Browse for custom browser path - Browse... + Browse… diff --git a/src/cli/Add.cpp b/src/cli/Add.cpp index 9bb888069..bb3b87d7b 100644 --- a/src/cli/Add.cpp +++ b/src/cli/Add.cpp @@ -83,7 +83,7 @@ int Add::executeWithDatabase(QSharedPointer database, QSharedPointerisSet(Add::GenerateOption) && parser->isSet(Add::PasswordPromptOption)) { - err << QObject::tr("Cannot generate a password and prompt at the same time!") << endl; + err << QObject::tr("Cannot generate a password and prompt at the same time.") << endl; return EXIT_FAILURE; } diff --git a/src/cli/Analyze.cpp b/src/cli/Analyze.cpp index 11bb824ed..51f8dea73 100644 --- a/src/cli/Analyze.cpp +++ b/src/cli/Analyze.cpp @@ -63,7 +63,7 @@ int Analyze::executeWithDatabase(QSharedPointer database, QSharedPoint auto okon = parser->value(Analyze::OkonOption); if (!okon.isEmpty()) { - out << QObject::tr("Evaluating database entries using okon...") << endl; + out << QObject::tr("Evaluating database entries using okon…") << endl; if (!HibpOffline::okonReport(database, okon, hibpDatabase, findings, &error)) { err << error << endl; @@ -76,7 +76,7 @@ int Analyze::executeWithDatabase(QSharedPointer database, QSharedPoint return EXIT_FAILURE; } - out << QObject::tr("Evaluating database entries against HIBP file, this will take a while...") << endl; + out << QObject::tr("Evaluating database entries against HIBP file, this will take a while…") << endl; if (!HibpOffline::report(database, hibpFile, findings, &error)) { err << error << endl; diff --git a/src/cli/Clip.cpp b/src/cli/Clip.cpp index 0e2e6fb9b..ac8e5b3fd 100644 --- a/src/cli/Clip.cpp +++ b/src/cli/Clip.cpp @@ -31,7 +31,8 @@ const QCommandLineOption Clip::AttributeOption = QCommandLineOption( QStringList() << "a" << "attribute", - QObject::tr("Copy the given attribute to the clipboard. Defaults to \"password\" if not specified."), + QObject::tr("Copy the given attribute to the clipboard. Defaults to \"password\" if not specified.", + "Don't translate \"password\", it refers to the attribute."), "attr", "password"); @@ -40,10 +41,10 @@ const QCommandLineOption Clip::TotpOption = << "totp", QObject::tr("Copy the current TOTP to the clipboard (equivalent to \"-a totp\").")); -const QCommandLineOption Clip::BestMatchOption = QCommandLineOption( - QStringList() << "b" - << "best-match", - QObject::tr("Try to find the unique entry matching, will fail and display the list of matches otherwise.")); +const QCommandLineOption Clip::BestMatchOption = + QCommandLineOption(QStringList() << "b" + << "best-match", + QObject::tr("Must match only one entry, otherwise a list of possible matches is shown.")); Clip::Clip() { @@ -81,7 +82,7 @@ int Clip::executeWithDatabase(QSharedPointer database, QSharedPointer< return EXIT_FAILURE; } else { bestEntryPath = (results.isEmpty()) ? args.at(1) : results[0]; - out << QObject::tr("Matching \"%1\" entry used.").arg(bestEntryPath) << endl; + out << QObject::tr("Used matching entry: %1").arg(bestEntryPath) << endl; } } else { bestEntryPath = args.at(1); @@ -152,7 +153,7 @@ int Clip::executeWithDatabase(QSharedPointer database, QSharedPointer< QString lastLine = ""; while (timeoutSeconds > 0) { out << '\r' << QString(lastLine.size(), ' ') << '\r'; - lastLine = QObject::tr("Clearing the clipboard in %1 second(s)...", "", timeoutSeconds).arg(timeoutSeconds); + lastLine = QObject::tr("Clearing the clipboard in %1 second(s)…", "", timeoutSeconds).arg(timeoutSeconds); out << lastLine << flush; std::this_thread::sleep_for(std::chrono::milliseconds(1000)); --timeoutSeconds; diff --git a/src/cli/Edit.cpp b/src/cli/Edit.cpp index 60c7d5893..4dcda4fd5 100644 --- a/src/cli/Edit.cpp +++ b/src/cli/Edit.cpp @@ -69,7 +69,7 @@ int Edit::executeWithDatabase(QSharedPointer database, QSharedPointer< // Cannot use those 2 options at the same time! if (parser->isSet(Add::GenerateOption) && parser->isSet(Add::PasswordPromptOption)) { - err << QObject::tr("Cannot generate a password and prompt at the same time!") << endl; + err << QObject::tr("Cannot generate a password and prompt at the same time.") << endl; return EXIT_FAILURE; } diff --git a/src/cli/Estimate.cpp b/src/cli/Estimate.cpp index 5576e2362..63044e50a 100644 --- a/src/cli/Estimate.cpp +++ b/src/cli/Estimate.cpp @@ -59,12 +59,12 @@ static void estimate(const char* pwd, bool advanced) << QObject::tr("Log10 %1").arg(e * 0.301029996, 0, 'f', 3) << endl; // clang-format on } else { - int ChkLen = 0; + int pwdLen = 0; ZxcMatch_t *info, *p; double m = 0.0; const auto e = ZxcvbnMatch(pwd, nullptr, &info); for (p = info; p; p = p->Next) { - m += p->Entrpy; + m += p->Entropy; } m = e - m; // clang-format off @@ -74,7 +74,7 @@ static void estimate(const char* pwd, bool advanced) << QObject::tr("Multi-word extra bits %1").arg(m, 0, 'f', 1) << endl; // clang-format on p = info; - ChkLen = 0; + pwdLen = 0; while (p) { int n; switch (static_cast(p->Type)) { @@ -134,14 +134,13 @@ static void estimate(const char* pwd, bool advanced) break; default: - out << " " << QObject::tr("Type: Unknown%1").arg(p->Type) << " "; + out << " " << QObject::tr("Type: Unknown (%1)").arg(p->Type) << " "; break; } - ChkLen += p->Length; - // clang-format off + pwdLen += p->Length; out << QObject::tr("Length %1").arg(p->Length) << '\t' - << QObject::tr("Entropy %1 (%2)").arg(p->Entrpy, 6, 'f', 3).arg(p->Entrpy * 0.301029996, 0, 'f', 2) << '\t'; - // clang-format on + << QObject::tr("Entropy %1 (%2)").arg(p->Entropy, 6, 'f', 3).arg(p->Entropy * 0.301029996, 0, 'f', 2) + << '\t'; for (n = 0; n < p->Length; ++n, ++pwd) { out << *pwd; } @@ -149,8 +148,8 @@ static void estimate(const char* pwd, bool advanced) p = p->Next; } ZxcvbnFreeInfo(info); - if (ChkLen != len) { - out << QObject::tr("*** Password length (%1) != sum of length of parts (%2) ***").arg(len).arg(ChkLen) + if (pwdLen != len) { + out << QObject::tr("*** Password length (%1) != sum of length of parts (%2) ***").arg(len).arg(pwdLen) << endl; } } diff --git a/src/core/CsvParser.cpp b/src/core/CsvParser.cpp index adda56e49..3370379ca 100644 --- a/src/core/CsvParser.cpp +++ b/src/core/CsvParser.cpp @@ -63,7 +63,7 @@ bool CsvParser::reparse() bool CsvParser::parse(QFile* device) { clear(); - if (nullptr == device) { + if (!device) { appendStatusMsg(QObject::tr("NULL device"), true); return false; } @@ -88,7 +88,7 @@ bool CsvParser::readFile(QFile* device) m_array.replace("\r\n", "\n"); m_array.replace("\r", "\n"); - if (0 == m_array.size()) { + if (m_array.isEmpty()) { appendStatusMsg(QObject::tr("file empty").append("\n")); } m_isFileLoaded = true; @@ -196,7 +196,6 @@ void CsvParser::parseQuoted(QString& s) // read and discard initial qualifier (e.g. quote) getChar(m_ch); parseEscaped(s); - // getChar(m_ch); if (!isQualifier(m_ch)) { appendStatusMsg(QObject::tr("missing closing quote"), true); } diff --git a/src/core/Database.cpp b/src/core/Database.cpp index 11ca6ea35..601684814 100644 --- a/src/core/Database.cpp +++ b/src/core/Database.cpp @@ -371,7 +371,7 @@ bool Database::writeDatabase(QIODevice* device, QString* error) Q_ASSERT(newKey != oldTransformedKey.rawKey()); if (newKey.isEmpty() || newKey == oldTransformedKey.rawKey()) { if (error) { - *error = tr("Key not transformed. This is a bug, please report it to the developers!"); + *error = tr("Key not transformed. This is a bug, please report it to the developers."); } return false; } diff --git a/src/core/HibpOffline.cpp b/src/core/HibpOffline.cpp index 4b48c4527..65ea63b4a 100644 --- a/src/core/HibpOffline.cpp +++ b/src/core/HibpOffline.cpp @@ -115,7 +115,7 @@ namespace HibpOffline QString* error) { if (!okonDatabase.endsWith(".okon")) { - *error = QObject::tr("To use okon you must provide a post-processed file (e.g. file.okon)"); + *error = QObject::tr("To use okon, you must provide a post-processed file (e.g. file.okon)"); return false; } diff --git a/src/core/PasswordHealth.cpp b/src/core/PasswordHealth.cpp index c2fc8c7f0..c2551a519 100644 --- a/src/core/PasswordHealth.cpp +++ b/src/core/PasswordHealth.cpp @@ -34,13 +34,13 @@ PasswordHealth::PasswordHealth(double entropy) switch (quality()) { case Quality::Bad: case Quality::Poor: - m_scoreReasons << QApplication::tr("Very weak password"); - m_scoreDetails << QApplication::tr("Password entropy is %1 bits").arg(QString::number(m_entropy, 'f', 2)); + m_scoreReasons << QObject::tr("Very weak password"); + m_scoreDetails << QObject::tr("Password entropy is %1 bits").arg(QString::number(m_entropy, 'f', 2)); break; case Quality::Weak: - m_scoreReasons << QApplication::tr("Weak password"); - m_scoreDetails << QApplication::tr("Password entropy is %1 bits").arg(QString::number(m_entropy, 'f', 2)); + m_scoreReasons << QObject::tr("Weak password"); + m_scoreDetails << QObject::tr("Password entropy is %1 bits").arg(QString::number(m_entropy, 'f', 2)); break; default: @@ -108,7 +108,7 @@ HealthChecker::HealthChecker(QSharedPointer db) for (const auto* entry : db->rootGroup()->entriesRecursive()) { if (!entry->isRecycled() && !entry->isAttributeReference("Password")) { m_reuse[entry->password()] - << QApplication::tr("Used in %1/%2").arg(entry->group()->hierarchy().join('/'), entry->title()); + << QObject::tr("Used in %1/%2").arg(entry->group()->hierarchy().join('/'), entry->title()); } } } @@ -137,7 +137,7 @@ QSharedPointer HealthChecker::evaluate(const Entry* entry) const if (count > 1) { constexpr auto penalty = 15; health->adjustScore(-penalty * (count - 1)); - health->addScoreReason(QApplication::tr("Password is used %1 times").arg(QString::number(count))); + health->addScoreReason(QObject::tr("Password is used %1 time(s)", "", count).arg(QString::number(count))); // Add the first 20 uses of the password to prevent the details display from growing too large for (int i = 0; i < used.size(); ++i) { health->addScoreDetails(used[i]); @@ -159,11 +159,11 @@ QSharedPointer HealthChecker::evaluate(const Entry* entry) const // reduce score by 2 points per day. if (entry->isExpired()) { health->setScore(0); - health->addScoreReason(QApplication::tr("Password has expired")); - health->addScoreDetails(QApplication::tr("Password expiry was %1") + health->addScoreReason(QObject::tr("Password has expired")); + health->addScoreDetails(QObject::tr("Password expiry was %1") .arg(entry->timeInfo().expiryTime().toString(Qt::DefaultLocaleShortDate))); } else if (entry->timeInfo().expires()) { - const auto days = QDateTime::currentDateTime().daysTo(entry->timeInfo().expiryTime()); + const int days = QDateTime::currentDateTime().daysTo(entry->timeInfo().expiryTime()); if (days <= 30) { // First bring the score down into the "weak" range // so that the entry appears in Health Check. Then @@ -173,14 +173,17 @@ QSharedPointer HealthChecker::evaluate(const Entry* entry) const if (health->score() > 60) { health->setScore(60); } - // clang-format off + health->adjustScore((30 - days) * -2); - health->addScoreReason(days <= 2 ? QApplication::tr("Password is about to expire") - : days <= 10 ? QApplication::tr("Password expires in %1 days").arg(days) - : QApplication::tr("Password will expire soon")); - health->addScoreDetails(QApplication::tr("Password expires on %1") + health->addScoreDetails(QObject::tr("Password expires on %1") .arg(entry->timeInfo().expiryTime().toString(Qt::DefaultLocaleShortDate))); - //clang-format on + if (days <= 2) { + health->addScoreReason(QObject::tr("Password is about to expire")); + } else if (days <= 10) { + health->addScoreReason(QObject::tr("Password expires in %1 day(s)", "", days).arg(days)); + } else { + health->addScoreReason(QObject::tr("Password will expire soon")); + } } } diff --git a/src/format/KeePass1Reader.cpp b/src/format/KeePass1Reader.cpp index 80e84d8cd..96e9c1914 100644 --- a/src/format/KeePass1Reader.cpp +++ b/src/format/KeePass1Reader.cpp @@ -590,7 +590,7 @@ Entry* KeePass1Reader::readEntry(QIODevice* cipherStream) break; case 0x0001: if (fieldSize != 16) { - raiseError(tr("Invalid entry uuid field size")); + raiseError(tr("Invalid entry UUID field size")); return nullptr; } m_entryUuids.insert(fieldData, entry.data()); diff --git a/src/format/KeePass2Reader.cpp b/src/format/KeePass2Reader.cpp index 1a9c25c8e..6b8742e57 100644 --- a/src/format/KeePass2Reader.cpp +++ b/src/format/KeePass2Reader.cpp @@ -71,7 +71,7 @@ bool KeePass2Reader::readDatabase(QIODevice* device, QSharedPointer 'Import KeePass 1 database...'.\n" + "You can import it by clicking on Database > 'Import KeePass 1 database…'.\n" "This is a one-way migration. You won't be able to open the imported " "database with the old KeePassX 0.4 version.")); return false; diff --git a/src/gui/CloneDialog.ui b/src/gui/CloneDialog.ui index 16ca3e6d1..db0614dfa 100644 --- a/src/gui/CloneDialog.ui +++ b/src/gui/CloneDialog.ui @@ -11,7 +11,7 @@ - Clone Options + Clone Entry Options diff --git a/src/gui/DatabaseOpenWidget.cpp b/src/gui/DatabaseOpenWidget.cpp index a9da29133..8ab2237f9 100644 --- a/src/gui/DatabaseOpenWidget.cpp +++ b/src/gui/DatabaseOpenWidget.cpp @@ -309,7 +309,7 @@ QSharedPointer DatabaseOpenWidget::buildDatabaseKey() legacyWarning.setText(tr("You are using an old key file format which KeePassXC may
" "stop supporting in the future.

" "Please consider generating a new key file by going to:
" - "Database / Database Security / Change Key File.
")); + "Database > Database Security > Change Key File.
")); legacyWarning.setIcon(QMessageBox::Icon::Warning); legacyWarning.addButton(QMessageBox::Ok); legacyWarning.setDefaultButton(QMessageBox::Ok); diff --git a/src/gui/DatabaseOpenWidget.ui b/src/gui/DatabaseOpenWidget.ui index 167f4b7d4..20813008d 100644 --- a/src/gui/DatabaseOpenWidget.ui +++ b/src/gui/DatabaseOpenWidget.ui @@ -250,7 +250,7 @@ Qt::ClickFocus - <p>In addition to a password, you can use a secret file to enhance the security of your database. This file can be generated in your database's security settings.</p><p>This is <strong>not</strong> your *.kdbx database file!<br>If you do not have a key file, leave this field empty.</p><p>Click for more information...</p> + <p>In addition to a password, you can use a secret file to enhance the security of your database. This file can be generated in your database's security settings.</p><p>This is <strong>not</strong> your *.kdbx database file!<br>If you do not have a key file, leave this field empty.</p><p>Click for more information…</p> Key file help @@ -355,7 +355,7 @@ <p>You can use a hardware security key such as a <strong>YubiKey</strong> or <strong>OnlyKey</strong> with slots configured for HMAC-SHA1.</p> -<p>Click for more information...</p> +<p>Click for more information…</p> Hardware key help @@ -435,7 +435,7 @@ Browse for key file - Browse... + Browse…
diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 41c1cc6a9..9d861fb3c 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -142,13 +142,13 @@ DatabaseWidget::DatabaseWidget(QSharedPointer db, QWidget* parent) // Add a notification for when we are searching m_searchingLabel->setObjectName("SearchBanner"); - m_searchingLabel->setText(tr("Searching...")); + m_searchingLabel->setText(tr("Searching…")); m_searchingLabel->setAlignment(Qt::AlignCenter); m_searchingLabel->setVisible(false); #ifdef WITH_XC_KEESHARE m_shareLabel->setObjectName("KeeShareBanner"); - m_shareLabel->setText(tr("Shared group...")); + m_shareLabel->setText(tr("Shared group…")); m_shareLabel->setAlignment(Qt::AlignCenter); m_shareLabel->setVisible(false); #endif @@ -1440,7 +1440,7 @@ void DatabaseWidget::endSearch() } m_searchingLabel->setVisible(false); - m_searchingLabel->setText(tr("Searching...")); + m_searchingLabel->setText(tr("Searching…")); m_lastSearchText.clear(); diff --git a/src/gui/EditWidgetIcons.ui b/src/gui/EditWidgetIcons.ui index b23f5fba3..5c17a2de6 100644 --- a/src/gui/EditWidgetIcons.ui +++ b/src/gui/EditWidgetIcons.ui @@ -167,7 +167,7 @@ padding: 4px 10px - Apply icon to... + Apply icon to… diff --git a/src/gui/EntryPreviewWidget.cpp b/src/gui/EntryPreviewWidget.cpp index 759d7e89e..c624b9914 100644 --- a/src/gui/EntryPreviewWidget.cpp +++ b/src/gui/EntryPreviewWidget.cpp @@ -17,15 +17,10 @@ */ #include "EntryPreviewWidget.h" -#include "Font.h" #include "ui_EntryPreviewWidget.h" -#include -#include - -#include "core/Config.h" +#include "Font.h" #include "entry/EntryAttachmentsModel.h" -#include "gui/Clipboard.h" #include "gui/Icons.h" #if defined(WITH_XC_KEESHARE) #include "keeshare/KeeShare.h" @@ -296,9 +291,9 @@ void EntryPreviewWidget::updateEntryAdvancedTab() value = "" + tr("[PROTECTED]") + ""; } else { value = m_currentEntry->attributes()->value(key).toHtmlEscaped(); - value.replace('\n', QLatin1String("
")); + value.replace('\n', "
"); } - attributesText.append(tr("%1:%2", "attributes line").arg(key, value)); + attributesText.append(QString("%1:%2").arg(key, value)); } attributesText.append(""); m_ui->entryAttributesEdit->setText(attributesText); @@ -417,5 +412,5 @@ void EntryPreviewWidget::setTabEnabled(QTabWidget* tabWidget, QWidget* widget, b QString EntryPreviewWidget::hierarchy(const Group* group, const QString& title) { QString groupList = QString("%1").arg(group->hierarchy().join(" / ")); - return title.isEmpty() ? groupList : QStringLiteral("%1 / %2").arg(groupList, title); + return title.isEmpty() ? groupList : QString("%1 / %2").arg(groupList, title); } diff --git a/src/gui/IconDownloaderDialog.cpp b/src/gui/IconDownloaderDialog.cpp index 96393c180..207f11d5e 100644 --- a/src/gui/IconDownloaderDialog.cpp +++ b/src/gui/IconDownloaderDialog.cpp @@ -80,13 +80,13 @@ void IconDownloaderDialog::downloadFavicons(const QSharedPointer& data Tools::wait(100); #endif showFallbackMessage(false); - m_ui->progressLabel->setText(tr("Please wait, processing entry list...")); + m_ui->progressLabel->setText(tr("Please wait, processing entry list…")); open(); QApplication::processEvents(); for (const auto& url : m_urlToEntries.uniqueKeys()) { m_dataModel->appendRow(QList() - << new QStandardItem(url) << new QStandardItem(tr("Downloading..."))); + << new QStandardItem(url) << new QStandardItem(tr("Downloading…"))); m_activeDownloaders.append(createDownloader(url)); } @@ -170,7 +170,7 @@ void IconDownloaderDialog::updateProgressBar() m_ui->progressBar->setValue(value); m_ui->progressBar->setMaximum(total); m_ui->progressLabel->setText( - tr("Downloading favicons (%1/%2)...").arg(QString::number(value), QString::number(total))); + tr("Downloading favicons (%1/%2)…").arg(QString::number(value), QString::number(total))); } void IconDownloaderDialog::updateCancelButton() diff --git a/src/gui/IconDownloaderDialog.ui b/src/gui/IconDownloaderDialog.ui index fbcfb01f1..e0d378633 100644 --- a/src/gui/IconDownloaderDialog.ui +++ b/src/gui/IconDownloaderDialog.ui @@ -29,7 +29,7 @@ - Downloading favicon 0/0... + Downloading favicon 0/0… diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 0a93bf259..ceb1739b5 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -584,7 +584,7 @@ MainWindow::MainWindow() #if defined(KEEPASSXC_BUILD_TYPE_SNAPSHOT) if (config()->get(Config::Messages_HidePreReleaseWarning) != KEEPASSXC_VERSION) { m_ui->globalMessageWidget->showMessage( - tr("WARNING: You are using an unstable build of KeePassXC!\n" + tr("WARNING: You are using an unstable build of KeePassXC.\n" "There is a high risk of corruption, maintain a backup of your databases.\n" "This version is not meant for production use."), MessageWidget::Warning, @@ -593,15 +593,15 @@ MainWindow::MainWindow() #elif defined(KEEPASSXC_BUILD_TYPE_PRE_RELEASE) if (config()->get(Config::Messages_HidePreReleaseWarning) != KEEPASSXC_VERSION) { m_ui->globalMessageWidget->showMessage( - tr("NOTE: You are using a pre-release version of KeePassXC!\n" - "Expect some bugs and minor issues, this version is not meant for production use."), + tr("NOTE: You are using a pre-release version of KeePassXC.\n" + "Expect some bugs and minor issues, this version is meant for testing purposes."), MessageWidget::Information, -1); } #elif (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) && QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) if (!config()->get(Config::Messages_Qt55CompatibilityWarning).toBool()) { m_ui->globalMessageWidget->showMessage( - tr("WARNING: Your Qt version may cause KeePassXC to crash with an On-Screen Keyboard!\n" + tr("WARNING: Your Qt version may cause KeePassXC to crash with an On-Screen Keyboard.\n" "We recommend you use the AppImage available on our downloads page."), MessageWidget::Warning, -1); diff --git a/src/gui/MainWindow.ui b/src/gui/MainWindow.ui index b141c8cc3..b57ef8482 100644 --- a/src/gui/MainWindow.ui +++ b/src/gui/MainWindow.ui @@ -595,7 +595,7 @@ false - Database &Reports... + Database &Reports… Statistics, health check, etc. @@ -702,7 +702,7 @@ false - {USERNAME} + {USERNAME} @@ -710,7 +710,7 @@ false - {USERNAME}{ENTER} + {USERNAME}{ENTER} @@ -718,7 +718,7 @@ false - {PASSWORD} + {PASSWORD} @@ -726,7 +726,7 @@ false - {PASSWORD}{ENTER} + {PASSWORD}{ENTER} @@ -898,7 +898,7 @@ false - Save Database Backup... + Save Database Backup… diff --git a/src/gui/SearchWidget.cpp b/src/gui/SearchWidget.cpp index 31ee7e9b4..7daea45d8 100644 --- a/src/gui/SearchWidget.cpp +++ b/src/gui/SearchWidget.cpp @@ -54,7 +54,7 @@ SearchWidget::SearchWidget(QWidget* parent) new QShortcut(QKeySequence::Find, this, SLOT(searchFocus()), nullptr, Qt::ApplicationShortcut); new QShortcut(Qt::Key_Escape, m_ui->searchEdit, SLOT(clear()), nullptr, Qt::ApplicationShortcut); - m_ui->searchEdit->setPlaceholderText(tr("Search (%1)...", "Search placeholder text, %1 is the keyboard shortcut") + m_ui->searchEdit->setPlaceholderText(tr("Search (%1)…", "Search placeholder text, %1 is the keyboard shortcut") .arg(QKeySequence(QKeySequence::Find).toString(QKeySequence::NativeText))); m_ui->searchEdit->installEventFilter(this); diff --git a/src/gui/TotpSetupDialog.ui b/src/gui/TotpSetupDialog.ui index c70dc00c7..5088d8bbf 100644 --- a/src/gui/TotpSetupDialog.ui +++ b/src/gui/TotpSetupDialog.ui @@ -71,7 +71,7 @@ - Default RFC 6238 token settings + Default settings (RFC 6238) true @@ -84,7 +84,7 @@ - Steam token settings + Steam® settings settingsButtonGroup @@ -94,7 +94,7 @@ - Use custom settings + Custom settings: settingsButtonGroup diff --git a/src/gui/UpdateCheckDialog.cpp b/src/gui/UpdateCheckDialog.cpp index 63e392bef..96d3a80ed 100644 --- a/src/gui/UpdateCheckDialog.cpp +++ b/src/gui/UpdateCheckDialog.cpp @@ -16,9 +16,9 @@ */ #include "UpdateCheckDialog.h" -#include "gui/Icons.h" #include "ui_UpdateCheckDialog.h" -#include "updatecheck/UpdateChecker.h" + +#include "gui/Icons.h" UpdateCheckDialog::UpdateCheckDialog(QWidget* parent) : QDialog(parent) @@ -36,29 +36,23 @@ UpdateCheckDialog::UpdateCheckDialog(QWidget* parent) SLOT(showUpdateCheckResponse(bool, QString))); } -void UpdateCheckDialog::showUpdateCheckResponse(bool status, const QString& version) +void UpdateCheckDialog::showUpdateCheckResponse(bool hasUpdate, const QString& version) { m_ui->progressBar->setVisible(false); m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Close")); - if (version == QString("error")) { - setWindowTitle(tr("Update Error!")); + setWindowTitle(tr("Software Update")); - m_ui->statusLabel->setText("" + tr("Update Error!") + "

" - + tr("An error occurred in retrieving update information.") + "
" - + tr("Please try again later.")); - return; - } - - if (status) { - setWindowTitle(tr("Software Update")); - m_ui->statusLabel->setText("" + tr("A new version of KeePassXC is available!") + "

" - + tr("KeePassXC %1 is now available — you have %2.").arg(version, KEEPASSXC_VERSION) - + "

" + "" - + tr("Download it at keepassxc.org") + ""); + if (version == UpdateChecker::ErrorVersion) { + m_ui->statusLabel->setText( + tr("An error occurred when trying to retrieve update information, please try again later.")); + } else if (hasUpdate) { + m_ui->statusLabel->setText( + tr("A new version is available.
" + "KeePassXC %1 can be downloaded here.") + .arg(version, KEEPASSXC_VERSION)); } else { - setWindowTitle(tr("You're up-to-date!")); - m_ui->statusLabel->setText(tr("KeePassXC %1 is currently the newest version available").arg(KEEPASSXC_VERSION)); + m_ui->statusLabel->setText(tr("You have the latest version of KeePassXC")); } } diff --git a/src/gui/UpdateCheckDialog.h b/src/gui/UpdateCheckDialog.h index 16e8bcce8..4aec12e04 100644 --- a/src/gui/UpdateCheckDialog.h +++ b/src/gui/UpdateCheckDialog.h @@ -40,7 +40,7 @@ public: ~UpdateCheckDialog() override; public slots: - void showUpdateCheckResponse(bool status, const QString& version); + void showUpdateCheckResponse(bool hasUpdate, const QString& version); private: QScopedPointer m_ui; diff --git a/src/gui/UpdateCheckDialog.ui b/src/gui/UpdateCheckDialog.ui index 9775cbf61..b5c51f2b9 100644 --- a/src/gui/UpdateCheckDialog.ui +++ b/src/gui/UpdateCheckDialog.ui @@ -76,7 +76,7 @@
- Checking for updates... + Checking for updates… Qt::RichText diff --git a/src/gui/databasekey/KeyFileEditWidget.cpp b/src/gui/databasekey/KeyFileEditWidget.cpp index 4265662c4..17348b8f9 100644 --- a/src/gui/databasekey/KeyFileEditWidget.cpp +++ b/src/gui/databasekey/KeyFileEditWidget.cpp @@ -109,7 +109,7 @@ void KeyFileEditWidget::createKeyFile() return; } QString filters = QString("%1 (*.keyx; *.key);;%2 (*)").arg(tr("Key files"), tr("All files")); - QString fileName = fileDialog()->getSaveFileName(this, tr("Create Key File..."), QString(), filters); + QString fileName = fileDialog()->getSaveFileName(this, tr("Create Key File…"), QString(), filters); if (!fileName.isEmpty()) { QString errorMsg; diff --git a/src/gui/databasekey/KeyFileEditWidget.ui b/src/gui/databasekey/KeyFileEditWidget.ui index 088995dc8..23b4e528b 100644 --- a/src/gui/databasekey/KeyFileEditWidget.ui +++ b/src/gui/databasekey/KeyFileEditWidget.ui @@ -45,7 +45,7 @@ Browse for key file - Browse... + Browse…
diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.cpp b/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.cpp index 746e6a66e..7c4aeedd4 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.cpp +++ b/src/gui/dbsettings/DatabaseSettingsWidgetBrowser.cpp @@ -250,7 +250,7 @@ void DatabaseSettingsWidgetBrowser::convertAttributesToCustomData() != MessageBox::question( this, tr("Move KeePassHTTP attributes to custom data"), - tr("Do you really want to move all legacy browser integration data to the latest standard?\n" + tr("Do you really want to convert all legacy browser integration data to the latest standard?\n" "This is necessary to maintain compatibility with the browser plugin."), MessageBox::Yes | MessageBox::Cancel, MessageBox::Cancel)) { diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp b/src/gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp index b59f2d266..819baca1c 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp +++ b/src/gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp @@ -32,7 +32,7 @@ DatabaseSettingsWidgetDatabaseKey::DatabaseSettingsWidgetDatabaseKey(QWidget* parent) : DatabaseSettingsWidget(parent) - , m_additionalKeyOptionsToggle(new QPushButton(tr("Add additional protection..."), this)) + , m_additionalKeyOptionsToggle(new QPushButton(tr("Add additional protection…"), this)) , m_additionalKeyOptions(new QWidget(this)) , m_passwordEditWidget(new PasswordEditWidget(this)) , m_keyFileEditWidget(new KeyFileEditWidget(this)) diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp b/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp index 2df1f28f0..46bdd9993 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp +++ b/src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp @@ -258,7 +258,7 @@ bool DatabaseSettingsWidgetEncryption::save() warning.setIcon(QMessageBox::Warning); warning.setWindowTitle(tr("Number of rounds too high", "Key transformation rounds")); warning.setText(tr("You are using a very high number of key transform rounds with Argon2.\n\n" - "If you keep this number, your database may take hours or days (or even longer) to open!")); + "If you keep this number, your database may take hours, days, or even longer to open.")); auto ok = warning.addButton(tr("Understood, keep number"), QMessageBox::ButtonRole::AcceptRole); auto cancel = warning.addButton(tr("Cancel"), QMessageBox::ButtonRole::RejectRole); warning.setDefaultButton(cancel); @@ -271,7 +271,7 @@ bool DatabaseSettingsWidgetEncryption::save() warning.setIcon(QMessageBox::Warning); warning.setWindowTitle(tr("Number of rounds too low", "Key transformation rounds")); warning.setText(tr("You are using a very low number of key transform rounds with AES-KDF.\n\n" - "If you keep this number, your database may be too easy to crack!")); + "If you keep this number, your database will not be protected from brute force attacks.")); auto ok = warning.addButton(tr("Understood, keep number"), QMessageBox::ButtonRole::AcceptRole); auto cancel = warning.addButton(tr("Cancel"), QMessageBox::ButtonRole::RejectRole); warning.setDefaultButton(cancel); diff --git a/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.ui b/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.ui index 29349282b..34185ad23 100644 --- a/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.ui +++ b/src/gui/dbsettings/DatabaseSettingsWidgetGeneral.ui @@ -38,7 +38,7 @@ - Database Meta Data + Database Metadata diff --git a/src/gui/entry/EditEntryWidgetMain.ui b/src/gui/entry/EditEntryWidgetMain.ui index 183ca0388..07445261e 100644 --- a/src/gui/entry/EditEntryWidgetMain.ui +++ b/src/gui/entry/EditEntryWidgetMain.ui @@ -199,7 +199,7 @@ Url field - https://example.com + https://example.com diff --git a/src/gui/entry/EditEntryWidgetSSHAgent.ui b/src/gui/entry/EditEntryWidgetSSHAgent.ui index fae13dccb..81fac082a 100644 --- a/src/gui/entry/EditEntryWidgetSSHAgent.ui +++ b/src/gui/entry/EditEntryWidgetSSHAgent.ui @@ -131,7 +131,7 @@ Browser for key file - Browse... + Browse… diff --git a/src/gui/reports/ReportsPageHealthcheck.cpp b/src/gui/reports/ReportsPageHealthcheck.cpp index 118f10c5f..ca99f819e 100644 --- a/src/gui/reports/ReportsPageHealthcheck.cpp +++ b/src/gui/reports/ReportsPageHealthcheck.cpp @@ -29,7 +29,7 @@ ReportsPageHealthcheck::ReportsPageHealthcheck() QString ReportsPageHealthcheck::name() { - return QApplication::tr("Health Check"); + return QObject::tr("Health Check"); } QIcon ReportsPageHealthcheck::icon() diff --git a/src/gui/reports/ReportsPageHibp.cpp b/src/gui/reports/ReportsPageHibp.cpp index 43751916f..22ac30754 100644 --- a/src/gui/reports/ReportsPageHibp.cpp +++ b/src/gui/reports/ReportsPageHibp.cpp @@ -29,7 +29,7 @@ ReportsPageHibp::ReportsPageHibp() QString ReportsPageHibp::name() { - return QApplication::tr("HIBP"); + return QObject::tr("HIBP"); } QIcon ReportsPageHibp::icon() diff --git a/src/gui/reports/ReportsPageStatistics.cpp b/src/gui/reports/ReportsPageStatistics.cpp index e14db96c7..cfef828aa 100644 --- a/src/gui/reports/ReportsPageStatistics.cpp +++ b/src/gui/reports/ReportsPageStatistics.cpp @@ -24,7 +24,7 @@ QString ReportsPageStatistics::name() { - return QApplication::tr("Statistics"); + return QObject::tr("Statistics"); } QIcon ReportsPageStatistics::icon() diff --git a/src/gui/reports/ReportsWidgetHealthcheck.cpp b/src/gui/reports/ReportsWidgetHealthcheck.cpp index 3a87631e3..ea52e1d4a 100644 --- a/src/gui/reports/ReportsWidgetHealthcheck.cpp +++ b/src/gui/reports/ReportsWidgetHealthcheck.cpp @@ -235,7 +235,7 @@ void ReportsWidgetHealthcheck::loadSettings(QSharedPointer db) m_rowToEntry.clear(); auto row = QList(); - row << new QStandardItem(tr("Please wait, health data is being calculated...")); + row << new QStandardItem(tr("Please wait, health data is being calculated…")); m_referencesModel->appendRow(row); } @@ -325,7 +325,7 @@ void ReportsWidgetHealthcheck::customMenuRequested(QPoint pos) const auto menu = new QMenu(this); // Create the "edit entry" menu item - const auto edit = new QAction(icons()->icon("entry-edit"), tr("Edit Entry..."), this); + const auto edit = new QAction(icons()->icon("entry-edit"), tr("Edit Entry…"), this); menu->addAction(edit); connect(edit, SIGNAL(triggered()), SLOT(editFromContextmenu())); diff --git a/src/gui/reports/ReportsWidgetHibp.cpp b/src/gui/reports/ReportsWidgetHibp.cpp index 92b75e4a6..6315f205c 100644 --- a/src/gui/reports/ReportsWidgetHibp.cpp +++ b/src/gui/reports/ReportsWidgetHibp.cpp @@ -297,22 +297,22 @@ void ReportsWidgetHibp::startValidation() QString ReportsWidgetHibp::countToText(int count) { if (count == 1) { - return tr("once"); + return tr("once", "Password exposure amount"); } else if (count <= 10) { - return tr("up to 10 times"); + return tr("up to 10 times", "Password exposure amount"); } else if (count <= 100) { - return tr("up to 100 times"); + return tr("up to 100 times", "Password exposure amount"); } else if (count <= 1000) { - return tr("up to 1000 times"); + return tr("up to 1000 times", "Password exposure amount"); } else if (count <= 10000) { - return tr("up to 10,000 times"); + return tr("up to 10,000 times", "Password exposure amount"); } else if (count <= 100000) { - return tr("up to 100,000 times"); + return tr("up to 100,000 times", "Password exposure amount"); } else if (count <= 1000000) { - return tr("up to a million times"); + return tr("up to a million times", "Password exposure amount"); } - return tr("millions of times"); + return tr("millions of times", "Password exposure amount"); } /* @@ -387,7 +387,7 @@ void ReportsWidgetHibp::customMenuRequested(QPoint pos) const auto menu = new QMenu(this); // Create the "edit entry" menu item - const auto edit = new QAction(icons()->icon("entry-edit"), tr("Edit Entry..."), this); + const auto edit = new QAction(icons()->icon("entry-edit"), tr("Edit Entry…"), this); menu->addAction(edit); connect(edit, SIGNAL(triggered()), SLOT(editFromContextmenu())); diff --git a/src/gui/reports/ReportsWidgetStatistics.cpp b/src/gui/reports/ReportsWidgetStatistics.cpp index 2da093373..338fd4c9a 100644 --- a/src/gui/reports/ReportsWidgetStatistics.cpp +++ b/src/gui/reports/ReportsWidgetStatistics.cpp @@ -193,7 +193,7 @@ void ReportsWidgetStatistics::loadSettings(QSharedPointer db) m_db = std::move(db); m_statsCalculated = false; m_referencesModel->clear(); - addStatsRow(tr("Please wait, database statistics are being calculated..."), ""); + addStatsRow(tr("Please wait, database statistics are being calculated…"), ""); } void ReportsWidgetStatistics::showEvent(QShowEvent* event) diff --git a/src/gui/wizard/NewDatabaseWizard.cpp b/src/gui/wizard/NewDatabaseWizard.cpp index 45ac8e46d..533b5de62 100644 --- a/src/gui/wizard/NewDatabaseWizard.cpp +++ b/src/gui/wizard/NewDatabaseWizard.cpp @@ -48,7 +48,7 @@ NewDatabaseWizard::NewDatabaseWizard(QWidget* parent) addPage(page); } - setWindowTitle(tr("Create a new KeePassXC database...")); + setWindowTitle(tr("Create a new KeePassXC database…")); Q_INIT_RESOURCE(wizard); setPixmap(QWizard::BackgroundPixmap, QPixmap(":/wizard/background-pixmap.png")); diff --git a/src/keeshare/DatabaseSettingsPageKeeShare.cpp b/src/keeshare/DatabaseSettingsPageKeeShare.cpp index 9a55e2c31..3eb414bab 100644 --- a/src/keeshare/DatabaseSettingsPageKeeShare.cpp +++ b/src/keeshare/DatabaseSettingsPageKeeShare.cpp @@ -27,7 +27,7 @@ QString DatabaseSettingsPageKeeShare::name() { - return QApplication::tr("KeeShare"); + return "KeeShare"; } QIcon DatabaseSettingsPageKeeShare::icon() diff --git a/src/keeshare/SettingsPageKeeShare.cpp b/src/keeshare/SettingsPageKeeShare.cpp index 0a48d3707..0661f3b47 100644 --- a/src/keeshare/SettingsPageKeeShare.cpp +++ b/src/keeshare/SettingsPageKeeShare.cpp @@ -34,7 +34,7 @@ SettingsPageKeeShare::SettingsPageKeeShare(DatabaseTabWidget* tabWidget) QString SettingsPageKeeShare::name() { - return QApplication::tr("KeeShare"); + return "KeeShare"; } QIcon SettingsPageKeeShare::icon() diff --git a/src/keeshare/group/EditGroupPageKeeShare.cpp b/src/keeshare/group/EditGroupPageKeeShare.cpp index 8898b60c6..bf44fd30f 100644 --- a/src/keeshare/group/EditGroupPageKeeShare.cpp +++ b/src/keeshare/group/EditGroupPageKeeShare.cpp @@ -29,7 +29,7 @@ EditGroupPageKeeShare::EditGroupPageKeeShare(EditGroupWidget* widget) QString EditGroupPageKeeShare::name() { - return QApplication::tr("KeeShare"); + return "KeeShare"; } QIcon EditGroupPageKeeShare::icon() diff --git a/src/keeshare/group/EditGroupWidgetKeeShare.ui b/src/keeshare/group/EditGroupWidgetKeeShare.ui index 7cea782f1..9b87f963f 100644 --- a/src/keeshare/group/EditGroupWidgetKeeShare.ui +++ b/src/keeshare/group/EditGroupWidgetKeeShare.ui @@ -132,7 +132,7 @@ Browse for share file - Browse... + Browse… diff --git a/src/keys/drivers/YubiKey.cpp b/src/keys/drivers/YubiKey.cpp index 7feeec89f..07b287c86 100644 --- a/src/keys/drivers/YubiKey.cpp +++ b/src/keys/drivers/YubiKey.cpp @@ -188,11 +188,13 @@ void YubiKey::findValidKeys() .arg(vender, QString::number(serial), QString::number(slot)); ykSlots.append({slot, display}); } else if (performTestChallenge(yk_key, slot, &wouldBlock)) { - auto display = tr("%1 [%2] Challenge Response - Slot %3 - %4") - .arg(vender, - QString::number(serial), - QString::number(slot), - wouldBlock ? tr("Press") : tr("Passive")); + auto display = + tr("%1 [%2] Challenge-Response - Slot %3 - %4") + .arg(vender, + QString::number(serial), + QString::number(slot), + wouldBlock ? tr("Press", "Challenge-Response Key interaction request") + : tr("Passive", "Challenge-Response Key no interaction required")); ykSlots.append({slot, display}); } } @@ -356,7 +358,7 @@ YubiKey::performChallenge(void* key, int slot, bool mayBlock, const QByteArray& if (yk_errno == YK_ETIMEOUT) { m_error = tr("Hardware key timed out waiting for user interaction."); } else if (yk_errno == YK_EUSBERR) { - m_error = tr("A USB error ocurred when accessing the hardware key: %1").arg(yk_usb_strerror()); + m_error = tr("A USB error occurred when accessing the hardware key: %1").arg(yk_usb_strerror()); } else { m_error = tr("Failed to complete a challenge-response, the specific error was: %1") .arg(yk_strerror(yk_errno)); diff --git a/src/updatecheck/UpdateChecker.cpp b/src/updatecheck/UpdateChecker.cpp index 3d3387585..262aab86a 100644 --- a/src/updatecheck/UpdateChecker.cpp +++ b/src/updatecheck/UpdateChecker.cpp @@ -27,6 +27,7 @@ #include #include +const QString UpdateChecker::ErrorVersion("error"); UpdateChecker* UpdateChecker::m_instance(nullptr); UpdateChecker::UpdateChecker(QObject* parent) @@ -104,7 +105,7 @@ void UpdateChecker::fetchFinished() // TODO: change to toSecsSinceEpoch() when min Qt >= 5.8 config()->set(Config::GUI_CheckForUpdatesNextCheck, Clock::currentDateTime().addDays(7).toTime_t()); } else { - version = "error"; + version = ErrorVersion; } emit updateCheckFinished(hasNewVersion, version, m_isManuallyRequested); diff --git a/src/updatecheck/UpdateChecker.h b/src/updatecheck/UpdateChecker.h index 9e804b274..5af85537a 100644 --- a/src/updatecheck/UpdateChecker.h +++ b/src/updatecheck/UpdateChecker.h @@ -33,6 +33,8 @@ public: static bool compareVersions(const QString& localVersion, const QString& remoteVersion); static UpdateChecker* instance(); + static const QString ErrorVersion; + signals: void updateCheckFinished(bool hasNewVersion, QString version, bool isManuallyRequested); diff --git a/src/zxcvbn/zxcvbn.c b/src/zxcvbn/zxcvbn.c index 26237fba8..9a9e14dfe 100644 --- a/src/zxcvbn/zxcvbn.c +++ b/src/zxcvbn/zxcvbn.c @@ -180,12 +180,12 @@ static void AddResult(ZxcMatch_t **HeadRef, ZxcMatch_t *Nu, int MaxLen) if (Nu->Begin) { if (Nu->Length >= MaxLen) - Nu->MltEnpy = Nu->Entrpy + MULTI_END_ADDITION * log(2.0); + Nu->MltEnpy = Nu->Entropy + MULTI_END_ADDITION * log(2.0); else - Nu->MltEnpy = Nu->Entrpy + MULTI_MID_ADDITION * log(2.0); + Nu->MltEnpy = Nu->Entropy + MULTI_MID_ADDITION * log(2.0); } else - Nu->MltEnpy = Nu->Entrpy; + Nu->MltEnpy = Nu->Entropy; /* Find the correct insert point */ while(*HeadRef && ((*HeadRef)->Length < Nu->Length)) @@ -231,7 +231,7 @@ static void AddMatchRepeats(ZxcMatch_t **Result, ZxcMatch_t *Match, const uint8_ { /* Found a repeat */ ZxcMatch_t *p = AllocMatch(); - p->Entrpy = Match->Entrpy + log(RepeatCount); + p->Entropy = Match->Entropy + log(RepeatCount); p->Type = (ZxcTypeMatch_t)(Match->Type + MULTIPLE_MATCH); p->Length = Len * RepeatCount; p->Begin = Match->Begin; @@ -616,7 +616,7 @@ static void DictionaryEntropy(ZxcMatch_t *m, DictMatchInfo_t *Extra, const uint8 } /* Add entropy due to word's rank */ e += log((double)Extra->Rank); - m->Entrpy = e; + m->Entropy = e; } /********************************************************************************** @@ -877,7 +877,7 @@ static void UserMatch(ZxcMatch_t **Result, const char *Words[], const uint8_t *P p->Type = USER_LEET_MATCH; p->Length = Len; p->Begin = Start; - /* Add Entrpy */ + /* Add Entropy */ Extra.Caps = Caps; Extra.Lower = Lowers; Extra.NumLeet = Leets; @@ -1206,7 +1206,7 @@ static void SpatialMatch(ZxcMatch_t **Result, const uint8_t *Passwd, int Start, p = AllocMatch(); p->Type = SPATIAL_MATCH; p->Begin = Start; - p->Entrpy = Entropy; + p->Entropy = Entropy; p->Length = Len; AddMatchRepeats(Result, p, Passwd, MaxLen); AddResult(Result, p, MaxLen); @@ -1345,7 +1345,7 @@ static void DateMatch(ZxcMatch_t **Result, const uint8_t *Passwd, int Start, int e = log(31 * 12 * 100.0); if (Sep) e += log(4.0); /* Extra 2 bits for separator */ - p->Entrpy = e; + p->Entropy = e; p->Type = DATE_MATCH; p->Length = Len; p->Begin = Start; @@ -1390,7 +1390,7 @@ static void RepeatMatch(ZxcMatch_t **Result, const uint8_t *Passwd, int Start, i p->Type = REPEATS_MATCH; p->Begin = Start; p->Length = i; - p->Entrpy = log(Card * i); + p->Entropy = log(Card * i); AddResult(Result, p, MaxLen); } } @@ -1407,7 +1407,7 @@ static void RepeatMatch(ZxcMatch_t **Result, const uint8_t *Passwd, int Start, i /* Found a repeat */ int c = Cardinality(Passwd, Len); ZxcMatch_t *p = AllocMatch(); - p->Entrpy = log((double)c) * Len + log(RepeatCount); + p->Entropy = log((double)c) * Len + log(RepeatCount); p->Type = (ZxcTypeMatch_t)(BRUTE_MATCH + MULTIPLE_MATCH); p->Length = Len * RepeatCount; p->Begin = Start; @@ -1525,7 +1525,7 @@ static void SequenceMatch(ZxcMatch_t **Result, const uint8_t *Passwd, int Start, p->Type = SEQUENCE_MATCH; p->Begin = Start; p->Length = i; - p->Entrpy = e + log((double)i); + p->Entropy = e + log((double)i); AddMatchRepeats(Result, p, Pwd, MaxLen); AddResult(Result, p, MaxLen); } @@ -1654,7 +1654,7 @@ double ZxcvbnMatch(const char *Pwd, const char *UserDict[], ZxcMatch_t **Info) Zp->Type = BRUTE_MATCH; Zp->Begin = i; Zp->Length = j - i; - Zp->Entrpy = e * (j - i); + Zp->Entropy = e * (j - i); AddResult(&(Nodes[i].Paths), Zp, MaxLen); } } @@ -1723,7 +1723,7 @@ double ZxcvbnMatch(const char *Pwd, const char *UserDict[], ZxcMatch_t **Info) if (Xp == Zp) { /* Adjust the entropy to log to base 2 */ - Xp->Entrpy /= log(2.0); + Xp->Entropy /= log(2.0); Xp->MltEnpy /= log(2.0); /* Put previous part at head of info list */ diff --git a/src/zxcvbn/zxcvbn.h b/src/zxcvbn/zxcvbn.h index 9500c7a95..5d9c597a1 100644 --- a/src/zxcvbn/zxcvbn.h +++ b/src/zxcvbn/zxcvbn.h @@ -70,7 +70,7 @@ struct ZxcMatch { int Begin; /* Char position of begining of match */ int Length; /* Number of chars in the match */ - double Entrpy; /* The entropy of the match */ + double Entropy; /* The entropy of the match */ double MltEnpy; /* Entropy with additional allowance for multipart password */ ZxcTypeMatch_t Type; /* Type of match (Spatial/Dictionary/Order/Repeat) */ struct ZxcMatch *Next; diff --git a/tests/gui/TestGui.cpp b/tests/gui/TestGui.cpp index 79a12ec2b..5ce371668 100644 --- a/tests/gui/TestGui.cpp +++ b/tests/gui/TestGui.cpp @@ -1501,7 +1501,7 @@ void TestGui::testSortGroups() void TestGui::testTrayRestoreHide() { if (!QSystemTrayIcon::isSystemTrayAvailable()) { - QSKIP("QSystemTrayIcon::isSystemTrayAvailable() = false, skipping tray restore/hide test..."); + QSKIP("QSystemTrayIcon::isSystemTrayAvailable() = false, skipping tray restore/hide test…"); } m_mainWindow->hideWindow();