Lstring problem

Posted by Community Admin on 04-Aug-2018 09:15

Lstring problem

All Replies

Posted by Community Admin on 02-Aug-2011 00:00

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

Posted by Community Admin on 02-Aug-2011 00:00

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

This thread is closed