|
| 1 | +import { |
| 2 | + type IValidationResourceStrings, |
| 3 | + ValidationResourceStringsEN, |
| 4 | +} from 'igniteui-i18n-core'; |
1 | 5 | import { html, nothing, type TemplateResult } from 'lit'; |
2 | 6 | import { property, query } from 'lit/decorators.js'; |
3 | 7 | import { ifDefined } from 'lit/directives/if-defined.js'; |
@@ -199,10 +203,19 @@ export default class IgcDatePickerComponent extends FormAssociatedRequiredMixin( |
199 | 203 | private readonly _inputId = `date-picker-${nextId++}`; |
200 | 204 | private readonly _themes = addThemingController(this, all); |
201 | 205 | private readonly _slots = addSlotController(this, { slots: Slots }); |
202 | | - private readonly _i18nController = |
203 | | - addI18nController<IgcCalendarResourceStrings>(this, { |
204 | | - defaultEN: IgcCalendarResourceStringEN, |
205 | | - }); |
| 206 | + |
| 207 | + /** |
| 208 | + * For now we use the core validation strings internally only, to avoid mixing with old resources by users. |
| 209 | + * To Do: Update resourceStrings type when the IgcCalendarResourceStrings is changed to ICalendarResourceStrings |
| 210 | + */ |
| 211 | + protected override readonly __i18nController = addI18nController< |
| 212 | + IgcCalendarResourceStrings & IValidationResourceStrings |
| 213 | + >(this, { |
| 214 | + defaultEN: { |
| 215 | + ...IgcCalendarResourceStringEN, |
| 216 | + ...ValidationResourceStringsEN, |
| 217 | + }, |
| 218 | + }); |
206 | 219 |
|
207 | 220 | private _oldValue: Date | null = null; |
208 | 221 | private _activeDate: Date | null = null; |
@@ -455,23 +468,23 @@ export default class IgcDatePickerComponent extends FormAssociatedRequiredMixin( |
455 | 468 | */ |
456 | 469 | @property() |
457 | 470 | public set locale(value: string) { |
458 | | - this._i18nController.locale = value; |
| 471 | + this.__i18nController.locale = value; |
459 | 472 | } |
460 | 473 |
|
461 | 474 | public get locale() { |
462 | | - return this._i18nController.locale; |
| 475 | + return this.__i18nController.locale; |
463 | 476 | } |
464 | 477 |
|
465 | 478 | /** |
466 | 479 | * The resource strings for localization. |
467 | 480 | */ |
468 | 481 | @property({ attribute: false }) |
469 | 482 | public set resourceStrings(value: IgcCalendarResourceStrings) { |
470 | | - this._i18nController.resourceStrings = value; |
| 483 | + this.__i18nController.resourceStrings = value; |
471 | 484 | } |
472 | 485 |
|
473 | 486 | public get resourceStrings(): IgcCalendarResourceStrings { |
474 | | - return this._i18nController.resourceStrings; |
| 487 | + return this.__i18nController.resourceStrings; |
475 | 488 | } |
476 | 489 |
|
477 | 490 | /** Sets the start day of the week for the calendar. */ |
|
0 commit comments