Try our conversational search powered by Generative AI!

Problem with Multi Language tabs

Hi We have a problem with multi language tabs in EPiServer. The problem is that in our Enterprise installation we have 38 sites with a total of 16 languages. Some sites have at least one language and others can have up to 4 languages. When entering edit mode in EPiServer all 16 languages tabs are shown for all sites even though we have specified in web.config, which languages should be supported on each site. We need a fix that can hide the languages that the current site doesn't have. // Jörgen
Feb 15, 2006 17:55
BTW. We are using 4.51 with hotfix 2 //Jörgen
Feb 15, 2006 18:00
Off the topic, but... Is the web.config setting (for selecting which languages to support on each site) custom made, or is this a built-in feature in EPiServer? Frank :)
Feb 16, 2006 13:48
Hi We are using the EPiServers Enterprise section in web.config See example below: and when you enter EPiServer edit mode you see the SE, DK, NO and EN Flags. // Jörgen
Feb 16, 2006 14:46
If you are refering to EPsLanguageSortOrder that's just the sort order as far as I know. By the way, the globalization support in EPiServer 4.60 have support for both sort order and available language per branch in EPiServer with a nice GUI. We will have a migration tool for those who choose to upgrade, all help to beta-test it is of course much appreciated =)
Feb 17, 2006 9:06
Hehe, good answer, but sadly it won't help us :) Yes, we are using the EPsLanguageSortOrder, and puttint them in each instance. But EPiServer does not seem to take the values from each instance. Another issiu is that we would like to put the language tabs after the "Common" tab, this because the editors fill the properties in the language tab before assigning a name to the page, triggering an error. /Kalle
Feb 17, 2006 9:21
Just as I thought... BTW, is there any way to fix Jörgen's situation in current released version? (Enabling only some languages for the different sites...) Thanks, Frank :)
Feb 17, 2006 9:36
We have been using the functions below and it works for one site. But it doesn't work when having multiple sites. So if anybody knows where and when we should call the hideNonSupportedLanguageTabs function, so that it works for several sites? global.asax protected void Application_Start(Object sender, EventArgs e) { EPiServer.Global.EPDataFactory.FinishedLoadingPage += new PageEventHandler(hideNonSupportedLanguageTabs); EPiServer.Global.EPDataFactory.LoadedDefaultPageData += new PageEventHandler(hideNonSupportedLanguageTabs); } /// /// Hides langauge tabs on multilanguage (edit mode) pages that is not supported by the current site. /// /// The invoking object /// Parameters, e.g. the page private static void hideNonSupportedLanguageTabs(object sender, PageEventArgs e) { string siteSupportedLanguages; try { siteSupportedLanguages = EPiServer.Global.EPConfig["EPsLanguageSortOrder"].ToString(); for(int i = e.Page.Property.Count - 1 ; i >= 0 ; i-- ) { PropertyData prop = e.Page.Property[i]; if (isSupportedLanguage(prop.Name, siteSupportedLanguages)) { continue; // To next iteration } // Remove the property and replace it with itself after the name and tab i changed e.Page.Property.Remove(prop.Name); String newPropertyName = prop.Name.Replace("___", "__"); prop.OwnerTab = -1; prop.Name = newPropertyName; e.Page.Property.Add(newPropertyName, prop); } } catch(Exception ex) { } } /// /// Checks if property belongs to the supported languages of the site. /// /// The property name to test if it specifying a supported language /// A comma-separated list of languages, each language described in two-letter abbreviation /// True if the property has a postfix indicating that it belongs to one of the languages in the list of supported /// languages or if the property is not language dependant, false otherwise. private static bool isSupportedLanguage(string property, string supportedLanguages) { string languages = supportedLanguages.Replace(" ","")+ ","; int separatorIndex = property.IndexOf(MultiLanguageRuntime.LANGUAGEPROPERTYSEPARATOR); //Check if property is multilanguage compatible if (separatorIndex >= 0) { string propLang = property.Substring(separatorIndex+MultiLanguageRuntime.LANGUAGEPROPERTYSEPARATOR.Length, 2); if (languages.IndexOf(propLang + ",") >= 0) { return true; } } else { //Property is not multilanguage, so should always be included return true; } return false; }
Feb 17, 2006 10:46
When in debug mode, do you get up the correct values from EPsLanguageSortOrder on each of the sites when navigating between them? If not, I suspect that the Enterprise config settings is not loaded correctly. Below is a method for returning a config set for a site based on some key setting. protected static NameValueCollection FindInstanceSettings(string project) { configEnum.Reset(); while(configEnum.MoveNext()) { if(configEnum.Value.GetType().ToString() == "System.Collections.Specialized.NameValueCollection") { System.Collections.Specialized.NameValueCollection instance = configEnum.Value as System.Collections.Specialized.NameValueCollection; if(Code.Common.GetString(instance["EPsProjectCode"]).ToUpper() == project) { return instance; } } } return null; } This method returns a NameValueCollection: public void SomeMethod() { NameValueCollection instance = new NameValueCollection(); instance = FindInstanceSettings("Site1"); } Frank :)
Feb 17, 2006 14:36
Sorry... These variables must also be present for the FindInstanceSettings method: protected static Hashtable configurations; protected static IDictionaryEnumerator configEnum;
Feb 17, 2006 14:38
I have a question to Frank. Are you working for ElektroPost? Because I need an answer from an ElektroPost employee to the question how can I make the language tab problem work with multiple sites and mulitple languages?
Feb 22, 2006 14:53
Feb 23, 2006 13:41
Has all sites the same database? If not, available languages is in the database. You probably knew that already. /HAXEN
Feb 27, 2006 13:36
Yes, all sites are using the same database. We have stopped trying to fix this bug (EPiServer can't recognize that the Editor has changed site, so EPiServer thinks that the language values is the same for all sites). We are instead trying to convince the customer to use 4.60.
Mar 05, 2006 13:01
If you don't want posts or help, send a mail to support instead. Frank, keep up the informative posts!
Mar 06, 2006 10:57
* 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.