MCPcopy Create free account
hub / github.com/formatjs/formatjs / defaultLocale

Function defaultLocale

packages/utils/defaultLocale.ts:9–14  ·  view source on GitHub ↗
(countryCode?: string)

Source from the content-addressed store, hash-verified

7 * @returns default locale, or en if not found
8 */
9export function defaultLocale(countryCode?: string): string {
10 countryCode = canonicalizeCountryCode(countryCode)
11 return (
12 (countryCode && countryCode in data && data[countryCode as 'CN']) || 'en'
13 )
14}

Callers 1

Calls 1

canonicalizeCountryCodeFunction · 0.85

Tested by

no test coverage detected