Django

Code

Changeset 943

Show
Ignore:
Timestamp:
10/18/05 12:50:08 (3 years ago)
Author:
hugo
Message:

i18n: django-admin.py forces english translation because of it's generated SQL stuff (like permission names)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/i18n/django/bin/django-admin.py

    r815 r943  
    11#!/usr/bin/env python 
    22from django.core import management 
     3from django.utils import translation 
    34from optparse import OptionParser 
    45import os, sys 
     6 
     7# switch to english, because django-admin creates database content 
     8# like permissions, and those shouldn't contain any translations 
     9translation.activate('*', 'en-us') 
    510 
    611ACTION_MAPPING = { 
     
    129134if __name__ == "__main__": 
    130135    main() 
     136 
  • django/branches/i18n/django/utils/translation.py

    r914 r943  
    181181    the current translation object for the current thread. 
    182182    """ 
    183     t = translation(appname, language) 
     183    if language == 'en' or language.startswith('en-'): 
     184        t = gettext_module.NullTranslations() 
     185    else: 
     186        t = translation(appname, language) 
    184187    _active[currentThread()] = t 
    185188