Home > Enterprise >  How to make React app that support multilanguage?
How to make React app that support multilanguage?

Time:11-05

I have reacted app and there are many components, and I want that the text will support multiple languages, I mean if the user wants English then all content of the component translates into English.

I try to add multilanguage in my react app using the i18next library but I found that I need to write all text in every language and store somewhere then use that.

But I want it when the user selects language and then it translates into the desired language without hard code.

like when we write anything in google translator then it translates all the page with the desired language.

CodePudding user response:

If you want the content of your site to be machine translated on the go, then some browsers (if not all of them) have this built-in functions. Just right click and "translate" the page. So maybe you should just mention about this function somewhere on the page?) But if you want the content of your site to be professionally translated, then you've got to store it in the db. And depending on the global language state (which could be managed with redux), the content in selected language will be rendered.

CodePudding user response:

Live translation on your website is not a good idea.

Alternatively, checkout translate.i18next.com

like google translate but for i18next.

  • Related