28 lines
826 B
TypeScript
28 lines
826 B
TypeScript
import locale_ru from 'antd/lib/calendar/locale/ru_RU';
|
|
import locale_en from 'antd/lib/calendar/locale/en_GB';
|
|
import locale_de from 'antd/lib/calendar/locale/de_DE';
|
|
import locale_it from 'antd/lib/calendar/locale/it_IT';
|
|
import locale_es from 'antd/lib/calendar/locale/es_ES';
|
|
import locale_fr from 'antd/lib/calendar/locale/fr_FR';
|
|
|
|
// for calendars
|
|
export const getLocale = (locale: string) => {
|
|
if (locale) {
|
|
switch (locale) {
|
|
case 'ru':
|
|
return locale_ru;
|
|
case 'de':
|
|
return locale_de;
|
|
case 'fr':
|
|
return locale_fr;
|
|
case 'it':
|
|
return locale_it;
|
|
case 'es':
|
|
return locale_es;
|
|
default:
|
|
return locale_en;
|
|
}
|
|
}
|
|
|
|
return locale_en;
|
|
}; |