From e02e1e4f49873e6cfb45725dd082e8060f1be5df Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Fri, 14 Oct 2005 23:47:35 +0000 Subject: [PATCH] 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 --- django/utils/translation.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/django/utils/translation.py b/django/utils/translation.py index 5c648ae3c0..f3e6aedd0d 100644 --- a/django/utils/translation.py +++ b/django/utils/translation.py @@ -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): """