refactor(i18n): Prepare old resources for deprecation. Simplify resource maps.#2169
Open
refactor(i18n): Prepare old resources for deprecation. Simplify resource maps.#2169
Conversation
Contributor
There was a problem hiding this comment.
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
resourceStringssetter 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Calendar,Chat,Date Picker,Date Range PickerresourceStringsproperties setter. The getter return intersection for use of both new and old resource per desire.Note: Breaking change introduced in terms of
resourceStringsproperties is no longer allowing setting of specific property directly and providing mixed resources of new and old resources is also not supported. For example:Type of Change
Related Issues
Resolves #2166
Requires IgniteUI/igniteui-i18n#26
Testing
Checklist