-
-
Notifications
You must be signed in to change notification settings - Fork 590
Open
Description
Current behavior
When using interpolation patterns like {{ matches.length }} the resulting string does not contain the length of array matches, but that pattern's source as string.
Expected behavior
It should be possible to inject an array's size into translations, e.g. given the pattern above used in a translation for a key 'FOO.BAR' should result in that array's length given as number.
How do you think that we should fix this?
Method getValue() in util.ts has changed in v17 and it is limiting support for descending into arrays accepting numeric keys, only. Hence, using .length is not working like before anymore.
Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/github-acm14mj2?file=src%2Fapp%2Fapp.component.ts
Environment
ngx-translate version: 17.0.0
Angular version: 21.0.8
Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: 22.20.0
- Platform: Windows
Others:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels