Page MenuHomePhabricator

Adjust autocompletion in language selection to avoid unexpected language names
Closed, ResolvedPublic


Compact language links allow the user to search languages in any language. This is convenient since users may look for a language such as Spanish by "spanish", "español", etc.

However, this also may result on the autocompletion to show results in languages unknown to the user that may cause confusion. For example, when reading a article on English Wikipedia, I try to search for Spanish by typing "spa" and I get the suggestion of "spanyänäpuk" which I assume it refers to Spanish, but I'm hesitant to confirm such selection. In this case it may have been better to give priority to the languages more close to the user context (e.g., the language of the wiki, and common languages) instead of going alphabetically.

es-selection.png (429×873 px, 48 KB)

Event Timeline

Pginer-WMF renamed this task from Adjust language autocomplete to prioritise the current language to Adjust autocompletion in language selection to avoid unexpected names.Jun 15 2016, 7:11 AM
Pginer-WMF renamed this task from Adjust autocompletion in language selection to avoid unexpected names to Adjust autocompletion in language selection to avoid unexpected language names.
Pginer-WMF created this task.

I had a quick look on this code and submitted small cleanups starting at

To implement this, we need to store the language of the translation as well. Then we need to figure a way to prioritize matches. We could try to apply some heuristics such as try autonym first, then user and wiki language, then common world languages that are not user specific or which we know already. Alternatively the client could pass an ordered list of preferred languages that we would use.

IMO, we need to think whether the effort and added codebase, proportional bugs really worth it. I am more inclidend to keep it simple and predictable and less intelligent

To me it's not about complexity (just make it as complex as needed and not more) but priority. The existing code is not simple nor predictable, so I tried to simplify it in the patches.

As a user this issue makes the experience less than smooth.

It seems that the current behaviour is already showing expected results (autocompleting the autonym or the name in the language of the current wiki). I illustrated the same example as in the original ticket and the unexpected results (such as "spanyänapük") are not shown as suggestions for either "spa" or "esp":

Screen Shot 2018-02-05 at 08.12.32.png (519×653 px, 43 KB)
Screen Shot 2018-02-05 at 08.12.04.png (578×1 px, 56 KB)

I tried for other languages, and the result seems consistent (I filled a separate small bug for the way iso codes are autocompleted that I found in the way, T186480 ). Overall, I'd recommend to close this ticket.

Arrbee moved this task from QA to Done on the Language-2018-Jan-Mar board.