Ticket #7720: fallback_to_first_part_of_language_code_of_cookie.diff
File fallback_to_first_part_of_language_code_of_cookie.diff, 674 bytes (added by , 16 years ago) |
---|
-
django/utils/translation/trans_real.py
old new 355 355 return lang_code 356 356 357 357 lang_code = request.COOKIES.get(settings.LANGUAGE_COOKIE_NAME) 358 359 if lang_code and lang_code not in supported: 360 lang_code = lang_code[:2] # if fr-ca is not supported fallback to fr 361 358 362 if lang_code and lang_code in supported and check_for_language(lang_code): 359 363 return lang_code 360 364