I've set up my application so that the contents are read from different RESX files, according to the pattern that the router recognizes. Every page is accessible in a certain language depending on the first part of the URL.
routes.MapRoute(
name: "Localization",
url: "{lang}/{controller}/{action}/{id}", ...
);
When I'm testing with no specification, I get to the English version of my Lingo.REXS and when I put in se, I get to the Swedish version, i.e. Lingo.se.RESX. Everything's fine this far.
However, I'm not sure how to let the user control the setting of the language. I don't want it to be automatic nor assumed based on the browser's settings, geo-data etc. I basically want three flags (img controls) that somehow magically set that user (or at least that browser session) to be routable with the prefix corresponding to the language of the flag clicked.
So, we have /se/Home/About and /ge/Home/About. The user clicks on the German flag - how do we route them to the latter? And if they click on the Swedish flag - how do we route them to the former?
I've verified with this blog but it doesn't address the actual issue with how to route into a certain language depending on the clicked flag image. I've also found this blog but I simply don't understand how they do it. I see a bunch of calls to a DB so I suspect that it's not based on RESX files (and my understanding is that it's the proper way to go), although there's also some reference to @TestResource.
Right now I'm confused and uncertain. Any suggestions or clarifications?