Set current culture programmatically?

Posted by Community Admin on 05-Aug-2018 17:46

Set current culture programmatically?

All Replies

Posted by Community Admin on 09-Mar-2011 00:00

I have the options

  1. Directories
    Example:
    domain.com/contact-us - English;
    domain.com/es/contacto - Spanish
  2. Different domains
    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

Posted by Community Admin on 15-Mar-2011 00:00

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?

Regards,
Pavel
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!

Posted by Community Admin on 29-Apr-2011 00:00

Hi,
Using

Thread

 

 

.CurrentThread.CurrentUICulture.Name
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.

 

Posted by Community Admin on 29-Apr-2011 00:00

Hello,

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.

Regards,
Ivan Dimitrov
the Telerik team

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

This thread is closed