1
0
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:
Georg Bauer 2005-10-14 23:47:35 +00:00
parent cde24debb7
commit e02e1e4f49

View File

@ -76,16 +76,12 @@ class DjangoTranslation23(DjangoTranslation):
""" """
def gettext(self, msgid): def gettext(self, msgid):
res = DjangoTranslation.gettext(self, msgid) res = self.ugettext(msgid)
if self.charset() != self.django_output_charset: return res.encode(self.django_output_charset)
res = res.decode(self.charset()).encode(self.django_output_charset)
return res
def ngettext(self, msgid1, msgid2, n): def ngettext(self, msgid1, msgid2, n):
res = DjangoTranslation.ngettext(self, msgid1, msgid2, n) res = self.ungettext(msgid1, msgid2, n)
if self.charset() != self.django_output_charset: return res.encode(self.django_output_charset)
res = res.decode(self.charset()).encode(self.django_output_charset)
return res
def translation(appname, language): def translation(appname, language):
""" """