import { Injectable } from '@angular/core'; import { LocaleService } from '@farris/ui-locale'; @Injectable({ providedIn: 'root' }) export class CalendarLocaleService { private localeConfig = { 'ZH_CN' : { locale: 'zh-cn', buttonText: { today: '今天', month: '月', week: '周', day: '天', listWeek: '列表' }, allDayText : '全天', noEventsMessage : '没数据啊', eventLimitText : '更多', weekNumberTitle : '周', firstDay: 1 }, 'EN_US' : { locale: 'en' } }; constructor(private localeService: LocaleService) {} public getLocaleConfig() { const locale = this.localeService.getValue('locale'); if (locale && this.localeConfig[locale]) { return this.localeConfig[locale]; } else { return this.localeConfig.ZH_CN; } } }