Language question in Episerver 4.60

Hi, I've just upgrade from 4.51 to 4.60 and is using "globalization". Very impressed with the new language features! In edit mode I'm able to select the different languages from a dropdown list. On a certain edit page I have a custom property to needs to know in what language mode the current edit page is. Does anyone know how to get language key (e.g. EN) in the custom property's class ? Thanks! Danie
Apr 06, 2006 17:48
It kind of depends why you need it, a language specific property will always live on a single language but common will live on all languages. Our built in Edit page will always force LanguageContext.Current.CurrentLanguageBranch to the language of the current page being edited if that solves your problem. string langCode = LanguageContext.Current.CurrentLanguageBranch; You may also override InitializeData that will be called for every language that you property lives on. public override void InitializeData(ApplicationConfiguration config,PropertyDataCollection prop) { bool isLangSpecific = base.IsLanguageSpecific; string langBranch = prop["PageLanguageBranch"]!=null ? (String)prop["PageLanguageBranch"].Value : null; base.InitializeData(); }
Apr 07, 2006 9:37
* 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.