feat: release contextual omnichannel customer platform
Add Telegram, WhatsApp and email account management, realtime messaging, contextual multilingual AI, customer intelligence, knowledge workflows, enterprise controls, a unified design system and complete repository documentation.
This commit is contained in:
+12
-1
@@ -26,7 +26,18 @@ export const COUNTRIES: CountryMeta[] = [
|
||||
]
|
||||
|
||||
export function countryMeta(code: string): CountryMeta {
|
||||
return COUNTRIES.find((c) => c.code === code) ?? { code, zh: code, en: code, flag: '🏳️', tzOffset: 0, lang: 'en' }
|
||||
const normalized = String(code || '').trim().toUpperCase()
|
||||
const known = COUNTRIES.find((c) => c.code === normalized)
|
||||
if (known) return known
|
||||
if (!/^[A-Z]{2}$/.test(normalized)) {
|
||||
return { code: '', zh: '国家待确认', en: 'Country not confirmed', flag: '🌐', tzOffset: Number.NaN, lang: '' }
|
||||
}
|
||||
const flag = String.fromCodePoint(
|
||||
...[...normalized].map((character) => 127397 + character.charCodeAt(0)),
|
||||
)
|
||||
const zh = new Intl.DisplayNames(['zh-CN'], { type: 'region' }).of(normalized) || normalized
|
||||
const en = new Intl.DisplayNames(['en'], { type: 'region' }).of(normalized) || normalized
|
||||
return { code: normalized, zh, en, flag, tzOffset: Number.NaN, lang: '' }
|
||||
}
|
||||
|
||||
/** 行业 */
|
||||
|
||||
Reference in New Issue
Block a user