Commit e47dfe74 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Unify labeling of creation and expiration date

Use "Valid from" resp. "Valid until" to label the creation date resp.
the expiration date. Use the term "unlimited" for no expiration date.
Use "end of validity period" instead of "expiry/expiration [date]".

GnuPG-bug-id: 6120
parent a6e9353e
Pipeline #211981 passed with stage
in 4 minutes and 2 seconds
......@@ -196,16 +196,14 @@ void ChangeExpiryCommand::Private::createJob()
void ChangeExpiryCommand::Private::showErrorDialog(const Error &err)
{
error(i18n("<p>An error occurred while trying to change "
"the expiry date for <b>%1</b>:</p><p>%2</p>",
"the end of the validity period for <b>%1</b>:</p><p>%2</p>",
Formatting::formatForComboBox(key),
QString::fromLocal8Bit(err.asString())),
i18n("Expiry Date Change Error"));
QString::fromLocal8Bit(err.asString())));
}
void ChangeExpiryCommand::Private::showSuccessDialog()
{
information(i18n("Expiry date changed successfully."),
i18n("Expiry Date Change Succeeded"));
success(i18n("End of validity period changed successfully."));
}
ChangeExpiryCommand::ChangeExpiryCommand(KeyListController *c)
......
......@@ -402,11 +402,11 @@ private:
gridLayout->addLayout(validFromField->layout(), row, 1);
row++;
expiresField = std::make_unique<InfoField>(i18n("Expires:"), parent);
expiresField = std::make_unique<InfoField>(i18n("Valid until:"), parent);
changeExpirationAction = new QAction{parent};
changeExpirationAction->setIcon(QIcon::fromTheme(QStringLiteral("editor")));
changeExpirationAction->setToolTip(i18nc("@info:tooltip", "Change the expiration date"));
changeExpirationAction->setProperty(accessibleNameProperty, i18nc("@action:button", "Change expiration"));
changeExpirationAction->setToolTip(i18nc("@info:tooltip", "Change the end of the validity period"));
changeExpirationAction->setProperty(accessibleNameProperty, i18nc("@action:button", "Change Validity"));
expiresField->setAction(changeExpirationAction);
gridLayout->addWidget(expiresField->label(), row, 0);
gridLayout->addLayout(expiresField->layout(), row, 1);
......@@ -594,8 +594,8 @@ void CertificateDetailsWidget::Private::setupCommonProperties()
// update values of protocol-independent UI elements
ui.validFromField->setValue(Formatting::creationDateString(key), Formatting::accessibleCreationDate(key));
ui.expiresField->setValue(Formatting::expirationDateString(key, i18nc("Expires", "never")),
Formatting::accessibleExpirationDate(key, i18nc("Expires", "never")));
ui.expiresField->setValue(Formatting::expirationDateString(key, i18nc("Valid until:", "unlimited")),
Formatting::accessibleExpirationDate(key));
ui.fingerprintField->setValue(Formatting::prettyID(key.primaryFingerprint()),
Formatting::accessibleHexID(key.primaryFingerprint()));
if (DeVSCompliance::isCompliant()) {
......
......@@ -66,13 +66,13 @@ static QString accessibleValidityDuration(int amount, Period unit)
{
switch (unit) {
case Days:
return i18ncp("(Expires) in x day(s)", "in %1 day", "in %1 days", amount);
return i18np("Valid for %1 day", "Valid for %1 days", amount);
case Weeks:
return i18ncp("(Expires) in x week(s)", "in %1 week", "in %1 weeks", amount);
return i18np("Valid for %1 week", "Valid for %1 weeks", amount);
case Months:
return i18ncp("(Expires) in x month(s)", "in %1 month", "in %1 months", amount);
return i18np("Valid for %1 month", "Valid for %1 months", amount);
case Years:
return i18ncp("(Expires) in x year(s)", "in %1 year", "in %1 years", amount);
return i18np("Valid for %1 year", "Valid for %1 years", amount);
default:
Q_ASSERT(!"invalid unit");
}
......@@ -158,12 +158,12 @@ private:
{
auto label = new QLabel{qq};
label->setText(mode == Mode::UpdateIndividualSubkey ?
i18n("Please select when to expire this subkey:") :
i18n("Please select when to expire this certificate:"));
i18n("Please select until when the subkey should be valid:") :
i18n("Please select until when the certificate should be valid:"));
vboxLayout->addWidget(label);
}
neverRB = new QRadioButton(i18n("Ne&ver"), mainWidget);
neverRB = new QRadioButton(i18n("Unlimited validity"), mainWidget);
neverRB->setChecked(false);
vboxLayout->addWidget(neverRB);
......@@ -171,7 +171,7 @@ private:
{
auto hboxLayout = new QHBoxLayout;
inRB = new QRadioButton{i18n("In"), mainWidget};
inRB = new QRadioButton{i18n("Valid for:"), mainWidget};
inRB->setChecked(false);
hboxLayout->addWidget(inRB);
......@@ -201,7 +201,7 @@ private:
{
auto hboxLayout = new QHBoxLayout;
onRB = new QRadioButton{i18n("On this da&y:"), mainWidget};
onRB = new QRadioButton{i18n("Valid until:"), mainWidget};
onRB->setChecked(true);
hboxLayout->addWidget(onRB);
......@@ -217,7 +217,7 @@ private:
}
{
updateSubkeysCheckBox = new QCheckBox{i18n("Also update the expiry of the subkeys"), qq};
updateSubkeysCheckBox = new QCheckBox{i18n("Also update the validity period of the subkeys"), qq};
#ifdef QGPGME_SUPPORTS_CHANGING_EXPIRATION_OF_COMPLETE_KEY
updateSubkeysCheckBox->setVisible(mode == Mode::UpdateCertificateWithSubkeys);
#else
......@@ -273,7 +273,7 @@ void ExpiryDialog::Private::slotOnDateChanged()
if (ui.onRB->isChecked()) {
ui.inSB->setValue(inAmountByDate(ui.onCB->date()));
}
ui.onRB->setAccessibleName(i18nc("(Expires) on DATE", "on %1", Formatting::accessibleDate(ui.onCB->date())));
ui.onRB->setAccessibleName(i18nc("Valid until DATE", "Valid until %1", Formatting::accessibleDate(ui.onCB->date())));
}
QDate ExpiryDialog::Private::inDate() const
......@@ -309,7 +309,7 @@ ExpiryDialog::ExpiryDialog(Mode mode, QWidget *p)
: QDialog{p}
, d{new Private{mode, this}}
{
setWindowTitle(i18nc("@title:window", "Change Expiry"));
setWindowTitle(i18nc("@title:window", "Change Validity Period"));
}
ExpiryDialog::~ExpiryDialog() = default;
......
......@@ -115,7 +115,7 @@ void SubKeysWidget::Private::tableContextMenuRequested(const QPoint &p)
if (isOpenPGPKey && subkey.parent().hasSecret()) {
hasActions = true;
menu->addAction(i18n("Change Expiry Date..."), q,
menu->addAction(i18n("Change End of Validity Period..."), q,
[this, subkey]() {
auto cmd = new ChangeExpiryCommand(subkey.parent());
cmd->setSubkey(subkey);
......
......@@ -443,7 +443,7 @@ void KeyListController::createActions(KActionCollection *coll)
"view-certificate-revoke", nullptr, nullptr, QString()
},
{
"certificates_change_expiry", i18n("Change Expiry Date..."), QString(),
"certificates_change_expiry", i18n("Change End of Validity Period..."), QString(),
nullptr, nullptr, nullptr, QString()
},
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment