diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-07-21 10:00:10 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-08-07 12:00:22 +0200 |
| commit | c5ef65bcf324f4c90b53be90f4aec069a68e8c59 (patch) | |
| tree | bb9a4988fbae4e7366cc578ca845c49003cdcd64 /django/utils/translation/trans_null.py | |
| parent | ee191715eae73362768184aa95206cf61bac5d38 (diff) | |
[py3] Ported django.utils.encoding.
* Renamed smart_unicode to smart_text (but kept the old name under
Python 2 for backwards compatibility).
* Renamed smart_str to smart_bytes.
* Re-introduced smart_str as an alias for smart_text under Python 3
and smart_bytes under Python 2 (which is backwards compatible).
Thus smart_str always returns a str objects.
* Used the new smart_str in a few places where both Python 2 and 3
want a str.
Diffstat (limited to 'django/utils/translation/trans_null.py')
| -rw-r--r-- | django/utils/translation/trans_null.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/utils/translation/trans_null.py b/django/utils/translation/trans_null.py index 0fabc707ce..5c51468204 100644 --- a/django/utils/translation/trans_null.py +++ b/django/utils/translation/trans_null.py @@ -3,7 +3,7 @@ # settings.USE_I18N = False can use this module rather than trans_real.py. from django.conf import settings -from django.utils.encoding import force_unicode +from django.utils.encoding import force_text from django.utils.safestring import mark_safe, SafeData def ngettext(singular, plural, number): @@ -12,7 +12,7 @@ def ngettext(singular, plural, number): ngettext_lazy = ngettext def ungettext(singular, plural, number): - return force_unicode(ngettext(singular, plural, number)) + return force_text(ngettext(singular, plural, number)) def pgettext(context, message): return ugettext(message) @@ -44,7 +44,7 @@ def gettext(message): return result def ugettext(message): - return force_unicode(gettext(message)) + return force_text(gettext(message)) gettext_noop = gettext_lazy = _ = gettext |
