fix(i18n): Fix setting partial resources not filling the rest per component. - #17546
Open
skrustev wants to merge 4 commits into
Open
fix(i18n): Fix setting partial resources not filling the rest per component.#17546skrustev wants to merge 4 commits into
skrustev wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes i18n behavior where setting partial per-component resourceStrings returned only the partial object (missing defaults) when later accessed (e.g. via resourceStrings / resourceString), by introducing merged “custom + defaults” resource objects across multiple components and adding unit tests to prevent regressions.
Changes:
- Update many components to return merged resource strings (defaults overlaid with per-component custom overrides), and refresh merged values on global i18n change events.
- Refactor several locale/i18n update paths to reuse a shared
updateResources(...)helper. - Add unit tests validating (1) partial per-component overrides still expose defaults, and (2) global i18n changes update only non-overridden keys.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/igniteui-angular/tree/src/tree/tree.spec.ts | Adds tests validating merged TreeNode resource strings and global i18n updates. |
| projects/igniteui-angular/tree/src/tree/tree-node/tree-node.component.ts | Returns merged default+custom resource strings; updates merged strings on global i18n change. |
| projects/igniteui-angular/time-picker/src/time-picker/time-picker.component.ts | Returns merged default+custom resource strings; recomputes on resource updates. |
| projects/igniteui-angular/query-builder/src/query-builder/query-builder.component.ts | Returns merged default+custom resource strings; recomputes on global i18n change. |
| projects/igniteui-angular/query-builder/src/query-builder/query-builder.component.spec.ts | Adds tests for partial resourceStrings merge and global i18n updates. |
| projects/igniteui-angular/query-builder/src/query-builder/query-builder-tree.component.ts | Uses updateResources(...) helper and merges default+custom resource strings (incl. locale path). |
| projects/igniteui-angular/query-builder/src/query-builder/query-builder-header.component.ts | Returns merged default+custom resource strings; recomputes on global i18n change. |
| projects/igniteui-angular/paginator/src/paginator/paginator.component.ts | Returns merged default+custom resource strings; recomputes on global i18n change. |
| projects/igniteui-angular/paginator/src/paginator/paginator.component.spec.ts | Adds test ensuring global i18n updates affect non-overridden keys. |
| projects/igniteui-angular/list/src/list/list.component.ts | Returns merged default+custom resource strings; recomputes on global i18n change. |
| projects/igniteui-angular/list/src/list/list.component.spec.ts | Adds tests for partial resourceStrings merge and global i18n updates. |
| projects/igniteui-angular/input-group/src/input-group/input-group.component.ts | Returns merged default+custom resource strings; recomputes on global i18n change. |
| projects/igniteui-angular/input-group/src/input-group/input-group.component.spec.ts | Adds tests for partial resourceStrings merge and global i18n updates. |
| projects/igniteui-angular/grids/grid/src/grid.component.spec.ts | Adds tests for partial grid resourceStrings merge and global i18n updates. |
| projects/igniteui-angular/grids/grid/src/grid-base.directive.ts | Returns merged default+custom grid resource strings; adds updateResources(...) for locale/i18n changes. |
| projects/igniteui-angular/grids/core/src/pivot-grid-dimensions.ts | Returns merged default+custom resource strings for pivot date dimension. |
| projects/igniteui-angular/date-picker/src/date-range-picker/date-range-picker.component.ts | Returns merged default+custom resource strings; recomputes on resource updates. |
| projects/igniteui-angular/date-picker/src/date-range-picker/date-range-picker.component.spec.ts | Adds tests for partial resourceStrings merge and global i18n updates. |
| projects/igniteui-angular/combo/src/combo/combo.component.spec.ts | Adds tests for partial combo resourceStrings merge and global i18n updates. |
| projects/igniteui-angular/combo/src/combo/combo.common.ts | Returns merged default+custom resource strings; recomputes on global i18n change. |
| projects/igniteui-angular/chips/src/chips/chip.spec.ts | Adds tests for partial chip resourceStrings merge and global i18n updates. |
| projects/igniteui-angular/chips/src/chips/chip.component.ts | Returns merged default+custom resource strings; recomputes on global i18n change. |
| projects/igniteui-angular/carousel/src/carousel/carousel.component.ts | Returns merged default+custom resource strings; recomputes on global i18n change. |
| projects/igniteui-angular/carousel/src/carousel/carousel.component.spec.ts | Adds tests for partial resourceStrings merge and global i18n updates. |
| projects/igniteui-angular/calendar/src/calendar/calendar-base.ts | Returns merged default+custom resource strings; adds updateResources(...) helper for locale/i18n changes. |
| projects/igniteui-angular/banner/src/banner/banner.component.ts | Returns merged default+custom resource strings; recomputes on global i18n change. |
| projects/igniteui-angular/banner/src/banner/banner.component.spec.ts | Adds tests for partial resourceStrings merge and global i18n updates. |
| projects/igniteui-angular/action-strip/src/action-strip/action-strip.component.ts | Returns merged default+custom resource strings; recomputes on global i18n change. |
| projects/igniteui-angular/action-strip/src/action-strip/action-strip.component.spec.ts | Adds tests ensuring global i18n changes propagate correctly with/without overrides. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
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.
Related #17540
Description
Fix setting partial custom resources per component returning partial resources as well when getting them using the
resourceStringproperty instead of getting merged with the default ones.Type of Change (check all that apply):
Component(s) / Area(s) Affected:
How Has This Been Tested?
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)