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 --- ipalib/rpc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ipalib/rpc.py') diff --git a/ipalib/rpc.py b/ipalib/rpc.py index a22fae505..d1764e3e3 100644 --- a/ipalib/rpc.py +++ b/ipalib/rpc.py @@ -49,6 +49,7 @@ from ipalib.request import context, Connection from ipalib.util import get_current_principal from ipapython import ipautil from ipapython import kernel_keyring +from ipalib.text import _ import httplib import socket @@ -484,7 +485,8 @@ class xmlclient(Connectible): serverproxy = None if serverproxy is None: - raise NetworkError(uri='any of the configured servers', error=', '.join(servers)) + raise NetworkError(uri=_('any of the configured servers'), + error=', '.join(servers)) return serverproxy def destroy_connection(self): -- cgit