mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
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
This commit is contained in:
parent
c1d8494640
commit
2c723003e0
@ -1,8 +1,13 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from django.core import management
|
from django.core import management
|
||||||
|
from django.utils import translation
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
import os, sys
|
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 = {
|
ACTION_MAPPING = {
|
||||||
'adminindex': management.get_admin_index,
|
'adminindex': management.get_admin_index,
|
||||||
'createsuperuser': management.createsuperuser,
|
'createsuperuser': management.createsuperuser,
|
||||||
@ -128,3 +133,4 @@ def main():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
@ -180,7 +180,10 @@ def activate(appname, language):
|
|||||||
tuple of application name and language and installs it as
|
tuple of application name and language and installs it as
|
||||||
the current translation object for the current thread.
|
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
|
_active[currentThread()] = t
|
||||||
|
|
||||||
def deactivate():
|
def deactivate():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user