cplus
cplus

Reputation: 1115

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.correctin 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?

Upvotes: 1

Views: 758

Answers (1)

Marcel
Marcel

Reputation: 2794

here is the solution:

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

Upvotes: 2

Related Questions