handlebars-i18n icon indicating copy to clipboard operation
handlebars-i18n copied to clipboard

How to translate same keys differently in different contexts?

Open joerg-walter-de opened this issue 3 years ago • 0 comments

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>

joerg-walter-de avatar May 28 '21 09:05 joerg-walter-de