@@ -60,7 +60,7 @@ class DjangoTranslation(gettext_module.GNUTranslations):
60
60
"""
61
61
This class sets up the GNUTranslations context with regard to output
62
62
charset. Django uses a defined DEFAULT_CHARSET as the output charset on
63
- Python 2.4. With Python 2.3, use DjangoTranslation23.
63
+ Python 2.4.
64
64
"""
65
65
def __init__ (self , * args , ** kw ):
66
66
from django .conf import settings
@@ -87,23 +87,6 @@ def language(self):
87
87
def __repr__ (self ):
88
88
return "<DjangoTranslation lang:%s>" % self .__language
89
89
90
- class DjangoTranslation23 (DjangoTranslation ):
91
- """
92
- Compatibility class that is only used with Python 2.3.
93
- Python 2.3 doesn't support set_output_charset on translation objects and
94
- needs this wrapper class to make sure input charsets from translation files
95
- are correctly translated to output charsets.
96
-
97
- With a full switch to Python 2.4, this can be removed from the source.
98
- """
99
- def gettext (self , msgid ):
100
- res = self .ugettext (msgid )
101
- return res .encode (self .django_output_charset )
102
-
103
- def ngettext (self , msgid1 , msgid2 , n ):
104
- res = self .ungettext (msgid1 , msgid2 , n )
105
- return res .encode (self .django_output_charset )
106
-
107
90
def translation (language ):
108
91
"""
109
92
Returns a translation object.
@@ -121,11 +104,6 @@ def translation(language):
121
104
122
105
from django .conf import settings
123
106
124
- # set up the right translation class
125
- klass = DjangoTranslation
126
- if sys .version_info < (2 , 4 ):
127
- klass = DjangoTranslation23
128
-
129
107
globalpath = os .path .join (os .path .dirname (sys .modules [settings .__module__ ].__file__ ), 'locale' )
130
108
131
109
if settings .SETTINGS_MODULE is not None :
@@ -147,7 +125,7 @@ def _fetch(lang, fallback=None):
147
125
148
126
def _translation (path ):
149
127
try :
150
- t = gettext_module .translation ('django' , path , [loc ], klass )
128
+ t = gettext_module .translation ('django' , path , [loc ], DjangoTranslation )
151
129
t .set_language (lang )
152
130
return t
153
131
except IOError , e :
0 commit comments