Skip to content

refactor(i18n): Prepare old resources for deprecation. Simplify resource maps.#2169

Open
skrustev wants to merge 6 commits intomasterfrom
skrastev/i18n-migrate
Open

refactor(i18n): Prepare old resources for deprecation. Simplify resource maps.#2169
skrustev wants to merge 6 commits intomasterfrom
skrastev/i18n-migrate

Conversation

@skrustev
Copy link
Copy Markdown
Member

@skrustev skrustev commented Mar 31, 2026

Description

  • Introduce union types for the Calendar, Chat, Date Picker, Date Range Picker resourceStrings properties setter. The getter return intersection for use of both new and old resource per desire.
  • Migrate Chat to use new i18n resources.
  • Simplify resource map handling
  • Add Date Picker resource map
  • Update resource names used in all components ahead of time to use new resources
  • Tagged deprecated interfaces and old EN resources

Note: Breaking change introduced in terms of resourceStrings properties is no longer allowing setting of specific property directly and providing mixed resources of new and old resources is also not supported. For example:

dateRangePicker.resourceStrings.last7Days = 'Custom resource'; // No longer reflected

// The provided object bellow is also not supported and could lead to not reflecting some resources. 
// Should provide either only new resource names or old ones.
dateRangePicker.resourceStrings = {
  last7Days: 'Last 7 days custom',
  date_range_picker_date_separator: ' | '
}

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that causes existing functionality to change)
  • Documentation update
  • Refactoring (code improvements without functional changes)

Related Issues

Resolves #2166
Requires IgniteUI/igniteui-i18n#26

Testing

  • Please make sure that old behavior remains unchanged and new it allows for switch to new resources.

Checklist

  • My code follows the project's coding standards
  • I have tested my changes locally
  • I have updated documentation if needed
  • Breaking changes are documented in the description

@skrustev skrustev requested a review from rkaraivanov March 31, 2026 07:40
@skrustev skrustev added 🛠️ status: in-development i18n Issues related to internationalization and localization labels Mar 31, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors component localization to support the new igniteui-i18n-core resource names while keeping deprecated (old) resource interfaces working via mixed resource maps, and updates Calendar/Date Picker/Date Range Picker/Chat to use the new keys.

Changes:

  • Introduces resource-map–based conversion to support setting either old or new resource-string objects (with mixed getter types).
  • Migrates Calendar, Date Picker, Date Range Picker, and Chat templates/default resources to the new core resource keys.
  • Adds/extends i18n resource maps and updates unit tests to reflect the new resourceStrings setter behavior.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/index.ts Exposes additional core i18n types/default EN resources from igniteui-i18n-core.
src/components/common/i18n/utils.ts Adds named resource maps (calendar/chat/date-picker/date-range-picker) and updates conversion helpers to use map names.
src/components/common/i18n/i18n-controller.ts Refactors controller to cache/merge default + custom resources and to support mixed resource conversion via resourceMapName.
src/components/common/i18n/i18n.spec.ts Updates localization tests to validate old/new compatibility using the new mixed-resource flow.
src/components/common/i18n/EN/calendar.resources.ts Deprecates old calendar interface, makes keys optional, and converts core EN defaults via resource maps.
src/components/common/i18n/EN/date-range-picker.resources.ts Deprecates old date-range-picker interface, makes keys optional, and converts core EN defaults via resource maps.
src/components/common/i18n/EN/date-picker.resources.ts Adds deprecated date-picker old-format resources derived from core EN defaults.
src/components/common/i18n/EN/chat.resources.ts Deprecates old chat interface and makes keys optional.
src/components/calendar/base.ts Switches Calendar i18n defaults to core resources + mixed mapping support.
src/components/calendar/calendar.ts Updates Calendar usage to new core resource keys.
src/components/date-picker/date-picker.ts Adds mixed i18n support and updates Date Picker strings (title/aria-label/icon title) to new keys.
src/components/date-range-picker/date-range-picker.ts Adds mixed i18n support and updates Date Range Picker strings to new keys; passes resourceStrings down to predefined ranges area.
src/components/date-range-picker/predefined-ranges-area.ts Adds mixed i18n support and switches predefined range labels to new date-range-picker keys.
src/components/date-range-picker/date-range-picker.common.spec.ts Updates tests for new setter semantics and new resource keys.
src/components/chat/chat.ts Migrates Chat to i18n controller with core defaults and new resource keys.
src/components/chat/chat-state.ts Sources resource strings from the host component instead of a static EN constant.
src/components/chat/chat-message.ts Updates Chat message/action strings to new chat_* resource keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow for Calendar and Date Range Picker to receive new resource strings as properties.

4 participants