wikimedia / jquery.uls

Universal Language Selector
Other
78 stars 65 forks source link

Need way to limit/filter languages to be listed/searched #26

Closed bvibber closed 11 years ago

bvibber commented 11 years ago

For selecting the UI language from all conceivable choices, right now we've got it pretty good.

But to use the ULS for selecting which language Wikipedia edition to use, or which translated version of a wiki article to view, we really need to be able to limit the list to just those that are available -- some languages don't have a Wikipedia instance, and most articles aren't available in the full spectrum of wikis either.

It looks like this could be done by manually filtering the full data list when initializing, but that looks awkward; if I could pass a filter list similar to the quickLinks list that'd be handy.

kushaldas commented 11 years ago

This requirement is actually came up while talking with Mozilla developers. Should be a must have feature.

santhoshtr commented 11 years ago

This option is already available and documented here: https://www.mediawiki.org/wiki/Universal_Language_Selector/Technical_Design#Options

languages Languages to be used for ULS, default is all languages supported by ULS ($.uls.data.autonyms()). If you want to work with a subset of languages pass that list here. The value should be an object with key as language code, value as language name to be displayed in the list.

bvibber commented 11 years ago

Great, I see how to use that now and am using it on my branch. :D Thanks!