ngx-translate / core

The internationalization (i18n) library for Angular
MIT License
4.51k stars 576 forks source link

Translate directive and pipe not perform the same way #828

Open justforuse opened 6 years ago

justforuse commented 6 years ago

I'm submitting a ... (check one with "x")

[x] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request

Current behavior translate directive and pipe dont transform unknown value in same way when directive meet unknown value output the value itself, but cannot changed. pipe performs well

Reproduction of the problem

https://stackblitz.com/edit/angular-qjsz5l

ar53n commented 6 years ago

And pipe transform show first empty string but directive show first path to translate string.

91K00 commented 5 years ago

I detect also some weirds behaviours when you add content inside the element that is translated. These two snippets are NOT working properly:

`<el1 [translate]="'I18N.KEY'">

other content

` Displays only the "other content" skipping the translation.

`I18N.KEY

other content

` The translation is not anymore translated on language change.

Here is the stackblitz : https://stackblitz.com/edit/91k00-ngx-translate-bug