Open dpmott opened 4 years ago
I am having the same problem with v12.1.1 after upgrading to angular v9. As a workaround I was able to change the directive <div translate>{{ myvar }}</div>
to use a pipe <div>{{ myvar | translate }}</div>
.
I have the same problem. It's not working since version 12, so I'm stuck with 11. Any plans for fixing this?
Current behavior
When a variable (such as a Component attribute used in a template, holding a translation key) is used with the
translate
directive on an element with content which includes an interpolated variable, it is initially translated correctly, but when the value is later changed, the displayed text is untranslated.As an example, the template would use the
translate
directive like this:<div translate>{{ weekday }}</div>
Expected behavior
The key value in the variable should be translated and displayed whenever the variable is updated.
How do you think that we should fix this?
https://github.com/ngx-translate/core/pull/1169
Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/github-7csm2q
Click the "Click Me" button. Select a different language. Notice that the middle line misbehaves.
Environment