c# - Get localized list/site name from SharePoint 2013 on-premise with CSOM -
i have multilingual sites on sharepoint 2013 server (on-premise) , retrieve localized sites , lists name via .net managed api (csom) in c#.
i tried use "titleresource" property object web object , getvalueforuiculture() method :
var web = spcontext.web; var webtitleres = web.titleresource; var webfrenchtitle = webtitleres.getvalueforuiculture("fr").value; spcontext.executequery();
but crashes @ last line saying field/property doesn't exist:
i tried update web's "localeid" value showed in sample app office pnp project : check here
but server throw exception, saying don't have enough permission :
well, don't want update localeid on server, want locally retrieve localized titles seems wrong way.
how can retrieve localized title's string sharepoint server? missing?
update
for reference, seems titleresource , descriptionresource attributes accessible "online" version of sharepoint, yet msdn doc doesn't mention that, leading improper use of these :
it may usable in brand new 2016 version, btw. we'll see.
the uiculture should culture object.
try this:
blablabla.getvalueforuiculture(new cultureinfo(1036)).value;
Comments
Post a Comment