More in this section

Forums / Developing with Sitefinity / localization current culture

localization current culture

4 posts, 0 answered
  1. yuval
    yuval avatar
    2 posts
    Registered:
    25 Jan 2009
    26 Feb 2009
    Link to this post

    Hi,

    How do i get the current selected language from code?
    for example, i have a site with three languages enabled English, Franch and German.
    i want to display content (not generic content control) according to the selected language.

    thanks in advance

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    26 Feb 2009
    Link to this post
    Hello yuval,

    How do i get the current selected language from code?

    You could try the following:

    if(Thread.CurrentThread.CurrentCulture.Name.ToString() == "en-US"
      { 
        // do something here here 
      } 

    I hope this helps.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. yuval
    yuval avatar
    11 posts
    Registered:
    23 Jun 2008
    02 Mar 2009
    Link to this post
    thanks for the reply.

    this one did the trik:

    System.Threading.

    Thread.CurrentThread.CurrentUICulture.Name

    yuval

     

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    02 Mar 2009
    Link to this post
    Hi yuval,

    I am glad to hear that the example is helpful for you.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered