November Happy Hour will be moved to Thursday December 5th.

EPiServer 9 Upgrade - Context is missing in EPiServer.BaseLibrary

Vote:
 

I'm using following im my project

EPiServer.BaseLibrary.Context.Current["EPiServer:ContentLanguage"]

but after EPiServer 9 upgrade, i'm getting that "Context" is not available in the "EPiServer.BaseLibrary" any more. So what shall I do ?

#140607
Oct 25, 2015 0:57
Vote:
 

BaseLibrary and Implementation assemblies were removed in EPiServer v9. Use:

EPiServer.Globalization.ContentLanguage.Instance.PreferredCulture
#140608
Oct 25, 2015 8:17
Vote:
 

Valdis, if i want to change the ContentLanguage, if I set it as follow,is it correct ?

var culture = new CultureInfo("no");

ContentLanguage.PreferredCulture = culture;



#140616
Oct 26, 2015 7:48
Vote:
 

I would be cautious with this.. What is usage scenario for you? Why you are changing content language? Are you switching to different language in the site or need to fetch content in different langauge?

#140620
Oct 26, 2015 9:25
Vote:
 

I'm using this code in a situation where switching to different language in the site

There is a possibility of setting it is as

ContentLanguage.Instance.SetCulture("no");

but i'm not sure which one to use

#140627
Edited, Oct 26, 2015 11:13
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.