Aller-Couleur / handlebars-i18n

handlebars-i18next.js adds the internationalization features of i18next and Intl to handlebars.js
Other
16 stars 6 forks source link

How to translate same keys differently in different contexts? #28

Open joerg-walter-de opened 3 years ago

joerg-walter-de commented 3 years ago

Let's say, I have the two keys ok and not_ok that are used as state:

{ a: { state: 'ok' }, b: { state: 'ok } }

But it has to be translated in the a context into 'Yes' and in the b context into 'Fine'.

Is it possible to do that and if so how?

Somehow I would have to write this:

<p> {{__ "ok"}} </p>

But I would like to write something like:

<p> {{__ "ok" context='a'}} </p>