fix(loyalty): sweep remaining hardcoded 'en-US' in persona JS files
Follow-up to06e59f73which swept non-loyalty modules. The earlier loyalty fix (dd1f9af8) only touched the shared/ factories; persona- specific JS files in loyalty's admin/, merchant/, store/, and storefront/ dirs were missed and still hardcoded 'en-US'. 13 occurrences across 8 files now use I18n.locale: - admin: loyalty-analytics.js, loyalty-merchant-detail.js, loyalty-programs.js - merchant: loyalty-analytics.js - store: loyalty-analytics.js, loyalty-terminal.js - storefront: loyalty-dashboard.js, loyalty-history.js After this commit grep -rn "'en-US'" --include=*.js across the whole repo returns nothing. Clearing the deck so the JS-016 rule can ship at error severity in the next commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -188,7 +188,7 @@ function adminLoyaltyAnalytics() {
|
|||||||
|
|
||||||
formatNumber(num) {
|
formatNumber(num) {
|
||||||
if (num === null || num === undefined) return '0';
|
if (num === null || num === undefined) return '0';
|
||||||
return new Intl.NumberFormat('en-US').format(num);
|
return new Intl.NumberFormat(I18n.locale).format(num);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ function adminLoyaltyMerchantDetail() {
|
|||||||
if (!dateString) return 'N/A';
|
if (!dateString) return 'N/A';
|
||||||
try {
|
try {
|
||||||
const date = new Date(dateString);
|
const date = new Date(dateString);
|
||||||
return date.toLocaleDateString('en-US', {
|
return date.toLocaleDateString(I18n.locale, {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'short',
|
month: 'short',
|
||||||
day: 'numeric'
|
day: 'numeric'
|
||||||
@@ -269,7 +269,7 @@ function adminLoyaltyMerchantDetail() {
|
|||||||
// Format number with thousands separator
|
// Format number with thousands separator
|
||||||
formatNumber(num) {
|
formatNumber(num) {
|
||||||
if (num === null || num === undefined) return '0';
|
if (num === null || num === undefined) return '0';
|
||||||
return new Intl.NumberFormat('en-US').format(num);
|
return new Intl.NumberFormat(I18n.locale).format(num);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Transaction categories
|
// Transaction categories
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ function adminLoyaltyPrograms() {
|
|||||||
if (!dateString) return 'N/A';
|
if (!dateString) return 'N/A';
|
||||||
try {
|
try {
|
||||||
const date = new Date(dateString);
|
const date = new Date(dateString);
|
||||||
return date.toLocaleDateString('en-US', {
|
return date.toLocaleDateString(I18n.locale, {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'short',
|
month: 'short',
|
||||||
day: 'numeric'
|
day: 'numeric'
|
||||||
@@ -339,7 +339,7 @@ function adminLoyaltyPrograms() {
|
|||||||
// Format number with thousands separator
|
// Format number with thousands separator
|
||||||
formatNumber(num) {
|
formatNumber(num) {
|
||||||
if (num === null || num === undefined) return '0';
|
if (num === null || num === undefined) return '0';
|
||||||
return new Intl.NumberFormat('en-US').format(num);
|
return new Intl.NumberFormat(I18n.locale).format(num);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ function merchantLoyaltyAnalytics() {
|
|||||||
|
|
||||||
formatNumber(num) {
|
formatNumber(num) {
|
||||||
if (num === null || num === undefined) return '0';
|
if (num === null || num === undefined) return '0';
|
||||||
return new Intl.NumberFormat('en-US').format(num);
|
return new Intl.NumberFormat(I18n.locale).format(num);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ function storeLoyaltyAnalytics() {
|
|||||||
|
|
||||||
formatNumber(num) {
|
formatNumber(num) {
|
||||||
if (num === null || num === undefined) return '0';
|
if (num === null || num === undefined) return '0';
|
||||||
return new Intl.NumberFormat('en-US').format(num);
|
return new Intl.NumberFormat(I18n.locale).format(num);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -399,7 +399,7 @@ function storeLoyaltyTerminal() {
|
|||||||
|
|
||||||
formatNumber(num) {
|
formatNumber(num) {
|
||||||
if (num === null || num === undefined) return '0';
|
if (num === null || num === undefined) return '0';
|
||||||
return new Intl.NumberFormat('en-US').format(num);
|
return new Intl.NumberFormat(I18n.locale).format(num);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Format time
|
// Format time
|
||||||
@@ -407,7 +407,7 @@ function storeLoyaltyTerminal() {
|
|||||||
if (!dateString) return '-';
|
if (!dateString) return '-';
|
||||||
try {
|
try {
|
||||||
const date = new Date(dateString);
|
const date = new Date(dateString);
|
||||||
return date.toLocaleTimeString('en-US', {
|
return date.toLocaleTimeString(I18n.locale, {
|
||||||
hour: '2-digit',
|
hour: '2-digit',
|
||||||
minute: '2-digit'
|
minute: '2-digit'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -73,13 +73,13 @@ function customerLoyaltyDashboard() {
|
|||||||
|
|
||||||
formatNumber(num) {
|
formatNumber(num) {
|
||||||
if (num == null) return '0';
|
if (num == null) return '0';
|
||||||
return new Intl.NumberFormat('en-US').format(num);
|
return new Intl.NumberFormat(I18n.locale).format(num);
|
||||||
},
|
},
|
||||||
|
|
||||||
formatDate(dateString) {
|
formatDate(dateString) {
|
||||||
if (!dateString) return '-';
|
if (!dateString) return '-';
|
||||||
try {
|
try {
|
||||||
return new Date(dateString).toLocaleDateString('en-US', {
|
return new Date(dateString).toLocaleDateString(I18n.locale, {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'short',
|
month: 'short',
|
||||||
day: 'numeric'
|
day: 'numeric'
|
||||||
|
|||||||
@@ -93,13 +93,13 @@ function customerLoyaltyHistory() {
|
|||||||
|
|
||||||
formatNumber(num) {
|
formatNumber(num) {
|
||||||
if (num == null) return '0';
|
if (num == null) return '0';
|
||||||
return new Intl.NumberFormat('en-US').format(num);
|
return new Intl.NumberFormat(I18n.locale).format(num);
|
||||||
},
|
},
|
||||||
|
|
||||||
formatDateTime(dateString) {
|
formatDateTime(dateString) {
|
||||||
if (!dateString) return '-';
|
if (!dateString) return '-';
|
||||||
try {
|
try {
|
||||||
return new Date(dateString).toLocaleString('en-US', {
|
return new Date(dateString).toLocaleString(I18n.locale, {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: 'short',
|
month: 'short',
|
||||||
day: 'numeric',
|
day: 'numeric',
|
||||||
|
|||||||
Reference in New Issue
Block a user