diff options
| author | Georg Bauer <gb@hugo.westfalen.de> | 2005-10-18 17:50:08 +0000 |
|---|---|---|
| committer | Georg Bauer <gb@hugo.westfalen.de> | 2005-10-18 17:50:08 +0000 |
| commit | 2c723003e0657d6dd5172cfccb76a34a77fe4771 (patch) | |
| tree | 36b1a707cf4f9ad6fe2ae4e0d3684dbc9aded472 /django | |
| parent | c1d84946406e00d8cd6e27988a25023590fbaa79 (diff) | |
i18n: django-admin.py forces english translation because of it's generated SQL stuff (like permission names)
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@943 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rwxr-xr-x | django/bin/django-admin.py | 6 | ||||
| -rw-r--r-- | django/utils/translation.py | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/django/bin/django-admin.py b/django/bin/django-admin.py index 0d021ba172..e9e72a9b73 100755 --- a/django/bin/django-admin.py +++ b/django/bin/django-admin.py @@ -1,8 +1,13 @@ #!/usr/bin/env python from django.core import management +from django.utils import translation from optparse import OptionParser import os, sys +# switch to english, because django-admin creates database content +# like permissions, and those shouldn't contain any translations +translation.activate('*', 'en-us') + ACTION_MAPPING = { 'adminindex': management.get_admin_index, 'createsuperuser': management.createsuperuser, @@ -128,3 +133,4 @@ def main(): if __name__ == "__main__": main() + diff --git a/django/utils/translation.py b/django/utils/translation.py index 2cd393c433..4f06053942 100644 --- a/django/utils/translation.py +++ b/django/utils/translation.py @@ -180,7 +180,10 @@ def activate(appname, language): tuple of application name and language and installs it as the current translation object for the current thread. """ - t = translation(appname, language) + if language == 'en' or language.startswith('en-'): + t = gettext_module.NullTranslations() + else: + t = translation(appname, language) _active[currentThread()] = t def deactivate(): |
