Having an untrimmed text value will lead to bad behavior when changing the language twice
'untrimmed':
<button translate>text </button>
As i took a look at the code it seems like a caching / comparing problem.
So fix the code.
ngx-translate version: ^11.0.1
Angular version: 8.0.1
Browser:
- [X] Chrome (desktop) version 75.0.3770.100 (Offizieller Build) (64-Bit)
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [X] Firefox version 66.0.5 (64-Bit)
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [X] IE version 11.0.9600.19377
- [ ] Edge version XX
For Tooling issues:
- Node version: XX v10.15.3
- Platform: Windows
Others:
minimal code:
maybe it depends on https://github.com/ngx-translate/core/issues/808 but hopefully more reproducable
Where did you find this way of using ngx-translate/core?
Please take a look https://github.com/ngx-translate/core#4-use-the-service-the-pipe-or-the-directive
You need to 'tell' _directive_ or _pipe_ what translation value it needs to search for:
<button translate="click-me"></button>
<button translate="click-me">{{'click-me' | translate}}</button>
using your link
Please take a look https://github.com/ngx-translate/core#4-use-the-service-the-pipe-or-the-directive
Or even simpler using the content of your element as a key:
<div translate [translateParams]="{value: 'world'}">HELLO</div>
and having empty translateParams.
And I know, that there are possibilities to get the desired translation. Just wanted to be fair and report the strange behavior.
maybe the same as
https://github.com/ngx-translate/core/issues/1092