Django

Code

Changeset 788

Show
Ignore:
Timestamp:
10/06/05 05:07:45 (3 years ago)
Author:
hugo
Message:

i18n: added support for the new DEFAULT_CHARSET setting in translators

Files:

Legend:

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

    r769 r788  
    3333    """ 
    3434    This class sets up the GNUTranslations context with 
    35     regard to output charset. Django allways uses utf-8 
    36     as the output charset. 
     35    regard to output charset. Django uses a defined 
     36    DEFAULT_CHARSET as the output charset. 
    3737    """ 
    3838 
    3939    def __init__(self, *args, **kw): 
     40        from django.conf import settings 
    4041        gettext_module.GNUTranslations.__init__(self, *args, **kw) 
    4142        self.__charset = self.charset() 
    42         self.set_output_charset('utf-8'
     43        self.set_output_charset(settings.DEFAULT_CHARSET
    4344        self.__app = '?.?.?' 
    4445        self.__language = '??' 
  • django/branches/i18n/docs/translation.txt

    r770 r788  
    305305 
    306306Another speciality is that we only use gettext and gettext_noop - that's 
    307 because django uses allways utf-8 strings internally. There isn't much use 
    308 in using ugettext or something like that, as you allways will need to produce 
    309 utf-8 anyway. 
     307because django uses allways DEFAULT_CHARSET strings internally. There isn't 
     308much use in using ugettext or something like that, as you allways will need to 
     309produce utf-8 anyway. 
    310310 
    311311And last we don't use xgettext alone and some makefiles but use python