Added helper methods for locales.

This commit is contained in:
Mike Cao 2021-11-20 17:18:25 -08:00
parent ef616cc98d
commit 0a8c06b1f8
4 changed files with 18 additions and 10 deletions

View file

@ -76,3 +76,11 @@ export const languages = {
'tr-TR': { label: 'Türkçe', dateLocale: tr },
'uk-UA': { label: 'українська', dateLocale: uk },
};
export function getDateLocale(locale) {
return languages[locale]?.dateLocale || enUS;
}
export function getTextDirection(locale) {
return languages[locale]?.dir || 'ltr';
}