Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3bcc918
feat(localization): Initial integration of new i18nManager.
skrustev Aug 29, 2025
657af61
chore(*): Remove extra types.
skrustev Aug 29, 2025
59778b2
feat(localization): Move logic for localization in controller and utils.
skrustev Sep 4, 2025
092ecc6
feat(calendar): Add i18n controller to calendar base and move related…
skrustev Sep 4, 2025
1c6c396
feat(date-range-picker): Add controller and update relatet props.
skrustev Sep 4, 2025
815286c
feat(carousel): Add i18n controller and set localizable strings.
skrustev Sep 4, 2025
39e0dd9
feat(chip): Add i18n controller and use it for localizable strings.
skrustev Sep 4, 2025
e03f8aa
feat(combo): Add localization to combo.
skrustev Sep 4, 2025
2180546
fix(*): Fix some paths and export for types.
skrustev Sep 4, 2025
757494f
fix(i18n): Fix applying resources for new localized components that u…
skrustev Sep 4, 2025
f103d47
feat(combo): Add search placeholder localization.
skrustev Sep 4, 2025
634081e
fix(carousel): Fix typo for getter.
skrustev Sep 4, 2025
9bc0c9b
chore(*): Remove leftover code.
skrustev Sep 5, 2025
e99faf9
refactor(calendar): Use new Intl formatter instances.
skrustev Sep 5, 2025
0f6ff62
test(localization): Add basic tests for localization.
skrustev Sep 15, 2025
6234c12
feat(localization): Enable localized strings for week label.
skrustev Sep 15, 2025
e325593
refactor(validation): Switch to use resource strings from i18n packages.
skrustev Sep 17, 2025
66949a4
Merge branch 'skrastev/localization' into skrastev/localization-intl
skrustev Sep 17, 2025
741292b
refactor(date-inputs): Use new Intl API for display date formatting. …
skrustev Sep 18, 2025
f5e5957
feat(date-inputs): Add localizaiton for Date Time Input and Date Picker.
skrustev Sep 19, 2025
a3ad181
tests(localization): Update tests failing due to latest changes in lo…
skrustev Sep 19, 2025
b290679
feat(localization): Add i18n packages.
skrustev Oct 2, 2025
3ff39a9
Merge master into skrastev/localization
skrustev Oct 2, 2025
75aa62d
Merge skrastev/localization into skrastev/localization-intl
skrustev Oct 2, 2025
105e56b
fix(date-inputs): Fix tests and make sure old behaviors don't change.
skrustev Oct 3, 2025
756e83a
Merge master into skrastev/localization-intl
skrustev Oct 23, 2025
9fef6ed
chore(*): Update package lock.
skrustev Oct 23, 2025
461680e
tests(date-util): Update tests with latest changes.
skrustev Oct 23, 2025
a12394d
refactor(localization): Override FormAssociated localization controll…
skrustev Oct 23, 2025
09bc827
Merge branch 'master' into skrastev/localization-intl
rkaraivanov Oct 23, 2025
33ce4d6
fix(date-time): Return missing check for default mask if input format…
skrustev Oct 27, 2025
9bd1956
fix(date-range-picker): Fix mask not being updated when locale is cha…
skrustev Oct 27, 2025
91b7fff
fix(date-inputs): Remove alwaysLeadingZero prop. Update tests.
skrustev Oct 27, 2025
c8f0a3f
fix(date-range-picker): No need to use the resolved displayFormat.
skrustev Oct 27, 2025
726774e
refactor(date-range-picker): Simplify update of _maskedRangeValue and…
skrustev Oct 27, 2025
25d41da
chore(*): Simplify further getting of displayFormat.
skrustev Oct 27, 2025
c67a2cd
chore(*): Bump up i18n versions.
skrustev Oct 29, 2025
0ccb8ac
tests(localization): Update tests to reflect latest changes.
skrustev Oct 30, 2025
8170d53
refactor(localization): Remove validation localization handling and r…
skrustev Oct 31, 2025
c66caa1
fix(calendar): Fix not retrieving localized string for weekLabel. #1904
skrustev Oct 31, 2025
5c9d04d
chore(*): Add notes regarding calendar weekStart
skrustev Oct 31, 2025
6c952ba
feat(localization): Add further localization for Combo, File Input an…
skrustev Nov 3, 2025
921d7cf
chore(*): Update changelog.
skrustev Nov 3, 2025
2759e99
tests(tree): Update tests to reflect localized aria label.
skrustev Nov 3, 2025
ea78764
Merge master into skrastev/localization-intl
skrustev Nov 3, 2025
5f2b01e
Merge branch 'master' into skrastev/localization-intl
rkaraivanov Nov 5, 2025
1ab2e37
tests(date-picker): Update tests related to format changes.
skrustev Nov 6, 2025
d5c61fd
Merge branch 'master' into skrastev/localization-intl
rkaraivanov Nov 6, 2025
6d570bc
refactor(tree): Move resources controller to root tree.
skrustev Nov 10, 2025
f37c05a
refactor(file-input): Update i18n with renamed file input resources.
skrustev Nov 10, 2025
b5772b0
chore(*): Update comments for locale prop of components without forma…
skrustev Nov 10, 2025
35157be
chore(*): Further tweak to comments.
skrustev Nov 10, 2025
c85e238
Merge branch 'master' into skrastev/localization-intl
skrustev Nov 10, 2025
8a6f184
chore(*): Update package-lock.
skrustev Nov 10, 2025
6291936
chore(*): Update i18n package.
skrustev Nov 10, 2025
57c5f26
chore(*): Revert unwanted script change.
skrustev Nov 10, 2025
0a7de24
Merge branch 'master' into skrastev/localization-intl
rkaraivanov Nov 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
- #### Localization
- New localization implementation. Now you can set global localization for all localized Ignite UI components using the `registerI18n` and `setCurrentI18n` methods.
- Calendar, Date Input, Date Picker and Date Range Picker components now implement the new localization for formatting as well, which internally uses new implementation of the Intl.
- Added localization for Carousel, Chip, Combo, File Input and Tree. They now have `locale` and `resourceStrings` properties as well, which you can set to customize them individually.

### Fixed
- #### Tooltip
- Do not show tooltip when target is clicked [#1828](https://github.com/IgniteUI/igniteui-webcomponents/issues/1828)
- #### Date input, Date picker, Date range picker
- Default display format now follows strictly locale format as per specification without leading zeros.

## [6.3.6] - 2025-11-14
### Fixed
Expand Down
33 changes: 10 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@floating-ui/dom": "^1.7.4",
"@lit-labs/virtualizer": "^2.1.1",
"@lit/context": "^1.1.6",
"igniteui-i18n-core": "0.6.0-alpha.4",
"igniteui-i18n-core": "0.7.0-alpha.8",
"lit": "^3.3.1"
},
"devDependencies": {
Expand All @@ -81,7 +81,7 @@
"globby": "^15.0.0",
"husky": "^9.1.7",
"ig-typedoc-theme": "^7.0.0",
"igniteui-i18n-resources": "0.6.0-alpha.4",
"igniteui-i18n-resources": "0.7.0-alpha.8",
"igniteui-theming": "^22.1.0",
"keep-a-changelog": "^2.7.1",
"lint-staged": "^16.2.6",
Expand Down
78 changes: 45 additions & 33 deletions src/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getDateFormatter } from 'igniteui-i18n-core';
import { html, nothing } from 'lit';
import { property, query, queryAll, state } from 'lit/decorators.js';
import { choose } from 'lit/directives/choose.js';
Expand All @@ -15,9 +16,7 @@ import {
pageUpKey,
shiftKey,
} from '../common/controllers/key-bindings.js';
import { watch } from '../common/decorators/watch.js';
import { registerComponent } from '../common/definitions/register.js';
import { createDateTimeFormatters } from '../common/localization/intl-formatters.js';
import type { Constructor } from '../common/mixins/constructor.js';
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
import { partMap } from '../common/part-map.js';
Expand Down Expand Up @@ -219,30 +218,21 @@ export default class IgcCalendarComponent extends EventEmitterMixin<
public formatOptions: Pick<Intl.DateTimeFormatOptions, 'month' | 'weekday'> =
{ month: 'long', weekday: 'narrow' };

private _intl = createDateTimeFormatters(this.locale, {
month: {
month: this.formatOptions.month,
},
monthLabel: { month: 'long' },
weekday: { weekday: 'short' },
monthDay: { month: 'short', day: 'numeric' },
yearLabel: { month: 'long', year: 'numeric' },
});

@watch('locale')
protected localeChange() {
this._intl.locale = this.locale;
}

@watch('formatOptions')
protected formatOptionsChange() {
this._intl.update({
month: {
month: this.formatOptions.month,
},
});
private get _monthOptions(): Intl.DateTimeFormatOptions {
return { month: this.formatOptions.month };
}

private _monthLabelOptions: Intl.DateTimeFormatOptions = { month: 'long' };
private _weekdayOptions: Intl.DateTimeFormatOptions = { weekday: 'short' };
private _monthDayOptions: Intl.DateTimeFormatOptions = {
month: 'short',
day: 'numeric',
};
private _yearLabelOptions: Intl.DateTimeFormatOptions = {
month: 'long',
year: 'numeric',
};

/** @private @hidden @internal */
public async [focusActiveDate](options?: FocusOptions) {
await this.updateComplete;
Expand Down Expand Up @@ -462,23 +452,34 @@ export default class IgcCalendarComponent extends EventEmitterMixin<
active: CalendarDay,
viewIndex: number
) {
const labelFmt = this._intl.get('monthLabel').format;
const valueFmt = this._intl.get('month').format;
const ariaLabel = `${labelFmt(active.native)}, ${this.resourceStrings.selectMonth}`;
const label = getDateFormatter().formatDateTime(
active.native,
this.locale,
this._monthLabelOptions
);
const value = getDateFormatter().formatDateTime(
active.native,
this.locale,
this._monthOptions
);
const ariaLabel = `${label}, ${this.resourceStrings.selectMonth}`;

return html`
<button
part="months-navigation"
aria-label=${ariaLabel}
@click=${() => this.switchToMonths(viewIndex)}
>
${valueFmt(active.native)}
${value}
</button>
`;
}

protected renderYearButtonNavigation(active: CalendarDay, viewIndex: number) {
const fmt = this._intl.get('yearLabel').format;
const fmt = getDateFormatter().getIntlFormatter(
this.locale,
this._yearLabelOptions
).format;
const ariaLabel = `${active.year}, ${this.resourceStrings.selectYear}`;
const ariaSkip = this._isDayView ? fmt(active.native) : active.year;

Expand Down Expand Up @@ -548,19 +549,30 @@ export default class IgcCalendarComponent extends EventEmitterMixin<

protected renderHeaderDateSingle() {
const date = this.value ?? CalendarDay.today.native;
const day = this._intl.get('weekday').format(date);
const month = this._intl.get('monthDay').format(date);
const weekday = getDateFormatter().formatDateTime(
date,
this.locale,
this._weekdayOptions
);
const monthDay = getDateFormatter().formatDateTime(
date,
this.locale,
this._monthDayOptions
);
const separator =
this.headerOrientation === 'vertical' ? html`<br />` : ' ';

const formatted = html`${day},${separator}${month}`;
const formatted = html`${weekday},${separator}${monthDay}`;

return html`<slot name="header-date">${formatted}</slot>`;
}

protected renderHeaderDateRange() {
const values = this.values;
const fmt = this._intl.get('monthDay').format;
const fmt = getDateFormatter().getIntlFormatter(
this.locale,
this._monthDayOptions
).format;
const { startDate, endDate } = this.resourceStrings;

const start = this._hasValues ? fmt(first(values)) : startDate;
Expand Down
40 changes: 22 additions & 18 deletions src/components/calendar/days-view/days-view.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { getDateFormatter } from 'igniteui-i18n-core';
import { html, nothing } from 'lit';
import { property, query, state } from 'lit/decorators.js';

import { addThemingController } from '../../../theming/theming-controller.js';
import { addKeybindings } from '../../common/controllers/key-bindings.js';
import { blazorIndirectRender } from '../../common/decorators/blazorIndirectRender.js';
import { blazorSuppressComponent } from '../../common/decorators/blazorSuppressComponent.js';
import { watch } from '../../common/decorators/watch.js';
import { registerComponent } from '../../common/definitions/register.js';
import { createDateTimeFormatters } from '../../common/localization/intl-formatters.js';
import type { Constructor } from '../../common/mixins/constructor.js';
import { EventEmitterMixin } from '../../common/mixins/event-emitter.js';
import { partMap } from '../../common/part-map.js';
Expand Down Expand Up @@ -107,21 +106,17 @@ export default class IgcDaysViewComponent extends EventEmitterMixin<
@property({ attribute: 'week-day-format' })
public weekDayFormat: 'long' | 'short' | 'narrow' = 'narrow';

private _intl = createDateTimeFormatters(this.locale, {
weekday: { weekday: this.weekDayFormat },
label: { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' },
ariaWeekday: { weekday: 'long' },
});

@watch('locale')
protected localeChange() {
this._intl.locale = this.locale;
private get _weekdayOptions(): Intl.DateTimeFormatOptions {
return { weekday: this.weekDayFormat };
}

@watch('weekDayFormat')
protected weekDayFormatChange() {
this._intl.update({ weekday: { weekday: this.weekDayFormat } });
}
private _labelOptions: Intl.DateTimeFormatOptions = {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
};
private _ariaWeekdayOptions: Intl.DateTimeFormatOptions = { weekday: 'long' };

@watch('weekStart')
@watch('activeDate')
Expand Down Expand Up @@ -336,7 +331,10 @@ export default class IgcDaysViewComponent extends EventEmitterMixin<
}

private intlFormatDay(day: CalendarDay) {
const fmt = this._intl.get('label');
const fmt = getDateFormatter().getIntlFormatter(
this.locale,
this._labelOptions
);

// Range selection in progress
if (this._rangePreviewDate?.equalTo(day)) {
Expand Down Expand Up @@ -444,8 +442,14 @@ export default class IgcDaysViewComponent extends EventEmitterMixin<
}

protected renderHeaders() {
const label = this._intl.get('weekday');
const aria = this._intl.get('ariaWeekday');
const label = getDateFormatter().getIntlFormatter(
this.locale,
this._weekdayOptions
);
const aria = getDateFormatter().getIntlFormatter(
this.locale,
this._ariaWeekdayOptions
);
const days = take(
generateMonth(this._activeDate, this._firstDayOfWeek),
daysInWeek
Expand Down
34 changes: 17 additions & 17 deletions src/components/calendar/months-view/months-view.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { getDateFormatter } from 'igniteui-i18n-core';
import { html, LitElement } from 'lit';
import { property, query, state } from 'lit/decorators.js';
import { range } from 'lit/directives/range.js';

import { addThemingController } from '../../../theming/theming-controller.js';
import { addKeybindings } from '../../common/controllers/key-bindings.js';
import { blazorIndirectRender } from '../../common/decorators/blazorIndirectRender.js';
import { blazorSuppressComponent } from '../../common/decorators/blazorSuppressComponent.js';
import { watch } from '../../common/decorators/watch.js';
import { registerComponent } from '../../common/definitions/register.js';
import { createDateTimeFormatters } from '../../common/localization/intl-formatters.js';
import type { Constructor } from '../../common/mixins/constructor.js';
import { EventEmitterMixin } from '../../common/mixins/event-emitter.js';
import { partMap } from '../../common/part-map.js';
Expand Down Expand Up @@ -67,20 +65,14 @@ export default class IgcMonthsViewComponent extends EventEmitterMixin<
public monthFormat: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow' =
'long';

private _intl = createDateTimeFormatters(this.locale, {
month: { month: this.monthFormat },
ariaMonth: { month: 'long', year: 'numeric' },
});

@watch('locale')
protected localeChange() {
this._intl.locale = this.locale;
private get _monthOptions(): Intl.DateTimeFormatOptions {
return { month: this.monthFormat };
}

@watch('monthFormat')
protected formatChange() {
this._intl.update({ month: { month: this.monthFormat } });
}
private _ariaMonthOptions: Intl.DateTimeFormatOptions = {
month: 'long',
year: 'numeric',
};

constructor() {
super();
Expand Down Expand Up @@ -110,8 +102,16 @@ export default class IgcMonthsViewComponent extends EventEmitterMixin<
}

protected renderMonth(entry: CalendarDay, now: CalendarDay) {
const ariaLabel = this._intl.get('ariaMonth').format(entry.native);
const value = this._intl.get('month').format(entry.native);
const ariaLabel = getDateFormatter().formatDateTime(
entry.native,
this.locale,
this._ariaMonthOptions
);
const value = getDateFormatter().formatDateTime(
entry.native,
this.locale,
this._monthOptions
);

const active = areSameMonth(this._value, entry);
const current = areSameMonth(now, entry);
Expand Down
3 changes: 2 additions & 1 deletion src/components/carousel/carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export default class IgcCarouselComponent extends EventEmitterMixin<
public animationType: HorizontalTransitionAnimation = 'slide';

/**
* Gets/Sets the locale used for formatting and displaying the dates in the component.
* Gets/Sets the locale used for getting language, affecting resource strings.
* @attr locale
*/
@property()
Expand All @@ -295,6 +295,7 @@ export default class IgcCarouselComponent extends EventEmitterMixin<

/**
* The resource strings for localization.
* Currently only aria-label attributes are localized for the carousel.
*/
@property({ attribute: false })
public set resourceStrings(value: ICarouselResourceStrings) {
Expand Down
Loading
Loading