473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Where do I set CurrentUICulture

Ken
Hello,

I am trying to learn how to build a localizable windows application
and am having trouble getting alternate languages to display when if
stop hardcoding the culture settings. The line where I hard code the
CurrentUICulture is in the form's constructor and is like:

Thread.CurrentThread.CurrentUICulture = new CultureInfo("pt-BR");

When this line is present, the form displays in Portuguese.

However, once I comment out this line, I always see English, and never
the other languages. I'm trying to display the Portuguese form
without hardcoding the culture setting.

I think this is related. The variable
"System.Globalization.CultureInfo.CurrentUICulture " always returns the
value "en-US". I am guessing that if the value of this variable
changes, then so would the localized resourced file used in my
application.

Where in the Win2000 OS do I change this value? I was thinking it
would be under Regional Options in the Control Panel, but nothing I
change seems to affect that variable.

Thanks,
-- Ken
Nov 22 '05 #1
1 4525
CT
Ken,

Here's what the MSDN help doc says:

-------------------------------------------------
When a thread is started, its UI culture is initially determined by using
GetUserDefaultUILanguage from the Windows API
-------------------------------------------------

--
Carsten Thomsen
Enterprise Development with Visual Studio .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Ken" <ke*******@hotmail.com> wrote in message
news:9a**************************@posting.google.c om...
Hello,

I am trying to learn how to build a localizable windows application
and am having trouble getting alternate languages to display when if
stop hardcoding the culture settings. The line where I hard code the
CurrentUICulture is in the form's constructor and is like:

Thread.CurrentThread.CurrentUICulture = new CultureInfo("pt-BR");

When this line is present, the form displays in Portuguese.

However, once I comment out this line, I always see English, and never
the other languages. I'm trying to display the Portuguese form
without hardcoding the culture setting.

I think this is related. The variable
"System.Globalization.CultureInfo.CurrentUICulture " always returns the
value "en-US". I am guessing that if the value of this variable
changes, then so would the localized resourced file used in my
application.

Where in the Win2000 OS do I change this value? I was thinking it
would be under Regional Options in the Control Panel, but nothing I
change seems to affect that variable.

Thanks,
-- Ken

Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

47
by: Andrey Tatarinov | last post by:
Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable...
0
by: Ken | last post by:
Hello, I am trying to learn how to build a localizable windows application and am having trouble getting alternate languages to display when if stop hardcoding the culture settings. The line...
2
by: Olaf Baeyens | last post by:
A question: (C#, C++) If I use iValue.ToString("000000000000",CultureInfo::CurrentUICulture)); The I get a string with a fixed lengt if format: "000000542663" But since I want the leading "0"...
1
by: DZoid | last post by:
Hi, I have an asp.net page that uses a component in my business tier, which in turn uses a component in my data tier. The business and data tiers are in separate assemblies. I set...
3
by: Reny J Joseph Thuthikattu | last post by:
Hi, If i put a month callender on a asp.net web form and specify the culture on the page directive like '<%@ Page language="c#" Culture="ar-OM"%> it will display the Month callender in arabic. ...
9
by: Edge | last post by:
hi, I am saving the user selected culture in a session variable so I can apply it back to all pages when refreshed and then load the proper .resx values. For that I am using global.asax
4
by: clintonG | last post by:
I tell ya, I'd really like to study a base implementation or have an outline of what I need to build a base implementation of a localized ASP.NET 2.0 page, an application better yet with at least...
4
by: Tedmond | last post by:
Dear all, My application allows users to switch languages at run time. I use the following code to change the UI Culture but all controls are remaining unchanged. ...
2
by: spig.marco | last post by:
Hi to all!, I've downloaded .net Framework SDK 2.0 and I have VB.NET2005 Express Edition, I would like to create multilanguage systems that changes with radio button. With Windows Localization...
1
by: =?Utf-8?B?SmVu?= | last post by:
I could get the correct System.Globalization.CultureInfo.CurrentCulture and System.Globalization.CultureInfo.CurrentUICulture when the my WPF application first started. While my application was...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.