fix(storefront): i18n sweep + locale-aware reset-password and welcome email
Some checks failed
CI / ruff (push) Successful in 19s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled

Test 5 (storefront password reset + customer dashboard) surfaced five
issues that all traced back to missing i18n plumbing:

- Forgot-password email arrived in EN regardless of storefront locale —
  handler now prefers request.state.language over customer.preferred_language,
  and loyalty self-enrollment backfills preferred_language for new + returning
  customers so future locale-sensitive flows hit the right language without
  being told twice.
- reset-password.html rendered "undefined" icon boxes because $icon magic
  wasn't loaded in the standalone page — replaced with inline SVGs matching
  the forgot-password.html convention.
- reset-password.html was hardcoded English: added lang attr, full _()
  sweep (22 new auth.* keys × 4 locales), language selector, and JS
  validation strings exposed via tojson.
- "Continue shopping" CTA renamed to "Back to Home" (auth.back_to_home,
  4 locales) on login + forgot + reset — loyalty storefronts have no
  catalog to continue to, mirroring the earlier enroll-success rename.
- /account dashboard, profile, addresses were hardcoded English in the
  body (menu was FR because base layout uses _()). New customers.storefront
  .pages.{dashboard,profile,addresses}.* namespace (~80 keys × 4 locales),
  templates updated, Alpine JS strings injected via window.__*I18n.

18 files, 18 changed; arch validation: 126 warnings before = 126 after,
mkdocs --strict clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-28 23:06:11 +02:00
parent f04cbb8ca2
commit 10a99f98fe
18 changed files with 722 additions and 162 deletions

View File

@@ -123,7 +123,7 @@
"visit_platform": "Besicht eis Plattform",
"already_have_account": "Hutt Dir schonn e Kont?",
"create_account": "E Kont erstellen",
"continue_shopping": "Weider akafen",
"back_to_home": "Zréck op d'Haaptsäit",
"admin_login": "Admin Login",
"merchant_login": "Händler Login",
"store_login": "Buttek-Portal Login",
@@ -140,7 +140,27 @@
"reset_link_sent": "Mir hunn e Link fir d'Passwuert zréckzesetzen op Är E-Mail-Adress geschéckt. Kuckt w.e.g. Ären Posteingang a klickt op de Link.",
"didnt_receive_email": "E-Mail net kritt? Kuckt Ären Spam-Dossier oder",
"try_again": "probéiert et nach eng Kéier",
"remember_password": "Passwuert erëm agefall?"
"remember_password": "Passwuert erëm agefall?",
"reset_password_subtitle": "Neit Passwuert erstellen",
"reset_your_password": "Ärt Passwuert zrécksetzen",
"reset_password_form_desc": "Gitt hei drënner Ärt neit Passwuert an. Et muss mindestens 8 Zeechen laang sinn.",
"new_password_placeholder": "Neit Passwuert agi",
"confirm_password_placeholder": "Neit Passwuert bestätegen",
"resetting": "Gëtt zréckgesat...",
"reset_password_btn": "Passwuert zrécksetzen",
"password_reset_complete": "Passwuert zréckgesat",
"password_reset_success_desc": "Ärt Passwuert ass erfollegräich zréckgesat. Dir kënnt Iech elo mat Ärem neie Passwuert aloggen.",
"invalid_or_expired_link": "Ongëltege oder ofgelafenen Link",
"invalid_or_expired_link_desc": "Dëse Link fir d'Passwuert zréckzesetzen ass ongëlteg oder ofgelaf. Bitt e neie Link un.",
"request_new_link": "Neie Link ufroen",
"email_required": "E-Mail ass obligatoresch",
"invalid_email": "Gitt w.e.g. eng gëlteg E-Mail-Adress un",
"forgot_password_failed": "Link konnt net geschéckt ginn. Probéiert nach eng Kéier.",
"password_required": "Passwuert ass obligatoresch",
"password_too_short": "D'Passwuert muss mindestens 8 Zeechen hunn",
"please_confirm_password": "Bestätegt w.e.g. Ärt Passwuert",
"passwords_do_not_match": "D'Passwierder stëmmen net iwwerteneen",
"reset_password_failed": "Passwuert konnt net zréckgesat ginn. Probéiert nach eng Kéier."
},
"nav": {
"dashboard": "Dashboard",