문제

I can use data-18n no problem with a json properties file like this:

<div data-i18n="errIncorrectSpecies"></div>

json properties file has this entry:

"errIncorrectSpecies":"You have selected incorrect species tests."

How I go about putting dynamic params into the "errIncorrectSpecies" value? I would like to do this in my json file:

"errIncorrectSpecies":"You have selected {0} tests for this {1}."

Just not sure how to pass in "{0}" and "{1}"...

도움이 되었습니까?

해결책

Looks like I can do it like this in my html file...

<div>{{i18n('errIncorrectSpecies', {'0':'test','1':'test2'})}}</div>

I'm going to see if I can do this programmatically in my angular directive instead of in the HTML.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top