'translateparams' directive in the statement '
' is not working. It seems like P should be in uppercase for 'translateparams'?Even though the case is corrected to uppercase, the 'translate' directive does not seem to be working as expected. No error listed on the console. However 'innerHTML' directive is working fine for me.
Can anyone help? Is this a bug or my mistake?
Hi, you're right it should be translateParams, not sure what happened in the readme, I fixed it.
How is it not working as expected (once you've set the correct translateParams)
If you assign the language key to the translate directive, it will not work. But if you use simpler method specified in the readme (specifying the language key inside the innerhtml of the element), it will work. I got the same issue in your plunker example too.
I am not sure if I am doing anything wrong here. Can you please check?
Thanks in advance
The directive is quite new, so it's possible that it's still buggy in a few use cases that I didn't test correctly.
I'll check :)
I just upgraded from 4.0 to 4.2 and I am trying out the directive.
I can confirm that, regardless if translateParams is present or not, this works:
<div translate >MY.TEXTKEY</div>
But this doesn't:
<div [translate]="MY.TEXTKEY"></div>
In the second case, there is no error in the console, but no text is displayed in the div.
Same problem here with:
Before noticing this bug I had opened a SO question: http://stackoverflow.com/questions/41295910/ng2-translate-directive-not-working-while-pipe-is/41296133#41296133
Hello same problem here, if you use this :
<div [translate]="'HELLO'" [translateParams]="{value: 'world'}"></div>
It doesn't work but if you put inner text they work
<div [translate]="'HELLO'" [translateParams]="{value: 'world'}">test</div>
Same problem here. Using:
The @boughioul workaround makes it work.
Thanks @ocombe! :D
Fixed in 6.0.1