fnp
/
fnpdjango.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix
[fnpdjango.git]
/
fnpdjango
/
utils
/
settings.py
diff --git
a/fnpdjango/utils/settings.py
b/fnpdjango/utils/settings.py
index
43f49ec
..
b6df2b3
100644
(file)
--- a/
fnpdjango/utils/settings.py
+++ b/
fnpdjango/utils/settings.py
@@
-1,19
+1,10
@@
"""
Utilities for global settings.
"""
"""
Utilities for global settings.
"""
-from django.utils.
encoding import python_2_unicode_compatibl
e
+from django.utils.
functional import Promis
e
-# Use Python3 str.
-try:
- unicode
-except NameError:
- pass
-else:
- str = unicode
-
-@python_2_unicode_compatible
-class LazyUGettextLazy(object):
+class LazyUGettextLazy(Promise):
"""You can use it to internationalize strings in settings.
Just import this class as gettext.
"""You can use it to internationalize strings in settings.
Just import this class as gettext.
@@
-26,8
+17,8
@@
class LazyUGettextLazy(object):
def __str__(self):
if not self.real:
def __str__(self):
if not self.real:
- from django.utils.translation import
u
gettext_lazy
- LazyUGettextLazy._ = staticmethod(
u
gettext_lazy)
+ from django.utils.translation import gettext_lazy
+ LazyUGettextLazy._ = staticmethod(gettext_lazy)
LazyUGettextLazy.real = True
return str(self._(self.text))
LazyUGettextLazy.real = True
return str(self._(self.text))