summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-05 12:45:08 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-14 17:50:04 +0100
commit52a238ddf2ceb5211daa2ab23c626473685729b5 (patch)
tree86e5c395fe022ad89faf7ed3e815a77d7606838d /django/utils
parent810f037b29402f848a766f6900b4ebfbaf64cc88 (diff)
Refs #30165 -- Removed ugettext(), ugettext_lazy(), ugettext_noop(), ungettext(), and ungettext_lazy() per deprecation timeline.
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/translation/__init__.py69
1 files changed, 0 insertions, 69 deletions
diff --git a/django/utils/translation/__init__.py b/django/utils/translation/__init__.py
index 0dd2503cee..8e6b8ec0f8 100644
--- a/django/utils/translation/__init__.py
+++ b/django/utils/translation/__init__.py
@@ -1,12 +1,10 @@
"""
Internationalization support.
"""
-import warnings
from contextlib import ContextDecorator
from decimal import ROUND_UP, Decimal
from django.utils.autoreload import autoreload_started, file_changed
-from django.utils.deprecation import RemovedInDjango40Warning
from django.utils.functional import lazy
from django.utils.regex_helper import _lazy_re_compile
@@ -16,9 +14,7 @@ __all__ = [
'get_language_info', 'get_language_bidi',
'check_for_language', 'to_language', 'to_locale', 'templatize',
'gettext', 'gettext_lazy', 'gettext_noop',
- 'ugettext', 'ugettext_lazy', 'ugettext_noop',
'ngettext', 'ngettext_lazy',
- 'ungettext', 'ungettext_lazy',
'pgettext', 'pgettext_lazy',
'npgettext', 'npgettext_lazy',
'LANGUAGE_SESSION_KEY',
@@ -77,53 +73,14 @@ def gettext_noop(message):
return _trans.gettext_noop(message)
-def ugettext_noop(message):
- """
- A legacy compatibility wrapper for Unicode handling on Python 2.
- Alias of gettext_noop() since Django 2.0.
- """
- warnings.warn(
- 'django.utils.translation.ugettext_noop() is deprecated in favor of '
- 'django.utils.translation.gettext_noop().',
- RemovedInDjango40Warning, stacklevel=2,
- )
- return gettext_noop(message)
-
-
def gettext(message):
return _trans.gettext(message)
-def ugettext(message):
- """
- A legacy compatibility wrapper for Unicode handling on Python 2.
- Alias of gettext() since Django 2.0.
- """
- warnings.warn(
- 'django.utils.translation.ugettext() is deprecated in favor of '
- 'django.utils.translation.gettext().',
- RemovedInDjango40Warning, stacklevel=2,
- )
- return gettext(message)
-
-
def ngettext(singular, plural, number):
return _trans.ngettext(singular, plural, number)
-def ungettext(singular, plural, number):
- """
- A legacy compatibility wrapper for Unicode handling on Python 2.
- Alias of ngettext() since Django 2.0.
- """
- warnings.warn(
- 'django.utils.translation.ungettext() is deprecated in favor of '
- 'django.utils.translation.ngettext().',
- RemovedInDjango40Warning, stacklevel=2,
- )
- return ngettext(singular, plural, number)
-
-
def pgettext(context, message):
return _trans.pgettext(context, message)
@@ -136,19 +93,6 @@ gettext_lazy = lazy(gettext, str)
pgettext_lazy = lazy(pgettext, str)
-def ugettext_lazy(message):
- """
- A legacy compatibility wrapper for Unicode handling on Python 2. Has been
- Alias of gettext_lazy since Django 2.0.
- """
- warnings.warn(
- 'django.utils.translation.ugettext_lazy() is deprecated in favor of '
- 'django.utils.translation.gettext_lazy().',
- RemovedInDjango40Warning, stacklevel=2,
- )
- return gettext_lazy(message)
-
-
def lazy_number(func, resultclass, number=None, **kwargs):
if isinstance(number, int):
kwargs['number'] = number
@@ -204,19 +148,6 @@ def ngettext_lazy(singular, plural, number=None):
return lazy_number(ngettext, str, singular=singular, plural=plural, number=number)
-def ungettext_lazy(singular, plural, number=None):
- """
- A legacy compatibility wrapper for Unicode handling on Python 2.
- An alias of ungettext_lazy() since Django 2.0.
- """
- warnings.warn(
- 'django.utils.translation.ungettext_lazy() is deprecated in favor of '
- 'django.utils.translation.ngettext_lazy().',
- RemovedInDjango40Warning, stacklevel=2,
- )
- return ngettext_lazy(singular, plural, number)
-
-
def npgettext_lazy(context, singular, plural, number=None):
return lazy_number(npgettext, str, context=context, singular=singular, plural=plural, number=number)