summaryrefslogtreecommitdiffstats
path: root/ipalib/request.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/request.py')
-rw-r--r--ipalib/request.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ipalib/request.py b/ipalib/request.py
index ea028239c..5a07d4dbb 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 %