I have a asp.net core web application. My application has some reactjs components, that runs client side.
In my asp.net core views, i use IViewLocalizer to localize my pages and it works just fine.
I have found some projects like react-localization to handle this on reactjs. To use it, I need to do one of the following:
My question is, what is the best approach to bring localization to reactjs components?
When i posted this question, i had a simple react application with less than ten resources. I chose the number one option, in my view create an object with my resources and give it to react because it is a more simple solution.
On another big react project, i chose the number two option: create an endpoint that return my resources and call it inside reactjs. It is a bit more complex, but all logic is inside reactjs and the html does not have a giant script object with all resources.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加