diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-06-30 14:33:33 -0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-06-30 14:50:09 -0400 |
commit | 2a527234656a08342259ebc30af38b68a592ba8a (patch) | |
tree | bc51d3040bddff6fb4705a3630cafd20ecbc8541 /install/ui/certificate.js | |
parent | d70ba68401b21cf3e46b0f9ff7005ddd77cefd80 (diff) | |
download | freeipa-2a527234656a08342259ebc30af38b68a592ba8a.tar.gz freeipa-2a527234656a08342259ebc30af38b68a592ba8a.tar.xz freeipa-2a527234656a08342259ebc30af38b68a592ba8a.zip |
Fixed hard-coded messages.
Hard-coded messages in the UI have been replaced with I18n messages.
Ticket #1396
Diffstat (limited to 'install/ui/certificate.js')
-rwxr-xr-x | install/ui/certificate.js | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/install/ui/certificate.js b/install/ui/certificate.js index 64d93f9bd..bfecfc5b4 100755 --- a/install/ui/certificate.js +++ b/install/ui/certificate.js @@ -33,17 +33,17 @@ IPA.cert.CERTIFICATE_STATUS_VALID = 1; IPA.cert.CERTIFICATE_STATUS_REVOKED = 2; IPA.cert.CRL_REASON = [ - 'Unspecified', - 'Key Compromise', - 'CA Compromise', - 'Affiliation Changed', - 'Superseded', - 'Cessation of Operation', - 'Certificate Hold', + 'unspecified', + 'key_compromise', + 'ca_compromise', + 'affiliation_changed', + 'superseded', + 'cessation_of_operation', + 'certificate_hold', null, - 'Remove from CRL', - 'Privilege Withdrawn', - 'AA Compromise' + 'remove_from_crl', + 'privilege_withdrawn', + 'aa_compromise' ]; IPA.cert.parse_dn = function(dn) { @@ -155,10 +155,11 @@ IPA.cert.revoke_dialog = function(spec) { that.select = $('<select/>').appendTo(td); for (var i=0; i<IPA.cert.CRL_REASON.length; i++) { - if (!IPA.cert.CRL_REASON[i]) continue; + var reason = IPA.cert.CRL_REASON[i]; + if (!reason) continue; $('<option/>', { 'value': i, - 'html': IPA.cert.CRL_REASON[i] + 'html': IPA.messages.objects.cert[reason] }).appendTo(that.select); } }; @@ -616,8 +617,10 @@ IPA.cert.status_widget = function(spec) { if (!that.is_selfsign()) { that.status_revoked.css('display', status == IPA.cert.CERTIFICATE_STATUS_REVOKED ? 'inline' : 'none'); that.revoke_button.css('display', status == IPA.cert.CERTIFICATE_STATUS_VALID ? 'inline' : 'none'); - that.revocation_reason.html(revocation_reason == undefined ? '' : IPA.cert.CRL_REASON[revocation_reason]); - that.restore_button.css('display', revocation_reason == 6 ? 'inline' : 'none'); + + var reason = IPA.cert.CRL_REASON[revocation_reason]; + that.revocation_reason.html(revocation_reason === undefined || reason === null ? '' : IPA.messages.objects.cert[reason]); + that.restore_button.css('display', reason == 'certificate_hold' ? 'inline' : 'none'); } } |