I am doing a risk reduction project to gather risks. It is not saying
that the real code would use different cultures in different threads.
That is just a idea in my mind and I wants to see the possible
solution if we do need it in future.
Also, I get this from another post:
"The CultureInfo.CurrentUICulture property defaults to the current
user interface language of Windows. Regardless of which system locale
setting
you choose, the application will load English resources on English
Windows. "
Supose I deploy the code to a UK site, by default the CurrentUICulture
will still be en-US (tested by create a virtual machine and set every
thing to uk related). However, I may have different resources for UK
and US, to let my code pick up UK resource, I am using this:
[DllImport("kernel32.dll", SetLastError = true)]
static extern short GetSystemDefaultLangID();
private int getSystemLcid()
{
short systemLcid = GetSystemDefaultLangID();
return systemLcid;
}
to get System Locale and use it to set current Cluture.
Is it the right way?
Cheers,
Jerry
> If you have interleaved calls to multiple cultures inside your application,
> you could explicitely pass a parameter to address the needed culture :http://msdn2.microsoft.com/en-us/library/system.resources.resourceman...
[quoted text clipped - 32 lines]
> > Many Thanks
> > Jerry
Patrice - 05 Jul 2007 10:59 GMT
You could also avoid this by using a multinlingual version of Windows. AFAIK
this is basically how most applications are working i.e. the user interface
lanugage is a particular settings, the date/time formats and other behaviors
are another specific settings.
Else you could also invent your own criteria (or even do this based on an
application specific user preference if you wish).
Not tried but check both the effect of your settings with Culture and
UICulture...
---
Patrice
I am doing a risk reduction project to gather risks. It is not saying
that the real code would use different cultures in different threads.
That is just a idea in my mind and I wants to see the possible
solution if we do need it in future.
Also, I get this from another post:
"The CultureInfo.CurrentUICulture property defaults to the current
user interface language of Windows. Regardless of which system locale
setting
you choose, the application will load English resources on English
Windows. "
Supose I deploy the code to a UK site, by default the CurrentUICulture
will still be en-US (tested by create a virtual machine and set every
thing to uk related). However, I may have different resources for UK
and US, to let my code pick up UK resource, I am using this:
[DllImport("kernel32.dll", SetLastError = true)]
static extern short GetSystemDefaultLangID();
private int getSystemLcid()
{
short systemLcid = GetSystemDefaultLangID();
return systemLcid;
}
to get System Locale and use it to set current Cluture.
Is it the right way?
Cheers,
Jerry
On 4 Jul, 10:50, "Patrice" <http://www.chez.com/scribe/> wrote:
> If you have interleaved calls to multiple cultures inside your
> application,
[quoted text clipped - 36 lines]
> > Many Thanks
> > Jerry
Mihai N. - 05 Jul 2007 11:07 GMT
> "The CultureInfo.CurrentUICulture property defaults to the current
> user interface language of Windows. Regardless of which system locale
[quoted text clipped - 6 lines]
> thing to uk related). However, I may have different resources for UK
> and US, to let my code pick up UK resource, I am using this:
Just set your CurrentUICulture to what you want.

Signature
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email