feat(loyalty): add full i18n support for all loyalty module pages
Replace hardcoded English strings across all 22 templates, 10 JS files, and 4 locale files (en/fr/de/lb) with ~300 translation keys per language. Uses server-side _() for Jinja2 templates and I18n.t() for JS toast messages and dynamic Alpine.js expressions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -109,19 +109,19 @@ function adminLoyaltyProgramEdit() {
|
||||
);
|
||||
this.programId = response.id;
|
||||
this.isNewProgram = false;
|
||||
Utils.showToast('Program created successfully', 'success');
|
||||
Utils.showToast(I18n.t('loyalty.toasts.program_created'), 'success');
|
||||
} else {
|
||||
await apiClient.patch(
|
||||
`/admin/loyalty/programs/${this.programId}`,
|
||||
payload
|
||||
);
|
||||
Utils.showToast('Program updated successfully', 'success');
|
||||
Utils.showToast(I18n.t('loyalty.toasts.program_updated'), 'success');
|
||||
}
|
||||
|
||||
loyaltyProgramEditLog.info('Program saved');
|
||||
window.location.href = this.backUrl;
|
||||
} catch (error) {
|
||||
Utils.showToast(`Failed to save: ${error.message}`, 'error');
|
||||
Utils.showToast(I18n.t('loyalty.toasts.save_failed', {message: error.message}), 'error');
|
||||
loyaltyProgramEditLog.error('Save failed:', error);
|
||||
} finally {
|
||||
this.saving = false;
|
||||
@@ -134,11 +134,11 @@ function adminLoyaltyProgramEdit() {
|
||||
|
||||
try {
|
||||
await apiClient.delete(`/admin/loyalty/programs/${this.programId}`);
|
||||
Utils.showToast('Program deleted', 'success');
|
||||
Utils.showToast(I18n.t('loyalty.toasts.program_deleted'), 'success');
|
||||
loyaltyProgramEditLog.info('Program deleted');
|
||||
window.location.href = this.backUrl;
|
||||
} catch (error) {
|
||||
Utils.showToast(`Failed to delete: ${error.message}`, 'error');
|
||||
Utils.showToast(I18n.t('loyalty.toasts.delete_failed', {message: error.message}), 'error');
|
||||
loyaltyProgramEditLog.error('Delete failed:', error);
|
||||
} finally {
|
||||
this.deleting = false;
|
||||
|
||||
Reference in New Issue
Block a user