I have a site, with spanish and english version, english being default
and links which should change the language and keep it throughout the
user session. I have my resource files, the problem is about selecting
and keeping the uiculture.

About it, I was thinking/trying the following:

* If the query string has lang = es/en, then that should be the
UIculture used from that time till the end of the session
* If the user clicks in one of the buttons, then obviously the
UICulture would change till the end of session
* Ideally, all throughout the session, the language still always show
in the url, perhaps unless default (not soo important)
* Ideally, if the user didn't click any button or set lang in the
query string, choose it from ip, or browser settings, and if not
possible, then default (i think this is a whole other issue that i
haven't even started to look into yet ;), not part of the problem yet)

Any similar thing would be fine if it simplifies implementation
considerably.

My problems are:
I use a masterpage. I coudln't, from the the masterpage, override the
Page.InitializeCulture method. I have to check the query string and/or
session blah blah BEFORE the controls load, so they can choose the
correct resource files. Also, if I'm using session, i need to do it
after the session is available to me ( I think that was the problem
when i tried it in Application_PreRequestHandlerExecute in
global.asax ).
As to the issue of keeping the language always in the query string,
not sure how i'd do that (won't start manually programming to change
all the links and stuff in all the pages so that they add the query
string of the current UICulture to their href/NavigateUrl/whatever).
But I know session ID can be saved in URL instead of cookies, so I
guess asp.net has a way of doing that automatically, already
implmeented, right?

Thanks for your time :)
Rui Rojo

Reply via email to