From 220f7e3a0886ebfbf4c662b07bb49471345c5102 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Sun, 19 Apr 2026 19:58:03 +0200 Subject: [PATCH] fix(loyalty): replace $t() with server-side _() in program-view Convert 6 client-side $t() calls to server-rendered _() in the shared program-view template to eliminate i18n timing warnings. Uses .replace() for dynamic parameters (count, days). Fixes warnings: loyalty.common.active, inactive, none, never, loyalty.shared.program_view.x_points, x_days_inactivity, x_minutes. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../templates/loyalty/shared/program-view.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/modules/loyalty/templates/loyalty/shared/program-view.html b/app/modules/loyalty/templates/loyalty/shared/program-view.html index f87dc9b5..67abdfc5 100644 --- a/app/modules/loyalty/templates/loyalty/shared/program-view.html +++ b/app/modules/loyalty/templates/loyalty/shared/program-view.html @@ -28,7 +28,7 @@ x-text="program?.loyalty_type || 'unknown'"> - + {% if show_edit_button is not defined or show_edit_button %}

{{ _('loyalty.shared.program_view.welcome_bonus') }}

-

+ x-text="program?.welcome_bonus_points ? '{{ _('loyalty.shared.program_view.x_points') }}'.replace('{count}', program.welcome_bonus_points) : '{{ _('loyalty.common.none') }}'">-

{{ _('loyalty.shared.program_view.minimum_redemption') }}

-

+ x-text="program?.minimum_redemption_points ? '{{ _('loyalty.shared.program_view.x_points') }}'.replace('{count}', program.minimum_redemption_points) : '{{ _('loyalty.common.none') }}'">-

{{ _('loyalty.shared.program_view.minimum_purchase') }}

-

+ x-text="program?.minimum_purchase_cents ? '€' + (program.minimum_purchase_cents / 100).toFixed(2) : '{{ _('loyalty.common.none') }}'">-

{{ _('loyalty.shared.program_view.points_expiration') }}

-

+ x-text="program?.points_expiration_days ? '{{ _('loyalty.shared.program_view.x_days_inactivity') }}'.replace('{days}', program.points_expiration_days) : '{{ _('loyalty.common.never') }}'">-

@@ -153,7 +153,7 @@

{{ _('loyalty.shared.program_view.cooldown') }}

-

+ x-text="program?.cooldown_minutes ? '{{ _('loyalty.shared.program_view.x_minutes') }}'.replace('{count}', program.cooldown_minutes) : '{{ _('loyalty.common.none') }}'">-

{{ _('loyalty.shared.program_view.max_daily_stamps') }}