I have situation where I need to create translation support for React application I have already created using JSON support like react-i18n
but now I decided to create new functionality use adding HTML templates like it uses in PHP how can I Implement it and what do you think which way is more effective.
Asked
Active
Viewed 51 times
0

Karo Hovhannisyan
- 462
- 3
- 7
-
I'm sorry, I don't get what you mean with `like it uses in PHP` ? – Jonas Wilms Jul 10 '18 at 07:17
-
I want to use HTML templates and remove JSON support. That is to say for example I will use for `en` template `en.html` template and show it in DOM. Is it possible ? or it isn`t best way? – Karo Hovhannisyan Jul 10 '18 at 07:22
-
I'm not sure if that is easier, as you not onpy have to return a seperate html you also have to return separate react components – Jonas Wilms Jul 10 '18 at 07:24
-
I needed something similar, so perhaps this is useful to you too https://dev.to/chadsteele/usetranslator-a-react-translation-hook-13of – chad steele May 16 '20 at 22:37