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

Discussion in 'ASP .Net' started by Manu, Jul 20, 2003.

  1. Manu

    Manu Guest

    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 ?
    Manu, Jul 20, 2003
    #1
    1. Advertising

  2. Manu

    Natty Gur Guest

    Hi,

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

    System.Threading.Thread.CurrentThread.CurrentCulture =
    System.Globalization.CultureInfo.CreateSpecificCulture("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!
    Natty Gur, Jul 20, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    429
    Scott Allen
    Feb 25, 2005
  2. Shapper
    Replies:
    0
    Views:
    434
    Shapper
    May 5, 2005
  3. Edge
    Replies:
    9
    Views:
    11,977
  4. Pierre Yves
    Replies:
    2
    Views:
    470
    Pierre Yves
    Jan 10, 2008
  5. Replies:
    3
    Views:
    169
Loading...

Share This Page