Culture in generic handler - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Culture in generic handler

  • Culture in generic handler
  • 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?
  • 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
    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