summaryrefslogtreecommitdiffstats
path: root/ipalib/request.py
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2011-02-02 15:37:14 -0500
committerRob Crittenden <rcritten@redhat.com>2011-03-01 10:31:36 -0500
commit6eb70ea8e2e61d20b6832a85ff4928b216f6f78c (patch)
tree0df65eb47132e4403762f83b649cbec343f52fa1 /ipalib/request.py
parent99d6e0883af6759f80ddba01cbb1d90431929bfd (diff)
downloadfreeipa-6eb70ea8e2e61d20b6832a85ff4928b216f6f78c.tar.gz
freeipa-6eb70ea8e2e61d20b6832a85ff4928b216f6f78c.tar.xz
freeipa-6eb70ea8e2e61d20b6832a85ff4928b216f6f78c.zip
Remove deprecated i18n code from ipalib/request and all references to it.
Ticket #903
Diffstat (limited to 'ipalib/request.py')
-rw-r--r--ipalib/request.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/ipalib/request.py b/ipalib/request.py
index 9a11fb9c..15b26f59 100644
--- a/ipalib/request.py
+++ b/ipalib/request.py
@@ -23,8 +23,6 @@ Per-request thread-local data.
"""
import threading
-import locale
-import gettext
from base import ReadOnly, lock
from constants import OVERRIDE_ERROR, CALLABLE_ERROR
@@ -58,41 +56,3 @@ def destroy_context():
value.disconnect()
context.__dict__.clear()
-
-def ugettext(message):
- if hasattr(context, 'ugettext'):
- return context.ugettext(message)
- return message.decode('UTF-8')
-
-
-def ungettext(singular, plural, n):
- if hasattr(context, 'ungettext'):
- return context.ungettext(singular, plural, n)
- if n == 1:
- return singular.decode('UTF-8')
- return plural.decode('UTF-8')
-
-
-def set_languages(*languages):
- if hasattr(context, 'languages'):
- raise StandardError(OVERRIDE_ERROR %
- ('context', 'languages', context.languages, languages)
- )
- if len(languages) == 0:
- languages = locale.getdefaultlocale()[:1]
- context.languages = languages
- assert type(context.languages) is tuple
-
-
-def create_translation(domain, localedir, *languages):
- if hasattr(context, 'ugettext') or hasattr(context, 'ungettext'):
- raise StandardError(
- 'create_translation() already called in thread %r' %
- threading.currentThread().getName()
- )
- set_languages(*languages)
- translation = gettext.translation(domain,
- localedir=localedir, languages=context.languages, fallback=True
- )
- context.ugettext = translation.ugettext
- context.ungettext = translation.ungettext