Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi Kristoffer,
This is how it's done in CMS 12:
// constructor injection...
private readonly IPrincipalAccessor _principalAccessor;
private readonly IUserMembershipService _userMembershipService;
...
var userMembershipInfo = await _userMembershipService.GetUser(_principalAccessor.CurrentName());
var language = userMembershipInfo.Language;
Hope this helps!
Thanks Dejan!
I guess this should be ok to:
var userMembershipInfo = _userMembershipService.GetUser(User.Identity.Name);
/Kristoffer
Hi!
In CMS 11 I could get the logged in persons languagesettings usign this:
var profileLanguage = EPiServerProfile.Current.Language;
How is this done in CMS 12? I cannot find anything in the documentation?
Thanks!
/Kristoffer