mirror of
https://github.com/django/django.git
synced 2025-11-12 16:47:49 +00:00
Fixed #24063 -- Allowed locale variants supported by gettext.
The locale code can contain a variant after @, so allowed that.
This commit is contained in:
parent
9d6914da66
commit
76d26d8922
3 changed files with 18 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue