mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
* Allow to combine language variant with region (fixes #3947, Z#23220951) This only affects babel-based formatting (currently: currencies and phone numbers), **not** Django-based formatting (currently: date and time formats). * Remove tests where I don'T actually know whats right * Fix lookup order
This commit is contained in:
@@ -48,7 +48,7 @@ from django.utils.timezone import now
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django_scopes import scopes_disabled
|
||||
|
||||
from pretix.base.i18n import get_language_without_region
|
||||
from pretix.base.i18n import get_language_without_region, set_region
|
||||
from pretix.base.middleware import get_supported_language
|
||||
from pretix.base.models import (
|
||||
CartPosition, Customer, InvoiceAddress, ItemAddOn, OrderFee, Question,
|
||||
@@ -544,6 +544,7 @@ def iframe_entry_view_wrapper(view_func):
|
||||
region = request.event.settings.region
|
||||
if '-' not in lng and region:
|
||||
lng += '-' + region.lower()
|
||||
set_region(region)
|
||||
|
||||
# with language() is not good enough here – we really need to take the role of LocaleMiddleware and modify
|
||||
# global state, because template rendering might be happening lazily.
|
||||
|
||||
Reference in New Issue
Block a user