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

Forums / Bugs & Issues / Lstring problem

Lstring problem

2 posts, 0 answered
  1. Nicolas
    Nicolas avatar
    156 posts
    Registered:
    19 Jan 2011
    02 Aug 2011
    Link to this post
    Hi,

    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.

    Regards,
    Nicolas
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 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");
    pm.SaveChanges();
    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");
    pm1.SaveChanges();


    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