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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user