Add title to 'add' dialog for details of 'Certificate' entity

To improve translation quality the title of 'Add' dialog,
which is initialized within details of the entity, should be
specified explicitly in the spec and should be an entire sentence.

Fixes: https://pagure.io/freeipa/issue/7712
Fixes: https://pagure.io/freeipa/issue/7714
Reviewed-By: Serhii Tsymbaliuk <stsymbal@redhat.com>
This commit is contained in:
Stanislav Levin 2018-09-24 11:26:16 +03:00 committed by Serhii Tsymbaliuk
parent a502fa939f
commit dda488efc2
2 changed files with 13 additions and 25 deletions

View File

@ -696,7 +696,6 @@ IPA.cert.request_action = function(spec) {
spec.hide_cond = spec.hide_cond || ['ra_disabled'];
var that = IPA.action(spec);
that.entity_label = spec.entity_label;
that.generic = spec.generic !== undefined ? spec.generic : false;
that.execute_action = function(facet) {
@ -709,15 +708,12 @@ IPA.cert.request_action = function(spec) {
var certificate = facet.certificate;
if (!certificate) facet.refresh();
var entity_label = that.entity_label || facet.entity.metadata.label_singular;
entity_principal = certificate.entity_info.principal;
var entity_name = certificate.entity_info.name;
cn = certificate.entity_info.cn || cn;
cn_name = certificate.entity_info.cn_name || cn_name;
title = text.get('@i18n:objects.cert.issue_certificate');
title = title.replace('${entity}', entity_label);
title = text.get(spec.title) || title;
title = title.replace('${primary_key}', entity_name);
}
@ -823,20 +819,16 @@ IPA.cert.revoke_action = function(spec) {
spec.needs_confirm = spec.needs_confirm !== undefined ? spec.needs_confirm : true;
var that = IPA.action(spec);
that.entity_label = spec.entity_label;
that.confirm_msg = spec.request_message;
that.update_confirm_dialog = function(facet) {
var certificate = facet.certificate;
var entity_label = that.entity_label || facet.entity.metadata.label_singular;
var entity_name = certificate.entity_info.name;
var title = text.get('@i18n:objects.cert.revoke_certificate_simple');
if (entity_name && entity_label) {
title = text.get('@i18n:objects.cert.revoke_certificate');
title = title.replace('${entity}', entity_label);
if (entity_name) {
title = text.get(spec.title) || title;
title = title.replace('${primary_key}', entity_name);
}
@ -879,20 +871,16 @@ IPA.cert.remove_hold_action = function(spec) {
spec.needs_confirm = spec.needs_confirm !== undefined ? spec.needs_confirm : true;
var that = IPA.action(spec);
that.entity_label = spec.entity_label;
that.update_confirm_dialog = function(facet) {
var certificate = facet.certificate;
var entity_label = that.entity_label || facet.entity.metadata.label_singular;
var entity_name = certificate.entity_info.name;
var title = text.get('@i18n:objects.cert.remove_certificate_hold_simple');
if (entity_name && entity_label) {
title = text.get('@i18n:objects.cert.remove_certificate_hold');
title = title.replace('${entity}', entity_label);
if (entity_name) {
title = text.get(spec.title) || title;
title = title.replace('${primary_key}', entity_name);
}
@ -1203,7 +1191,7 @@ IPA.cert.certs_widget = function(spec) {
var sn = row.widget.certificate.serial_number;
var message = text.get('@i18n:actions.delete_confirm');
message = message.replace('${object}',
text.get('@i18n:objects.cert.delete_cert_end') + sn);
text.get('@i18n:objects.cert.delete_cert_end') + ' ' + sn);
return message;
};

View File

@ -580,8 +580,10 @@ class i18n_messages(Command):
"fingerprints": _("Fingerprints"),
"get_certificate": _("Get Certificate"),
"hold_removed": _("Certificate Hold Removed"),
"issue_certificate": _("Issue New Certificate for ${entity} ${primary_key}"),
"issue_certificate_generic": _("Issue New Certificate"),
"issue_for_user": _(
"Issue new certificate for user '${primary_key}'"
),
"issue_certificate_generic": _("Issue new certificate"),
"issued_by": _("Issued By"),
"issued_on": _("Issued On"),
"issued_to": _("Issued To"),
@ -595,17 +597,15 @@ class i18n_messages(Command):
"present": _("${count} certificate(s) present"),
"privilege_withdrawn": _("Privilege Withdrawn"),
"reason": _("Reason for Revocation"),
"remove_hold": _("Remove Hold"),
"remove_certificate_hold": _("Remove Certificate Hold for ${entity} ${primary_key}"),
"remove_certificate_hold_simple": _("Remove Certificate Hold"),
"remove_hold": _("Remove hold"),
"remove_certificate_hold_simple": _("Remove certificate hold"),
"remove_certificate_hold_confirmation": _("Do you want to remove the certificate hold?"),
"remove_from_crl": _("Remove from CRL"),
"request_message": _("<ol> <li>Create a certificate database or use an existing one. To create a new database:<br/> <code># certutil -N -d &lt;database path&gt;</code> </li> <li>Create a CSR with subject <em>CN=&lt;${cn_name}&gt;,O=&lt;realm&gt;</em>, for example:<br/> <code># certutil -R -d &lt;database path&gt; -a -g &lt;key size&gt; -s 'CN=${cn},O=${realm}'${san}</code> </li> <li> Copy and paste the CSR (from <em>-----BEGIN NEW CERTIFICATE REQUEST-----</em> to <em>-----END NEW CERTIFICATE REQUEST-----</em>) into the text area below: </li> </ol>"),
"request_message_san": _(" -8 '${cn}'"),
"requested": _("Certificate requested"),
"revocation_reason": _("Revocation reason"),
"revoke_certificate": _("Revoke Certificate for ${entity} ${primary_key}"),
"revoke_certificate_simple": _("Revoke Certificate"),
"revoke_certificate_simple": _("Revoke certificate"),
"revoke_confirmation": _("Do you want to revoke this certificate? Select a reason from the pull-down list."),
"revoked": _("Certificate Revoked"),
"revoked_status": _("REVOKED"),