mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
i18n: fixed a bug with Python 2.3 support (double encoding of stuff)
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@875 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
cde24debb7
commit
e02e1e4f49
@ -76,16 +76,12 @@ class DjangoTranslation23(DjangoTranslation):
|
||||
"""
|
||||
|
||||
def gettext(self, msgid):
|
||||
res = DjangoTranslation.gettext(self, msgid)
|
||||
if self.charset() != self.django_output_charset:
|
||||
res = res.decode(self.charset()).encode(self.django_output_charset)
|
||||
return res
|
||||
res = self.ugettext(msgid)
|
||||
return res.encode(self.django_output_charset)
|
||||
|
||||
def ngettext(self, msgid1, msgid2, n):
|
||||
res = DjangoTranslation.ngettext(self, msgid1, msgid2, n)
|
||||
if self.charset() != self.django_output_charset:
|
||||
res = res.decode(self.charset()).encode(self.django_output_charset)
|
||||
return res
|
||||
res = self.ungettext(msgid1, msgid2, n)
|
||||
return res.encode(self.django_output_charset)
|
||||
|
||||
def translation(appname, language):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user