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?
I still have not figuerd this on out, anyone?
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!
I guess this should be ok to:
var userMembershipInfo = _userMembershipService.GetUser(User.Identity.Name);
Nope, that did not work but yours did. Thanks again!