fix(loyalty): terminal icons, server-side i18n, category in transactions
Some checks failed
CI / ruff (push) Successful in 22s
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

- Fix icons: plus-circle → plus, backspace → arrow-left
- Convert terminal $t() calls to server-side _() for card_label,
  stamps_until_reward, reward_label, not_enough_stamps
- Inject transaction type labels as server-rendered window._txLabels
  object (eliminates all async i18n warnings on terminal page)
- Resolve category_names in store transactions list endpoint

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-19 22:20:52 +02:00
parent 29593f4c61
commit 39e02f0d9b
3 changed files with 37 additions and 8 deletions

View File

@@ -369,9 +369,11 @@ function storeLoyaltyTerminal() {
getTransactionLabel(tx) {
const type = tx.transaction_type;
if (type) {
return I18n.t('loyalty.transactions.' + type, {defaultValue: type.replace(/_/g, ' ')});
// Use server-rendered labels (no async flicker)
if (window._txLabels && window._txLabels[type]) return window._txLabels[type];
return type.replace(/_/g, ' ');
}
return I18n.t('loyalty.common.unknown');
return 'Unknown';
},
getTransactionColor(tx) {