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:
@@ -73,6 +73,7 @@ class LanguageMiddleware(BaseHTTPMiddleware):
|
||||
language = resolve_store_dashboard_language(
|
||||
user_preferred=user_preferred,
|
||||
store_dashboard=store_dashboard,
|
||||
cookie_language=cookie_language,
|
||||
)
|
||||
|
||||
elif frontend_type == FrontendType.STOREFRONT:
|
||||
@@ -170,6 +171,7 @@ def set_language_cookie(response: Response, language: str) -> Response:
|
||||
max_age=60 * 60 * 24 * 365, # 1 year
|
||||
httponly=False, # Accessible to JavaScript
|
||||
samesite="lax",
|
||||
path="/",
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -184,5 +186,5 @@ def delete_language_cookie(response: Response) -> Response:
|
||||
Returns:
|
||||
Modified response with cookie deleted
|
||||
"""
|
||||
response.delete_cookie(key=LANGUAGE_COOKIE_NAME)
|
||||
response.delete_cookie(key=LANGUAGE_COOKIE_NAME, path="/")
|
||||
return response
|
||||
|
||||
Reference in New Issue
Block a user