473,839 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where do I set CurrentUICultur e

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
CurrentUICultur e is in the form's constructor and is like:

Thread.CurrentT hread.CurrentUI Culture = 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.Globali zation.CultureI nfo.CurrentUICu lture" 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 4561
CT
Ken,

Here's what the MSDN help doc says:

-------------------------------------------------
When a thread is started, its UI culture is initially determined by using
GetUserDefaultU ILanguage 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*******@hotm ail.com> wrote in message
news:9a******** *************** ***@posting.goo gle.com...
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
CurrentUICultur e is in the form's constructor and is like:

Thread.CurrentT hread.CurrentUI Culture = 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.Globali zation.CultureI nfo.CurrentUICu lture" 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
3665
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 sources. Usage could be something like: >>> res = where: >>> def f(x):
0
1186
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 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.
2
3786
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" gone, but still have the fixed string length I replaced it with this: iValue.ToString("###########0",CultureInfo::CurrentUICulture)); But to my suprise I get "542663" while I expected : " 542663" (note the
1
1768
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 Thread.CurrentThread.CurrentCulture and Thread.CurrentThread.CurrentUICulture in the .aspx page. The asp.net app, business tier, and data tier each have their own resource files.
3
4274
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. I want the same result for my windows application.Can any one tell me how can i do that?
9
3922
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
1189
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 some navigation. Not to be seen - yet - at MSDN. I looked at news://microsoft.public.platform.localization but there's only one news article showing a pair of ASCII hooters. I kid you not. A set of great big ASCII titties and nothing else. ...
4
16774
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. Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); Why? Anything that I need to do in order to refresh the controls?
2
3996
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 Resource I changed the label of my FrmMain.vb! and created automaticaly FrmMain.en.resx. When i lunch the command in FrmMain_load() .... Thread.CurrentThread.CurrentUICulture = New CultureInfo("en")
1
4554
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 running, I went to Control Panel - Regionals and Language Options to change the Format from English (United States) to Thai (ThaiLand), clicking a button in my application to get the latest System.Globalization.CultureCulture and...
0
9856
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10910
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10297
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7833
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4493
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4066
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3136
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.