Core: Translate directive and pipe not perform the same way

Created on 9 Apr 2018  路  2Comments  路  Source: ngx-translate/core

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

  • ngx-translate version: 9.1

  • Angular version: 5.2

Most helpful comment

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

All 2 comments

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

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'"> <el2>other content</el2> </el1>
Displays only the "other content" skipping the translation.

<el1 translate>I18N.KEY <el2>other content</el2> </el1>
The translation is not anymore translated on language change.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bjornharvold picture bjornharvold  路  3Comments

jellene4eva picture jellene4eva  路  3Comments

ryanki1 picture ryanki1  路  4Comments

alkemist picture alkemist  路  3Comments

louisdoe picture louisdoe  路  3Comments