Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translate directive Not working with dynamic key #1323

Open
harleenarora opened this issue Jul 30, 2021 · 3 comments
Open

translate directive Not working with dynamic key #1323

harleenarora opened this issue Jul 30, 2021 · 3 comments

Comments

@harleenarora
Copy link

Current behavior

When I use the translate directive, its does not work in dynamic change, but I use pipe its working fine.

Expected behavior

How do you think that we should fix this?

Minimal reproduction of the problem with instructions

Environment


ngx-translate version: 13.0.0
Angular version: 12.1.1


Browser:
- [ ] 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: XX  
- Platform:  

Others:

@ghost
Copy link

ghost commented Feb 24, 2022

+1

Updates using directive are not applied anymore: the initial translation works, but subsequent changes are not recognized anymore. Issue was introduced in v12.0.0 with commit 35427b0.

@altbdoor
Copy link

Here's a minimal reproduction of the issue: https://stackblitz.com/edit/angular-ivy-hypzhr?file=src%2Fapp%2Fapp.component.ts

And the latest environment info:

ngx-translate version: 14.0.0
Angular version: 13.3.0

Browser:
- [x] Chrome (desktop) version 99.0.4844.74
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [x] Firefox version 98.0.1
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

I've only tested it in latest Chrome and Firefox.

@Clemens-E
Copy link

Can confirm, we upgraded to angular 16 and subsequently ngx-translate to 15, first we had issues with keys not being translated in content projection, so I first thought something in angular was messing up, but now it appears when keys change ngx-translate just does nothing anymore when it's using a directive (as seen in @altbdoor stackblitz)

This has been open for 2 years, I think this is a pretty critical bug, or is this intentional?
@ocombe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants