Culture in generic handler

Posted by Community Admin on 04-Aug-2018 07:39

Culture in generic handler

All Replies

Posted by Community Admin on 24-Oct-2013 00:00

Hi,

I need to implement a site to support different lanaguages. Sitefinity handles showing details of items in different languages by redirecting the user to a language specific URL.

In my case, I need to show details of the child items from a dynamic module on the same page without a redirect. So I am making an ajax call to a generic handler to fetch child item details and display on the site. The problem is when the language is changed using the language selector, the custom widget gets proper culture in Thread.CurrentThread.CurrentUICulture but the handler gets the settings from the browser.

Is there a sitefinity setting that can be accessed in the handler to fetch culture and then culture specific details using  x.GetString("Title", culture) extension method?

Posted by Community Admin on 28-Oct-2013 00:00

Hello Dee,

 What I can suggest based on the information so far is something like this:

Thread.CurrentThread.CurrentCulture = new CultureInfo("fr");
                var title = item.GetValue("Title");

The code will get all french titles. This method can be useful if you know how many cultures your site and then assign the above snippet to the cultures you wish to display. It will involve augmenting your logic. Regards,
Ivan D. Dimitrov
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed