LanguageSelector: Order of Appearance
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
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
Hi,
I've the exactly the same problem now. Can you tell me how did you fix that ?
Thanks
Regards
Julien
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
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
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