We upgraded from Kentico 8.2 to (9 and then to) 10 and lost our Language Selector. It was in our master page and appears throughout our site. We've switched to the LanguageDataSource but it was not returning all available languages. Rather, it was returning only the languages into which the current page was translated. In other words, if the current page has English and German versions, the language data source would only return English and German, but not Spanish, even though we have Spanish enabled in Kentico.
We found the checkbox which excludes untranslated pages (and defaults to checked) and unchecked it. This appeared to fix the problem, as English/German pages now showed the French option as well. However, we learned that when an unauthenticated user views the same page, (s)he only sees the English and German.
How do we get the language data source to return all available languages, rather than just the languages into which the current page has been translated, and get it to do so for all users, rather than just authenticated users?
0
votes
Out of curiosity, are there any French pages available to an unauthorized user? The logic may look for all pages they have access to and get the distinct list of those languages. Also have you tried clearing the cache?
- Trevor F
Yes, there are some pages with French translations. I've also cleared the system cache.
- Rob M
@RobM; what behaviour did your old selector have? Did it just attempt to redirect the current page, or was it redirecting back to the root of the site in the selected language? Which of those behaviours are you aiming to replicate?
- mnield
2 Answers
0
votes
This functionality was probably dropped in the version 9. There's probably no way of doing it without a piece of custom code. However, you can recover the abandoned web part as described in the documentation.
0
votes
It turned out that the master page had two language data sources on it. One was used for desktops and one for mobile. The strange behavior was due to the mobile one having the 'exclude untranslated pages' checked. The result of this was being cached and was also being used in the desktop one. We removed the extra data source (though it probably would have worked fine if we had just unchecked the exclude box in the mobile data source) and the remaining one behaves as desired. Thanks, everyone, for the input.