Django

Code

Changeset 875

Show
Ignore:
Timestamp:
10/14/05 18:47:35 (3 years ago)
Author:
hugo
Message:

i18n: fixed a bug with Python 2.3 support (double encoding of stuff)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/i18n/django/utils/translation.py

    r851 r875  
    7777 
    7878    def gettext(self, msgid): 
    79         res = DjangoTranslation.gettext(self, msgid) 
    80         if self.charset() != self.django_output_charset: 
    81             res = res.decode(self.charset()).encode(self.django_output_charset) 
    82         return res 
     79        res = self.ugettext(msgid) 
     80        return res.encode(self.django_output_charset) 
    8381 
    8482    def ngettext(self, msgid1, msgid2, n): 
    85         res = DjangoTranslation.ngettext(self, msgid1, msgid2, n) 
    86         if self.charset() != self.django_output_charset: 
    87             res = res.decode(self.charset()).encode(self.django_output_charset) 
    88         return res 
     83        res = self.ungettext(msgid1, msgid2, n) 
     84        return res.encode(self.django_output_charset) 
    8985 
    9086def translation(appname, language):