Is it possible to change a episerver uses language programmatically?
We have many (>10000) users and i need to set all language to danish. I tried to change it directly in the database in the Profiles table of the membership database, and that does change the "Personal Language" setting on the Display Options tab but it does not change the language anyware else. I tried resetting IIS and use inconito browser but the issue persists. So i must do something wrong maybe i can use an API instead of direct manipulation in the database?
I am on a 2 month old version of Episerver
i have tried this code:
var user = EPiServerProfile.Current;user.Language = "da";user.Save();
i changes the language in the database and in the "Personal Language" setting but episerver still uses the old language.
By the way if i change the language in episerver in the "Personal Language" setting then it works
Try adding a call to ICurrentUiCulture.Save(string userName, CultureInfo culture) to your code-piece.
ICurrentUiCulture.Save(string userName, CultureInfo culture)
Try the below code-piece.
var profile = EPiServerProfile.Wrap(ProfileBase.Create(result.Username));profile.Language = "da"; profile.Save();
var profile = EPiServerProfile.Wrap(ProfileBase.Create(result.Username));
profile.Language = "da";
adding this fixed the problem:
Any idear where the information is saved in the database?