More in this section
Forums / Bugs & Issues / Lstring problem

Lstring problem

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Nicolas
    Nicolas avatar
    156 posts
    19 Jan 2011
    02 Aug 2011
    Link to this post

    I encounter a problem on Lstring object, the method SetString(CultureInfo, string) doesn't work properly.

    In example :
    CultureInfo english = new CultureInfo("en");
    CultureInfo french = new CultureInfo("fr");
    Lstring textTrad = new Lstring();
    textTrad.SetString(english, "Langue Anglaise");
    textTrad.SetString(french , "Langue Frnçaise");

    In your object after that you obtains only the french version.

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    02 Aug 2011
    Link to this post
    Hi Nicolas,

    Could you try to set the CurrentUICulture and then work with the dataitem and set the Lstring property

    here is  a sample for pages

    var c1 = CultureInfo.CurrentUICulture;
    Thread.CurrentThread.CurrentUICulture = new CultureInfo(c1.Name);
    var pm = PageManager.GetManager();
    var firstFront = pm.GetPageNodes().Where(p => p.Id == new Guid("A1ADA077-2746-44B7-9B83-5C52282A8E4E")).SingleOrDefault();
    var tt = firstFront.UrlName.GetAllValues();
    firstFront.UrlName.SetString(c1, "CurrentUICulture");
    var ci = new CultureInfo("bg");
    Thread.CurrentThread.CurrentUICulture = new CultureInfo(ci.Name);
    var pm1 = PageManager.GetManager();
    var firstFront2 = pm1.GetPageNodes().Where(p => p.Id == new Guid("A1ADA077-2746-44B7-9B83-5C52282A8E4E")).SingleOrDefault();
    firstFront2.UrlName.SetString(Thread.CurrentThread.CurrentUICulture, "CurrentBgUICulture");

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    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
2 posts, 0 answered