INNER CODE UNIT · TypeScript
base
vsdudakov/fastadmin · frontend/src/locales/index.ts:64
const base = candidate.toLowerCase().split(/[-_]/)[0];
if (base in resources) {
return base as TLanguage;
}
}
return "en";
};
export const getAntdLocale = (language: TLanguage): Locale =>
antdLocales[language];
export const applyDayjsLocale = (language: TLanguage): void => {
dayjs.locale(dayjsLocales[language]);
};