fix(login-i18n): translate the 3 hardcoded JS toasts in customer login
Some checks failed
CI / pytest (push) Has been cancelled
CI / ruff (push) Successful in 17s
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

Three more hardcoded English strings in customers/storefront/login.html
were still bypassing i18n because they were emitted from Alpine
showAlert() calls in <script>:

- "Account created successfully! Please sign in." (post-register toast)
- "Login successful! Redirecting..." (post-login toast)
- "Invalid email or password" (login-error fallback)

Same pattern as the earlier forgot/reset-password sweep: defined
window.__customerLoginI18n with `tojson` server-rendered values, read
them once at function entry as `const i18n = ...`, and swapped each
hardcoded string for an i18n property.

Two new auth.* keys × 4 locales (registration_success_signin,
login_success_redirecting). The third reuses the existing
auth.invalid_credentials.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-29 22:41:15 +02:00
parent bbb481aad4
commit c9fe717184
5 changed files with 21 additions and 3 deletions

View File

@@ -142,6 +142,8 @@
"try_again": "réessayez",
"remember_password": "Vous vous souvenez de votre mot de passe ?",
"login_subtitle": "Heureux de vous revoir",
"registration_success_signin": "Compte créé avec succès ! Veuillez vous connecter.",
"login_success_redirecting": "Connexion réussie ! Redirection...",
"reset_password_subtitle": "Créer un nouveau mot de passe",
"reset_your_password": "Réinitialisez votre mot de passe",
"reset_password_form_desc": "Saisissez votre nouveau mot de passe ci-dessous. Il doit comporter au moins 8 caractères.",