Try Now
More in this section

Forums / Sitefinity SDK / Set current culture programmatically?

Set current culture programmatically?

4 posts, 0 answered
  1. Bruno Michels
    Bruno Michels avatar
    125 posts
    16 Apr 2010
    09 Mar 2011
    Link to this post
    I have the options

    1. Example:
      domain.com/contact-us - English;
      domain.com/es/contacto - Spanish
    2. Example:
      domain.com - English;
      es.domain.com or domain.es - Spanish

    But is there a way to set it from a code? So accessing "/product" would go for the language I set in the code? I want to have a dropdown where user will select the language but I want to keep the same page url
  2. Pavel Iliev
    Pavel Iliev avatar
    140 posts
    18 Jul 2016
    15 Mar 2011
    Link to this post
    Hello Bruno Michels,

    We don't support this out of the box. You can try to switch the CurrentUI culture of the thread. Is there any specific reason to keep the url the same after switching the language?

    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. Shalaka
    Shalaka avatar
    50 posts
    24 Mar 2011
    29 Apr 2011
    Link to this post




    i am getting the current cultrure.
    But how do i set the current culture from code behind?

    In my project , i having one module which is culture specific and all other are non-culture.
    so i am going to show only culture images on the non-culture pages, but if user clicks only any image , it should reflct on same page.

    So i want to set the culture from code behind.
    Please help.


  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    25 Oct 2016
    29 Apr 2011
    Link to this post

    When you use Thread.CurrentThread.CurrentUICulture = someCult, this should show only the items for the language you set. Note that only Lstring properties of the media items are localizable -Title, Name. The exact image content is not localizable at this stage.

    Ivan Dimitrov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

4 posts, 0 answered