diff options
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/translation/trans_real.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py index a7a89f9bd5..8a2527022d 100644 --- a/django/utils/translation/trans_real.py +++ b/django/utils/translation/trans_real.py @@ -43,9 +43,12 @@ accept_language_re = re.compile(r''' (?:\s*,\s*|$) # Multiple accepts per header. ''', re.VERBOSE) -language_code_re = re.compile(r'^[a-z]{1,8}(?:-[a-z0-9]{1,8})*$', re.IGNORECASE) +language_code_re = re.compile( + r'^[a-z]{1,8}(?:-[a-z0-9]{1,8})*(?:@[a-z0-9]{1,20})?$', + re.IGNORECASE +) -language_code_prefix_re = re.compile(r'^/([\w-]+)(/|$)') +language_code_prefix_re = re.compile(r'^/([\w@-]+)(/|$)') @receiver(setting_changed) |
