(locale: string | LocaleOption)
| 54 | // } |
| 55 | |
| 56 | export function createLocaleObject(locale: string | LocaleOption): LocaleOption { |
| 57 | if (isString(locale)) { |
| 58 | const localeObj = localeStorage[locale.toUpperCase()] || {} as LocaleOption; |
| 59 | if (locale === LOCALE_ZH || locale === LOCALE_EN) { |
| 60 | return clone(localeObj); |
| 61 | } |
| 62 | else { |
| 63 | return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false); |
| 64 | } |
| 65 | } |
| 66 | else { |
| 67 | return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | export function getLocaleModel(lang: string): Model<LocaleOption> { |
| 72 | return localeModels[lang]; |
no test coverage detected
searching dependent graphs…