Re: A question on ASP.net localization
From: Martin Dechev (decheff__at_hotmail.com)
Date: 03/01/04
- Next message: bruce barker: "Re: A question on ASP.net localization"
- Previous message: bruce barker: "Re: Need Advice on Viewstate"
- In reply to: JollyK: "A question on ASP.net localization"
- Next in thread: bruce barker: "Re: A question on ASP.net localization"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 1 Mar 2004 19:35:29 +0100
Hi, JollyK,
It is the CurrentUICulture property on the Thread class that is taken in
consideration by the Resource Manager to look up culture-specific resources
at run time. If you replace CurrentCulture with CurrentUICulture in the code
you posted, and if everything else works, you should be set.
Greetings
Martin
"JollyK" <JollyK@email.com> wrote in message
news:emSJ3i7$DHA.4052@tk2msftngp13.phx.gbl...
> Hi everyone...
>
> I am creating a web app that will support english and french languages.
>
> My code is fairly simple and it working fine. In my global.asax file I
have
> the
> following code in the Application_BeginRequest event.
>
> try
> {
> Thread.CurrentThread.CurrentCulture = new
> CultureInfo(Request.UserLanguages[0]);
> }
> catch(Exception)
> {
> Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
> }
>
> I have a resource file for french and a resource file for english, and if
> the browser langauge
> is set to french, then french info is displayed, and if the browser
> langauage is set to english,
> then english is displayed. So far everything is perfectly.
> My issue is, suppose the browser is set to Arabic, or Italian, or any
other
> langauge, I want to
> default it to English. How do I do this ?
>
>
- Next message: bruce barker: "Re: A question on ASP.net localization"
- Previous message: bruce barker: "Re: Need Advice on Viewstate"
- In reply to: JollyK: "A question on ASP.net localization"
- Next in thread: bruce barker: "Re: A question on ASP.net localization"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|