diff options
Diffstat (limited to 'ipalib/request.py')
-rw-r--r-- | ipalib/request.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ipalib/request.py b/ipalib/request.py index ea028239..5a07d4db 100644 --- a/ipalib/request.py +++ b/ipalib/request.py @@ -32,6 +32,12 @@ from constants import OVERRIDE_ERROR context = threading.local() +def _(message): + if hasattr(context, 'gettext'): + return context.gettext(message) + return message.decode('UTF-8') + + def set_languages(*languages): if hasattr(context, 'languages'): raise StandardError(OVERRIDE_ERROR % |