LanguageSelector: Order of Appearance

Posted by Community Admin on 03-Aug-2018 14:47

LanguageSelector: Order of Appearance

All Replies

Posted by Community Admin on 26-May-2011 00:00

Hi,

I've got a LanguageSelector widget in a page template used by all my pages.
I have two languages enabled, and translatations in each for all my pages.
The problem I experience is that the order in which languages appear vary from one page to another. For instance, on my home page I have "français" and then "English", but if I navigate on another page I get "English" first, and "français" second.

Any ideas on how to fix this?

Regards,
Carl

Posted by Community Admin on 30-May-2011 00:00

Hi Carl,

Can you tell me what steps you followed when adding translation to the pages?

I could not reproduce the problem when:

1. Create a page in English.
2. Create page # 2 in English.
3. Added French to page#1, when asked if I want to sync the pages, said OK, and ticked the box in the popup.
4. Same for page#2.
5. Dropped the Language widget, checked the box where it says: Include current language in the selector. ( check attached screenshot )
6. Same for page#2.

Finally when I was browsing the pages the order of translations did not change in the widget.

All the best,
Victor Velev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 29-Sep-2011 00:00

Hi,
I've the exactly the same problem now. Can you tell me how did you fix that ?

Thanks

Regards
Julien

Posted by Community Admin on 30-Sep-2011 00:00

Hi,

Since it was at the very beginning of my project, I started over a new site and the problem didn't show up this time..

Carl

Posted by Community Admin on 30-Sep-2011 00:00

Since I don't want to re-create all pages of my sites, I found another solution using a custom template for Language Selector Control widget. Here is the code I'm successfully using:

public class LanguageSelectorControl : Telerik.Sitefinity.Localization.Web.UI.LanguageSelectorControl
    
        private List<string> languagesOrder;
        private List<string> LanguagesOrder
        
            get
            
                if (languagesOrder == null)
                
                    try
                    
                        languagesOrder = ConfigurationManager.AppSettings.Get("LanguagesOrder").Split(',').ToList();
                    
                    catch (Exception ex)
                    
                        languagesOrder = "fr,de,it,en".Split(',').ToList();
                    
                
                return languagesOrder;
            
        
 
        protected override IEnumerable<CultureInfo> GetLanguagesToDisplay()
        
            return base.GetLanguagesToDisplay().OrderBy(o => LanguagesOrder.IndexOf(o.TwoLetterISOLanguageName));
        
    

Julien

Posted by Community Admin on 30-Sep-2011 00:00

Hello Julien,

Can you please provide more information about your project as well as which version of Sitefinity do you use. In our latest service pack 4.1 there were many fixes including such for ML support, so could you try and reproduce the issue ( and provide steps ) with our latest release?

Regards,
Victor Velev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed