Page MenuHomePhabricator

Better match language names when creating Wikidata items
Open, MediumPublic

Description

Similar to T132021, languages that have multi-word names ("Bahasa Indonesia", "Српски / Srpski"...) should be matched by any of the words, and not just the beginning. This would improve usability with no negative side-effects, and should be simple to do. The responsible function seem to be _considerSuggestion() in jquery.wikibase.siteselector.js

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald Transcript
thiemowmde triaged this task as Medium priority.Feb 28 2018, 8:06 PM
thiemowmde subscribed.

Special:NewItem is using OOUI now, which means this needs to be filled as an upstream feature request to improve the ComboBoxInputWidget we use.

The jquery.wikibase.siteselector JavaScript module mentioned is still used on the client, as well as sitelinkview on Item pages. That selector could also benefit from the same update.

I just noticed that the language selector in UniversalLanguageSelector already does exactly what is suggested here. I love it and would love to see it applied to OOUI.

Change 415377 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/Wikibase@master] Match all words, not only the first in siteselector.js

https://gerrit.wikimedia.org/r/415377

The language search (action) API is provided by the ULS extension. OOUI can't depend on it unconditionally.

Sure. That's not what I wanted to imply. What OOUI can do is to look at the UX pattern and apply it via it's own, independent client-side code. What a word-boundary is is defined in RegExp. OOUI can reuse this definition (being aware it will not work in languages where the idea of word-boundaries is a little different).

I just wanted to highlight alternative possibilities: given that the ULS language search api is way more advanced that just matching word boundaries, it would be useful to take advantage of it more widely instead of re-implementing it. This can be done by moving it to MediaWiki core or a library.

Oh, absolutely right. Thanks! It's just an other approach: I was more thinking in the line of teaching all suggesters to understand word boundaries, no matter what the content of the suggester is. Reusing the ULS API when searching for languages is definitely worth looking into!

Change 415377 abandoned by Addshore:
[mediawiki/extensions/Wikibase@master] Match all words, not only the first in siteselector.js

Reason:
Abandoning old changes not touched since 2018

https://gerrit.wikimedia.org/r/415377