l.t.i.p.AlternativeLanguageVocabularyFactory : class documentation

Part of lp.translations.interfaces.pofile View In Hierarchy

Gets vocab for user's preferred languages, or all languages if not set.

This is an IContextSourceBinder returning a Vocabulary. It's meant to present a short but complete list of languages a user might want to translate to or get suggestions from.

Guessing based on browser languages is probably not a good idea: that list may easily be incomplete, and its origin is not obvious. From the user's point of view it would be Launchpad behaviour that cannot be changed by pushing buttons in Launchpad. And even in cases where a guess based on browser settings is reasonable, it would mask the need for a useful Preferred Languages setting. We can't encourage people to manage their languages shortlist in Launchpad through their global browser configuration.

Instead, if no preferred-languages setting is available (e.g. because the visitor is not logged in), this will fall back to a vocabulary containing all known translatable languages.

Method __call__ See IContextSourceBinder.
def __call__(self, context):
See IContextSourceBinder.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.