Files
orion/static
Samir Boulahtit dd1f9af811
Some checks failed
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
CI / pytest (push) Has started running
fix(i18n): locale-aware date/number formatting in loyalty factories
Dates rendered in English even when the dashboard language was set to
French (or any other locale). The 5 shared loyalty Alpine factories
hardcoded 'en-US' in every toLocaleDateString / toLocaleString /
Intl.NumberFormat call, ignoring the user's selected language.

- Add `I18n.locale` getter to static/shared/js/i18n.js that returns
  the current dashboard language code (en/fr/de/lb). Falls back to
  'en' if I18n isn't initialised yet.
- Replace 'en-US' with I18n.locale in 5 loyalty shared factories:
  loyalty-cards-list, loyalty-card-detail-view, loyalty-transactions-
  list, loyalty-pins-list, loyalty-devices-list.
- Also fix a latent bug in loyalty-transactions-list.formatDateTime
  that called toLocaleDateString with hour/minute opts (silently
  ignored — same bug previously fixed in loyalty-card-detail-view).

Scoped to loyalty per session decision; other modules with the same
hardcoded 'en-US' pattern (catalog, billing, etc.) are tracked as a
follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 23:03:03 +02:00
..