fix: language switcher stuck in French on store dashboard
Some checks failed
Some checks failed
Three compounding bugs prevented language switching on the store dashboard: - Cookie missing path="/", scoping it to the API endpoint path only - STORE frontend resolution chain ignored the cookie entirely - Store header used inline x-data with wrong language names instead of shared languageSelector() Also updates architecture doc with correct per-frontend resolution priorities, cookie name, API endpoint path, and file references. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -351,15 +351,20 @@ def get_jinja2_globals(language: str = None) -> dict:
|
||||
def resolve_store_dashboard_language(
|
||||
user_preferred: str | None,
|
||||
store_dashboard: str | None,
|
||||
cookie_language: str | None = None,
|
||||
) -> str:
|
||||
"""
|
||||
Resolve language for store dashboard.
|
||||
|
||||
Priority:
|
||||
1. User's preferred_language (if set)
|
||||
2. Store's dashboard_language
|
||||
3. System default (fr)
|
||||
1. Cookie (explicit UI action via language switcher)
|
||||
2. User's preferred_language (DB preference from profile settings)
|
||||
3. Store's dashboard_language
|
||||
4. System default (fr)
|
||||
"""
|
||||
if cookie_language and cookie_language in SUPPORTED_LANGUAGES:
|
||||
return cookie_language
|
||||
|
||||
if user_preferred and user_preferred in SUPPORTED_LANGUAGES:
|
||||
return user_preferred
|
||||
|
||||
|
||||
Reference in New Issue
Block a user