import { Injectable } from '@angular/core'; import { LocaleService } from '@farris/ui-locale'; @Injectable({ providedIn: 'root' }) export class TimePickerLocaleService { private localeConfig = { 'ZH_CN' : { placeholder: '请选择时间' }, 'EN_US' : { placeholder: 'Please select a time' } }; 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; } } }