Mpondomise Mpondomise - 11 days ago 5
AngularJS Question

angularjs translate-value to get the value from i18n file

I have the following html code to get angular to translate the label from

dash.title
and the span text from
errors.correct
.

<label translate="dash.title"></label>
<span class="success text-small" translate="errors.correct" translate-values="{ fieldname: 'dash.title' | translate }"></span>


my
errors.correct
in the i18n file is like this:

"errors": {
"correct": "The « {{fieldname}} » is correctly filled out!"
}


so my
fieldname
has to get the value from the
label
, it should be the same as the label text.
Why this setup is not working? what is the solution?

AHC AHC
Answer

here is the solution:

translate-values="{ fieldname:'{{'dash.title' | translate}}' }"
Comments