fix(loyalty): translate category names in transaction history
Some checks failed
Some checks failed
Category names in transaction tables now resolve to the current page language instead of always showing English. Updated: - category_service.validate_category_for_store: accepts lang param, uses get_translated_name() - Store transactions list route: passes request.state.language - Card detail transactions route: passes request.state.language - card_service.get_customer_transactions_with_store_names: accepts lang param for storefront route Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -807,6 +807,7 @@ class CardService:
|
||||
*,
|
||||
skip: int = 0,
|
||||
limit: int = 20,
|
||||
lang: str = "en",
|
||||
) -> tuple[list[dict], int]:
|
||||
"""
|
||||
Get transaction history for a card with store names resolved.
|
||||
@@ -853,7 +854,7 @@ class CardService:
|
||||
names = []
|
||||
for cid in tx.category_ids:
|
||||
name = category_service.validate_category_for_store(
|
||||
db, cid, tx.store_id or 0
|
||||
db, cid, tx.store_id or 0, lang=lang
|
||||
)
|
||||
if name:
|
||||
names.append(name)
|
||||
|
||||
Reference in New Issue
Block a user