summaryrefslogtreecommitdiffstats
path: root/ipalib/request.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-01-03 02:35:36 -0700
committerJason Gerard DeRose <jderose@redhat.com>2009-01-03 02:35:36 -0700
commit0d3ddef93b0a72b824297e5504e435a4427f14bd (patch)
treed72af8aea881ab84398cc37a98030957b8d9452c /ipalib/request.py
parentb32965dffe1dbd4404dd4afb63994c807e80e25c (diff)
downloadfreeipa-0d3ddef93b0a72b824297e5504e435a4427f14bd.tar.gz
freeipa-0d3ddef93b0a72b824297e5504e435a4427f14bd.tar.xz
freeipa-0d3ddef93b0a72b824297e5504e435a4427f14bd.zip
Started fleshing out reoganization of errors in errors.py (with gettext support)
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 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 %