1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Changing CurrentUICulture

Changing CurrentUICulture

4 posts, 0 answered
  1. DPC David
    DPC David avatar
    26 posts
    Registered:
    28 Dec 2009
    25 May 2010
    Link to this post
    Hi

    i have some Problems while changing the CurrentUICulture for my Newsletters. I have created my own Newsletter class
    which im initiating in a ForEach Loop. Before initiating im trying to change the current culture because the newsletter should be send in all languages which are supported in our sitefinity installation.

                culture = CultureInfo.GetCultureInfo(_langcode);
                System.Threading.Thread.CurrentThread.CurrentUICulture = culture;

    now in case im trying to send the newsletter for two lang. (en, de=default) all the contents are in german. In case im sending only the english newsletters, the content is in english.
    Do you have any idea what goes wrong

    Regards David
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    26 May 2010
    Link to this post
    Hello DPC David,

    System.Threading.Thread.CurrentThread.CurrentUICulture = culture; sets the current culture. Most probably something goes wrong when you pass CultureInfo.GetCultureInfo(_langcode); You could see what exactly is going wrong when you are in debug mode.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DPC David
    DPC David avatar
    26 posts
    Registered:
    28 Dec 2009
    26 May 2010
    Link to this post
    Hi

    i tried to debug the problem and i think it is a bug. If im not using the Loop and set the CurrentUICulture to "en" the ContentManager get's alle articles in english. That means my code is working but if i use the loop to get at first german (de) content and after this the english (en) content the Bug appear's again. The strange thing is that the ContentManager changed the language but the content object didn't notice the changing. I also had a look in your forum and found this post:

    http://www.sitefinity.com/support/forums/sitefinity-3-x/developing-with-sitefinity/getcontent-with-all-site-languages-problem.aspx

    This is exactly my problem. I used now the solution of Nadya and it works but im not very responsive by this coz it takes some performance which is not necessary.

    Regards David
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    26 May 2010
    Link to this post
    Hello DPC David,

    Take a look at this thread and the post from 5/13/2010 written by me. There is a video attached as well. I am not sure. The code that I am using there returns the correct items based on the culture. The problem is the code you use.  As far as I see you have also made some posts in the same thread.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
4 posts, 0 answered