wikimedia / jquery.uls

Universal Language Selector
Other
80 stars 67 forks source link

Search results are questionable. #359

Open JohnMcLear opened 4 years ago

JohnMcLear commented 4 years ago

Shouldn searching for "english" return

"English", "English (British)"

or at least


"English", "British English"```

?

Currently it just returns "English".
amire80 commented 4 years ago

It does return British English if it is one of the possible languages. For example, if you select the user interface language in Wikipedia, searching for English will show "British English", "Canadian English", "English", "Patois" (Jamaican), and "Ænglisc" (Old English). The language list is initialized separately for each instance, and the whole list is not always shown. Some instances include British English and some don't.

JohnMcLear commented 4 years ago

image

image

I don't just open issues for fun y'know ;)

amire80 commented 4 years ago

Oh drat. Sorry. I know why: Because on Wikipedia we also use the search service, which is separate from this jquery package.

Nikerabbit commented 4 years ago

Amir is right, the jquery.uls library only providers rudimentary prefix matching by default. You can supply the searchAPI parameter, e.g. https://www.mediawiki.org/w/api.php?action=languagesearch&format=json&formatversion=2.

You can also implement your own backend. We could also implement word-matching client side.