(locale: string)
| 47 | * @see [Internationalization (i18n) Guide](guide/i18n) |
| 48 | */ |
| 49 | export function findLocaleData(locale: string): any { |
| 50 | const normalizedLocale = normalizeLocale(locale); |
| 51 | |
| 52 | let match = getLocaleData(normalizedLocale); |
| 53 | if (match) { |
| 54 | return match; |
| 55 | } |
| 56 | |
| 57 | // let's try to find a parent locale |
| 58 | const parentLocale = normalizedLocale.split('-')[0]; |
| 59 | match = getLocaleData(parentLocale); |
| 60 | if (match) { |
| 61 | return match; |
| 62 | } |
| 63 | |
| 64 | if (parentLocale === 'en') { |
| 65 | return localeEn; |
| 66 | } |
| 67 | |
| 68 | throw new RuntimeError( |
| 69 | RuntimeErrorCode.MISSING_LOCALE_DATA, |
| 70 | ngDevMode && `Missing locale data for the locale "${locale}".`, |
| 71 | ); |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Retrieves the default currency code for the given locale. |
no test coverage detected