Globalization pb

F

Franck

Hello
i try globalization for the first time
following step by step this link:

http://msdn.microsoft.com/asp.net/d...rary/en-us/dnaspp/html/aspnet-globalarchi.asp

I have a directory called resx, within 3 resx ressources
called basic.resx (english)
basic.fr.resx (french)
basic.en-CA.resx (english/Canada)

code
-----------------------------
setting the culture in the login page;

CultureInfo ci = new CultureInfo("fr");

System.Threading.Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(ci.Name);

System.Threading.Thread.CurrentThread.CurrentUICulture = ci;

in a page

ResourceManager m_rm = new ResourceManager("MES.resx.basic",
System.Reflection.Assembly.GetExecutingAssembly());

lblNav.Text = m_rm.GetString("Welcome.lblNav")+ Request.Browser.Browser;
------------------------

but it doesn't change to french...

what am I missing?

thanks

Franck
 
B

Brock Allen

You need to reset the Thread's UICulture upon every request. Setting in the
request for the login page doesn't make it persist across to another request.
I'd suggest doing this in global.asax in the Application_AuthenticateRequest
event, at which point you will know who the user is and you can lookup their
preferred culture from your DB (or cache).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top