feat(i18n): add multi-language support (en/zh) across app and server

Implement useLocale composable and shared translation dictionaries
Translate public pages, booking flow, and receipt views
Store booking locale to send localized WhatsApp notifications
This commit is contained in:
2026-05-08 15:31:44 +08:00
parent b05cfd2c0e
commit 1318e766d5
14 changed files with 789 additions and 209 deletions

View File

@@ -1,9 +1,11 @@
export function formatDateTime(value: string | null, fallback = 'Not available') {
import type { AppLocale } from '~~/shared/i18n'
export function formatDateTime(value: string | null, fallback = 'Not available', locale: AppLocale = 'en') {
if (!value) {
return fallback
}
return new Intl.DateTimeFormat('en-MY', {
return new Intl.DateTimeFormat(locale === 'zh' ? 'zh-MY' : 'en-MY', {
dateStyle: 'medium',
timeStyle: 'short'
}).format(new Date(value))