Re: A question on ASP.net localization

From: Martin Dechev (decheff__at_hotmail.com)
Date: 03/01/04


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 ?
>
>



Relevant Pages

  • Re: internationalisation
    ... but if someone does File/Open they always get English if English is ... loaded or French if French is loaded for MFC. ... This way you can set the resource language independent of the OS ...
    (microsoft.public.vc.mfc)
  • New Website: English - French Picture Dictionary
    ... My French Picture Dictionary is a new online resource to ... learn French (or English) words in a fun way. ... and adults will find this new resource entertaining and educational. ... students so they may benefit from this new educational resource. ...
    (soc.culture.french)
  • Re: Problems with satellite library
    ... Dim ci As New CultureInfo ... > Also, unless I'm mistaken, you need to set the CurrentUICulture. ... >> I m able to create and use .resource file and to get text for my Control. ... >> To testingfor testing the language, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Change CurrentUICulture, controls doesnt refresh
    ... I found it reload all the resource strings and all the values are updated, ... when I debug the program I found a button .Text property is updated after changing the CurrentUICulture but the screen still showing the original language. ... The VS generated "InitializeComponent" not only loads string resource but also creates all the child controls. ...
    (microsoft.public.dotnet.general)
  • Re: resource files
    ... That would make it rather straightforward, for example, to copy the version information from one ..sys or .exe file to another. ... Or you could add, let's say, "French" and English version information to your driver. ... From the second, load the "French" resource, then delete it from the file and overwrite the original English resource with it. ...
    (microsoft.public.development.device.drivers)