Hi Jelle,
It is currently a limitation in hosting multiple sites with a single installation that they all share the same web.config so any settings there are common accross them including the globalization settings. Default settings shown here for reference:
<globalization
culture="auto:en-US"
uiCulture="auto:en"
requestEncoding="utf-8"
responseEncoding="utf-8"
fileEncoding="iso-8859-15" />
Note that in the recommended default settings "auto" means use the preferred language of the browser and the en-US after the colon means if no resource is found for the browser language, then use en-US
Using these settings ASP.NET automatically sets the culture of the executing thread to the culture of the browser.
If you specify a different culture for the default after the colon, then the file you specify must exist and must not have any missing keys vs the en-US resource file or you will get null reference exceptions when a missing resource is encountered.
It seems appropriate to me to use the browser language if possible in all sites to ensure the user can read buttons and labels though it is possible to force a specific culture for all sites by removing the auto: part. Maybe in some cases it is desirable to do this but it seems like a corner case to me and I don't recommend it. Of course the language of the content is what it is in the db.
If you really want to implement support for it I will consider adding it if you follow these guidelines.
1. use web.config settings to override not site settings. It should only be configured by server admins not site admins so it should not be offered in sitesettings. I would have one setting to enableforcedculture and then one setting for each site like site1forcedculture= , site2forcedculture= , corresponding to site ids. If not found for given site don't override.
2. the place to implement override would be in Application_BeginRequest, it could be done in global.asax.cs but ideally if it can be done in an httpmodule that would be better so it can be unplugged completely.
3. Once you have determined whether to override and what culture to use doing the logic, then its really only 1 line of code to change the culture of the executing thread.
Thread.CurrentThread.CurrentCulture = someCultureInfoobject;
Joe