Reputation: 741
We have a big live site that uses Asp.Net WebForms and a lot of client side JS, with a lot of hard coding and dynamically created content on the client side.
We need to convert it to be multilingual using resource files on the server side. What is the best way - AJAX calls, or maybe create a JS file that will be populated with all necessary multilingual content for every page? Or another technique?
Upvotes: 0
Views: 185
Reputation: 189
The best way would be for your .NET application to manage all this. The FE shouldn't care about the language the site is. So the best thing to to would be to check where ever you have text populated by the JS and make you .NET application to render it instead. It is quite a bite of work but it is the most efficient and flexible way to do it.
If you really can't take this time, as a solution I would get the JS files have translated sentences as it would be easier in the future to roll everything out in the Back-End solution.
If you start using the Ajax requests you will end up having lots of Ajax calls and dependencies to your APIs and stuff, that will be a lot harder to maintain.
Upvotes: 1