muetzerich
muetzerich

Reputation: 5720

ng2 translate - get value from function in pipe

I use ng2-translate for the i18n support in a angular2 project. Is there a way to get the value from a function and using the translate pipe?

I would like to do something like :

{{'text' | translate:'{value: getWorld()}'}}

translate.json:

{
    "text": "hello {{value}}"
}

Upvotes: 0

Views: 509

Answers (1)

Olivier
Olivier

Reputation: 1269

it's not possible right now, but that's something that could be possible in the future, I'd have to update the lib for that though. Or you can make a PR :)

Upvotes: 1

Related Questions