Commit 1284d526 authored by Volker Krause's avatar Volker Krause
Browse files

Add i18n changes we can't do in the stable branch due to string freeze

parent 8c355f75
......@@ -72,11 +72,10 @@ ColumnLayout {
return certificate.resultString;
}
switch (certificate.result) {
// TODO as we are past the string freeze this reuses already existing strings that are close to what we want, fix this is master
case KHC.TestCertificate.Positive:
return i18n('Positive test');
return i18nc('test result', 'Positive');
case KHC.TestCertificate.Negative:
return i18n('Negative test');
return i18nc('test result', 'Negative');
}
}
Kirigami.FormData.label: i18n("Result:")
......
......@@ -110,11 +110,14 @@ QVariant HealthCertificateManager::data(const QModelIndex &index, int role) cons
#if HAVE_KHEALTHCERTIFICATE
if (v.cert.userType() == qMetaTypeId<KVaccinationCertificate>()) {
const auto cert = v.cert.value<KVaccinationCertificate>();
return i18n("Vaccination %1/%2 (%3)", cert.dose(), cert.totalDoses(), cert.name());
if (cert.dose() > 0 && cert.totalDoses() > 0) {
return i18n("Vaccination %1/%2 (%3)", cert.dose(), cert.totalDoses(), cert.name());
}
return i18n("Vaccination (%1)", cert.name());
}
if (v.cert.userType() == qMetaTypeId<KTestCertificate>()) {
const auto cert = v.cert.value<KTestCertificate>();
return i18n("Test %1 (%2)", QLocale().toString(cert.date(), QLocale::NarrowFormat), cert.name());
return i18n("Test %1 (%2)", QLocale().toString(cert.date().isValid() ? cert.date() : cert.certificateIssueDate().date(), QLocale::NarrowFormat), cert.name());
}
if (v.cert.userType() == qMetaTypeId<KRecoveryCertificate>()) {
const auto cert = v.cert.value<KRecoveryCertificate>();
......
......@@ -142,7 +142,7 @@ QString Localizer::formatDate(const QVariant &obj, const QString &propertyName)
}
if (dt.year() <= 1900) { // no year specified
return dt.toString(QStringLiteral("dd MMMM")); // TODO i18n in master
return dt.toString(i18nc("day-only date format", "dd MMMM"));
}
return QLocale().toString(dt, QLocale::ShortFormat);
}
......
Markdown is supported
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