Community

0 votes
asked by (840 points)

Hi,

I'm trying to translate some text in a typescript file (!= template) and need some replacement functionality. E.g. like "You selected {0} item(s)". Where the placemholder is inserted in the ts file. Proper plural handling is a plus.

String concatenation of the json text seems overly cumbersome. Is there any solution in eo-core?

TIA

Dennis

1 Answer

0 votes
answered by (11.3k points)

Use translate.instant('my.key', {param: 'value'})

https://github.com/ngx-translate/core

Related questions

0 votes
1 answer
asked Oct 9, 2019 by dcieplik (840 points)
0 votes
1 answer
0 votes
1 answer
asked Jun 24, 2019 by dcieplik (840 points)
0 votes
2 answers
...