Ero Stefano
Ero Stefano

Reputation: 646

How can I use two translations on the same react app with i18next?

I am working on an app where the user can select several buttons. Those buttons need to be translated in the user's language. After the selection a text will be printed which needs to be translated to Japanese.

Input: Many languages Output: Always Japanese

I could not find any good example my for usecase with i18next on the web. Do you have any idea?

Upvotes: 0

Views: 803

Answers (2)

adrai
adrai

Reputation: 3178

You can pass the lng as options too: i18next.t('key', { lng: 'ja' })

Upvotes: 1

sanjar
sanjar

Reputation: 1101

I think you're trying to overuse i18next.

If you only need to translate the input, use the i18next on the input and hardcode the japonese text.

Upvotes: 0

Related Questions