473,398 Members | 2,335 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,398 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 4528
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.