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:
@@ -87,10 +87,10 @@ function loyaltySettings() {
|
||||
let response;
|
||||
if (this.isNewProgram) {
|
||||
response = await apiClient.post('/store/loyalty/program', payload);
|
||||
Utils.showToast('Program created successfully', 'success');
|
||||
Utils.showToast(I18n.t('loyalty.store.settings.program_created'), 'success');
|
||||
} else {
|
||||
response = await apiClient.put('/store/loyalty/program', payload);
|
||||
Utils.showToast('Program updated successfully', 'success');
|
||||
Utils.showToast(I18n.t('loyalty.store.settings.program_updated'), 'success');
|
||||
}
|
||||
|
||||
this.populateSettings(response);
|
||||
@@ -98,7 +98,7 @@ function loyaltySettings() {
|
||||
|
||||
loyaltySettingsLog.info('Program saved:', response.display_name);
|
||||
} catch (error) {
|
||||
Utils.showToast(`Failed to save: ${error.message}`, 'error');
|
||||
Utils.showToast(I18n.t('loyalty.store.settings.save_failed', {message: error.message}), 'error');
|
||||
loyaltySettingsLog.error('Save failed:', error);
|
||||
} finally {
|
||||
this.saving = false;
|
||||
@@ -110,13 +110,13 @@ function loyaltySettings() {
|
||||
|
||||
try {
|
||||
await apiClient.delete('/store/loyalty/program');
|
||||
Utils.showToast('Loyalty program deleted', 'success');
|
||||
Utils.showToast(I18n.t('loyalty.store.settings.program_deleted'), 'success');
|
||||
loyaltySettingsLog.info('Program deleted');
|
||||
// Redirect to terminal page
|
||||
const storeCode = window.location.pathname.split('/')[2];
|
||||
window.location.href = `/store/${storeCode}/loyalty/program`;
|
||||
} catch (error) {
|
||||
Utils.showToast(`Failed to delete: ${error.message}`, 'error');
|
||||
Utils.showToast(I18n.t('loyalty.store.settings.delete_failed', {message: error.message}), 'error');
|
||||
loyaltySettingsLog.error('Delete failed:', error);
|
||||
} finally {
|
||||
this.deleting = false;
|
||||
|
||||
Reference in New Issue
Block a user