"""
Utilities for global settings.
"""
-from django.utils.encoding import python_2_unicode_compatible
from django.utils.functional import Promise
-# Use Python3 str.
-try:
- unicode
-except NameError:
- pass
-else:
- str = unicode
-
-@python_2_unicode_compatible
class LazyUGettextLazy(Promise):
"""You can use it to internationalize strings in settings.
def __str__(self):
if not self.real:
- from django.utils.translation import ugettext_lazy
- LazyUGettextLazy._ = staticmethod(ugettext_lazy)
+ from django.utils.translation import gettext_lazy
+ LazyUGettextLazy._ = staticmethod(gettext_lazy)
LazyUGettextLazy.real = True
return str(self._(self.text))