2
I am aware of the existence of this question:
Internationalization using ASP.Net MVC
but I’m having some questions. I have these language files (I’ll have more in the future):
The system in question does not give any postback on the pages, so I have no way to change the text of the Abels in the backend. I am currently doing this with an AJAX call that fills an array of strings in javascript with the current language texts.
But it seems to me to be either a huge gambit, or extremely slow/succinct to problems.
Is there "the right way" to do this? What would be?
Let’s try again. Well, your application is a SPA then? Did you mean in the body of your question that no request is made to the server after the first upload? (Except by ajax, obviously)
– Jéf Bueno
It is not a SPA. But yes, pages only make Ajax requests (after loading). The first thing called on
$(document).ready
of each page is a methodcarrega_idioma
, that makes an Ajax request by filling a huge array with the current language texts, if it gets confused, I edit the question with more explanations– Artur Trapp
But I think if it was a Single-page application the solution would be the same one I’m looking for :), so if you know something...
– Artur Trapp
Well, if the app only has one page it’s a spa, it’s not?
– Jéf Bueno
But it doesn’t have only one page. It has several (seven or eight), and in each of them I make this request to load the language texts
– Artur Trapp
So. And to get to these pages no requests are made to the server?
– Jéf Bueno
Yes, they are made
– Artur Trapp
So why not use the files resx at the time of assembling these pages? In fact, tell me one thing: you speak in postback on the question, the system is really webforms? Or did you just use the term?
– Jéf Bueno