feat: multi-module improvements across merchant, store, i18n, and customer systems
All checks were successful
All checks were successful
- Fix platform-grouped merchant sidebar menu with core items at root level - Add merchant store management (detail page, create store, team page) - Fix store settings 500 error by removing dead stripe/API tab - Move onboarding translations to module-owned locale files - Fix onboarding banner i18n with server-side rendering + context inheritance - Refactor login language selectors to use languageSelector() function (LANG-002) - Move HTTPException handling to global exception handler in merchant routes (API-003) - Add language selector to all login pages and portal headers - Fix customer module: drop order stats from customer model, add to orders module - Fix admin menu config visibility for super admin platform context - Fix storefront auth and layout issues - Add missing i18n translations for onboarding steps (en/fr/de/lb) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -398,22 +398,24 @@ def resolve_storefront_language(
|
||||
browser_language: Primary language from Accept-Language header
|
||||
enabled_languages: List of languages enabled for this storefront
|
||||
"""
|
||||
candidates = [
|
||||
customer_preferred,
|
||||
session_language,
|
||||
store_storefront,
|
||||
browser_language,
|
||||
DEFAULT_LANGUAGE,
|
||||
]
|
||||
# Explicit user choices (customer preference, session/cookie) should be
|
||||
# respected if they are valid platform languages, regardless of
|
||||
# store's enabled_languages. The store setting only constrains automatic
|
||||
# fallback (browser language, store default).
|
||||
explicit_choices = [customer_preferred, session_language]
|
||||
for lang in explicit_choices:
|
||||
if lang and lang in SUPPORTED_LANGUAGES:
|
||||
return lang
|
||||
|
||||
# Filter to enabled languages if specified
|
||||
# For automatic fallback, filter by store's enabled languages
|
||||
fallback_candidates = [store_storefront, browser_language, DEFAULT_LANGUAGE]
|
||||
if enabled_languages:
|
||||
enabled_set = set(enabled_languages)
|
||||
for lang in candidates:
|
||||
for lang in fallback_candidates:
|
||||
if lang and lang in SUPPORTED_LANGUAGES and lang in enabled_set:
|
||||
return lang
|
||||
else:
|
||||
for lang in candidates:
|
||||
for lang in fallback_candidates:
|
||||
if lang and lang in SUPPORTED_LANGUAGES:
|
||||
return lang
|
||||
|
||||
|
||||
Reference in New Issue
Block a user