mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
unicode: Fixed #4442 -- Fixed a problem with string_concat() when
USE_I18N=False. git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5390 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
8b3781cc68
commit
797c1d2a85
@ -3,7 +3,7 @@
|
|||||||
# settings.USE_I18N = False can use this module rather than trans_real.py.
|
# settings.USE_I18N = False can use this module rather than trans_real.py.
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils.encoding import smart_unicode
|
from django.utils.encoding import force_unicode
|
||||||
|
|
||||||
def ngettext(singular, plural, number):
|
def ngettext(singular, plural, number):
|
||||||
if number == 1: return singular
|
if number == 1: return singular
|
||||||
@ -11,9 +11,9 @@ def ngettext(singular, plural, number):
|
|||||||
ngettext_lazy = ngettext
|
ngettext_lazy = ngettext
|
||||||
|
|
||||||
def ungettext(singular, plural, number):
|
def ungettext(singular, plural, number):
|
||||||
return smart_unicode(ngettext(singular, plural, number))
|
return force_unicode(ngettext(singular, plural, number))
|
||||||
|
|
||||||
string_concat = lambda *strings: u''.join([smart_unicode(el) for el in strings])
|
string_concat = lambda *strings: u''.join([force_unicode(el) for el in strings])
|
||||||
activate = lambda x: None
|
activate = lambda x: None
|
||||||
deactivate = deactivate_all = install = lambda: None
|
deactivate = deactivate_all = install = lambda: None
|
||||||
get_language = lambda: settings.LANGUAGE_CODE
|
get_language = lambda: settings.LANGUAGE_CODE
|
||||||
@ -35,7 +35,7 @@ def gettext(message):
|
|||||||
return TECHNICAL_ID_MAP.get(message, message)
|
return TECHNICAL_ID_MAP.get(message, message)
|
||||||
|
|
||||||
def ugettext(message):
|
def ugettext(message):
|
||||||
return smart_unicode(gettext(message))
|
return force_unicode(gettext(message))
|
||||||
|
|
||||||
gettext_noop = gettext_lazy = _ = gettext
|
gettext_noop = gettext_lazy = _ = gettext
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user