From a95eaeac8e07b8ccd173b0f408575cc9a0d508fc Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 4 Jul 2012 08:52:47 -0400 Subject: Internationalization for public errors Currently, we throw many public exceptions without proper i18n. Wrap natural-language error messages in _() so they can be translated. In the service plugin, raise NotFound errors using handle_not_found helper so the error message contains the offending service. Use ScriptError instead of NotFoundError in bindinstance install. https://fedorahosted.org/freeipa/ticket/1953 --- ipaserver/plugins/selfsign.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ipaserver/plugins/selfsign.py') diff --git a/ipaserver/plugins/selfsign.py b/ipaserver/plugins/selfsign.py index bd79f718..8118d88c 100644 --- a/ipaserver/plugins/selfsign.py +++ b/ipaserver/plugins/selfsign.py @@ -208,7 +208,8 @@ class ra(rabase.rabase): serial = x509.get_serial_number(cert) except NSPRError, e: self.log.error('Unable to decode certificate in entry: %s' % str(e)) - raise errors.CertificateOperationError(error='Unable to decode certificate in entry: %s' % str(e)) + raise errors.CertificateOperationError( + error=_('Unable to decode certificate in entry: %s') % str(e)) # To make it look like dogtag return just the base64 data. cert = cert.replace('\n','') -- cgit