mirror of
https://github.com/django/django.git
synced 2025-07-04 01:39:20 +00:00
i18n: corrected sublanguage handling (de-de now mapps to de, if de-de isn't present) in django.utils.translation
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@841 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
ef9207b661
commit
7ed4073335
@ -282,6 +282,11 @@ def get_language_from_request(request):
|
||||
if lang == 'en' or os.path.isfile(os.path.join(globalpath, lang, 'LC_MESSAGES', 'django.mo')):
|
||||
_accepted[accept] = lang
|
||||
return lang
|
||||
elif lang.find('-') >= 0:
|
||||
(lang, sublang) = lang.split('-', 1)
|
||||
if lang == 'en' or os.path.isfile(os.path.join(globalpath, lang, 'LC_MESSAGES', 'django.mo')):
|
||||
_accepted[accept] = lang
|
||||
return lang
|
||||
|
||||
return settings.LANGUAGE_CODE
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user