0
0
mirror of https://github.com/keepassxreboot/keepassxc.git synced 2024-09-20 04:12:15 +02:00

Make cipher and KDF settings properly translatable

This commit is contained in:
Janek Bevendorff 2018-03-04 19:09:37 +01:00
parent 2fd2085bb5
commit 02b923b0e5
3 changed files with 35 additions and 32 deletions

View File

@ -2578,6 +2578,33 @@ This is a one-way migration. You won't be able to open the imported databas
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>KeePass2</name>
<message>
<source>AES: 256-bit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Twofish: 256-bit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ChaCha20: 256-bit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AES-KDF (KDBX 4)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AES-KDF (KDBX 3.1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Argon2 (KDBX 4 recommended)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Main</name>
<message>
@ -3476,30 +3503,6 @@ Available commands:
<source>missing closing quote</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AES: 256-bit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Twofish: 256-bit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ChaCha20: 256-bit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Argon2 (KDBX 4 recommended)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AES-KDF (KDBX 4)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>AES-KDF (KDBX 3.1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Group</source>
<translation type="unfinished"></translation>

View File

@ -45,15 +45,15 @@ const QString KeePass2::KDFPARAM_ARGON2_SECRET("K");
const QString KeePass2::KDFPARAM_ARGON2_ASSOCDATA("A");
const QList<QPair<Uuid, QString>> KeePass2::CIPHERS{
qMakePair(KeePass2::CIPHER_AES, QObject::tr("AES: 256-bit")),
qMakePair(KeePass2::CIPHER_TWOFISH, QObject::tr("Twofish: 256-bit")),
qMakePair(KeePass2::CIPHER_CHACHA20, QObject::tr("ChaCha20: 256-bit"))
qMakePair(KeePass2::CIPHER_AES, QString(QT_TRANSLATE_NOOP("KeePass2", "AES: 256-bit"))),
qMakePair(KeePass2::CIPHER_TWOFISH, QString(QT_TRANSLATE_NOOP("KeePass2", "Twofish: 256-bit"))),
qMakePair(KeePass2::CIPHER_CHACHA20, QString(QT_TRANSLATE_NOOP("KeePass2", "ChaCha20: 256-bit")))
};
const QList<QPair<Uuid, QString>> KeePass2::KDFS{
qMakePair(KeePass2::KDF_ARGON2, QObject::tr("Argon2 (KDBX 4 recommended)")),
qMakePair(KeePass2::KDF_AES_KDBX4, QObject::tr("AES-KDF (KDBX 4)")),
qMakePair(KeePass2::KDF_AES_KDBX3, QObject::tr("AES-KDF (KDBX 3.1)"))
qMakePair(KeePass2::KDF_ARGON2, QString(QT_TRANSLATE_NOOP("KeePass2", "Argon2 (KDBX 4 recommended)"))),
qMakePair(KeePass2::KDF_AES_KDBX4, QString(QT_TRANSLATE_NOOP("KeePass2", "AES-KDF (KDBX 4)"))),
qMakePair(KeePass2::KDF_AES_KDBX3, QString(QT_TRANSLATE_NOOP("KeePass2", "AES-KDF (KDBX 3.1)")))
};
QByteArray KeePass2::hmacKey(QByteArray masterSeed, QByteArray transformedMasterKey) {

View File

@ -102,7 +102,7 @@ void DatabaseSettingsWidget::load(Database* db)
m_uiEncryption->algorithmComboBox->clear();
for (auto& cipher: asConst(KeePass2::CIPHERS)) {
m_uiEncryption->algorithmComboBox->addItem(cipher.second, cipher.first.toByteArray());
m_uiEncryption->algorithmComboBox->addItem(QCoreApplication::translate("KeePass2", cipher.second.toUtf8()), cipher.first.toByteArray());
}
int cipherIndex = m_uiEncryption->algorithmComboBox->findData(m_db->cipher().toByteArray());
if (cipherIndex > -1) {
@ -113,7 +113,7 @@ void DatabaseSettingsWidget::load(Database* db)
m_uiEncryption->kdfComboBox->blockSignals(true);
m_uiEncryption->kdfComboBox->clear();
for (auto& kdf: asConst(KeePass2::KDFS)) {
m_uiEncryption->kdfComboBox->addItem(kdf.second, kdf.first.toByteArray());
m_uiEncryption->kdfComboBox->addItem(QCoreApplication::translate("KeePass2", kdf.second.toUtf8()), kdf.first.toByteArray());
}
m_uiEncryption->kdfComboBox->blockSignals(false);