473,396 Members | 2,002 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,396 software developers and data experts.

How to change the current thread current culture at run time.



I have created a new culture :
Dim objCulture As New CultureInfo("he") //hebrew

When I tried to assign it to the current thread.

Thread.CurrentThread.CurrentCulture = objCulture
Thread.CurrentThread.CurrentUICulture = objCulture
This Caused an exception :
" Culture "he" is a neutral culture. It can not be used in
formatting and parsing and therefore cannot be set as the
thread's current culture. "
what is the problem ?

Nov 17 '05 #1
1 7504
Hi,

The right way to set neutral culture is by using CreateSpecificCulture
static function :

System.Threading.Thread.CurrentThread.CurrentCultu re =
System.Globalization.CultureInfo.CreateSpecificCul ture("he");

Neutral cultures are cultures that just the language set, without the
location.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2

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

Similar topics

3
by: gh0st54 | last post by:
Hi I have created a custom web control wich uses a couple of labels, txtbox and calendars I can change the culture of the txt and lbl no problem , how can I do the same for the calendars ? ...
3
by: cmrchs | last post by:
Hi, I try to obtain the current culture of a server by executing : string str = Thread.CurrentThread.CurrentCulture.ToString(); Executing this in a console-applicastion results in the...
2
by: Joel D Kraft | last post by:
I'm using controls in my ASP.NET application from a couple of vendors. Between the vendors and thier versioning, I've set up subfolders under my bin directory: bin bin\Infragistics\v5.2...
1
by: Joseph Geretz | last post by:
Why isn't the ASP.NET runtime providing a valid reference for this object to my WebService? I'm trying to use WSE and DIME to send attachments via Web Service. I've provided a whole lot of...
1
by: Lloyd Dupont | last post by:
I'm trying to write a multilingual web site where the user could choose his language explicitely. I have 2 flag, the user could click on the flag to change the culture. The core of the logic goes...
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: 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. ...
6
by: bojan.pikl | last post by:
Hi, I am making a calendar. It is costum made and I would like to have the ability to choose the first day (Monday or Sunday). I know for the firstDayOfWeek, but I can't change it. What should I do?
0
by: =?Utf-8?B?RW1pbA==?= | last post by:
Hi all, I’m very very new in C#/WPF world, but this fascinates me more and more. Now I must find a way how our future application will use the localization / globalization. I did all the steps...
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: 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
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:
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...
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.