Page MenuHomePhabricator

Add spelling variant name to the spelling variant selector
Closed, ResolvedPublic8 Estimated Story Points

Description

As an editor I want to see the name of the spelling variant in the spelling variant selector in order to better understand which language I am selecting.

Problem:
Right now we are only showing the language code. That is not as helpful as it could be for people. We should in addition show the spelling variant name.

Screenshots/mockups:
This is what it currently looks like in the new page:

image.png (439×592 px, 24 KB)

This is what it currently looks like on the old page:

image.png (646×734 px, 55 KB)

BDD
GIVEN a spelling variant selector is shown on Special:NewLexeme
WHEN entering a language code or spelling variant name
THEN the selector shows matches with both their language code and spelling variant name

Acceptance criteria:

  • spelling variant names are shown in addition to language codes

Notes

  • Matching is not fuzzy - Tun would open Tunisia but tsa would not
  • Matching looks at each word in the list, i.e. Tunisian Arabic would display if arabic entered
  • Do not need to match the name of the language in that language. only interface language supported (i.e. if interface is english, 日本語 would not work)
  • not case sensitive
  • same source of language names as the current special page

Event Timeline

Lydia_Pintscher renamed this task from Add language name to the language code selector to Add spelling variant name to the spelling variant selector.Apr 11 2022, 3:05 PM
Lydia_Pintscher removed Lydia_Pintscher as the assignee of this task.
Lydia_Pintscher updated the task description. (Show Details)
Lydia_Pintscher added a subscriber: Erdinc_Ciftci_WMDE.
Lydia_Pintscher subscribed.

@Erdinc_Ciftci_WMDE can you double-check this?

Task Breakdown Notes

  • We know that there is a mapping between language codes and language names. This mapping happens through the WikibaseLexemeLanguageNameLookup service.
  • For a NoJS implementation this list can remain a regular dropdown (@Erdinc_Ciftci_WMDE can you confirm?)
  • For the JS implementation, we will pass the language code mappings in through the init function via a specialized RL module constructing a JSON output of language code to language name, instead of the array of language codes.
  • This approach does require us to send the list twice and might have performance impact. However, we will profile the page load once we have launched the new special page and determine the best optimization at a later date T306537.
  • We will enable server side caching for the RL module definition, in order to speed up the response time and prevent the list from being constructed on each request. Example: SitesModule.php.
  • "Matching looks at each word in the list, i.e. Tunisian Arabic would display if arabic entered" → This refers only to substring from the beginning of each word. i.e. looking for "rab" will not produce "Tunisian Arabic".

Possible Plan of Action:

  • In WikibaseLexeme.git (T306512):
    1. Make language code to name mapping available as a RL module
    2. Inject it via the init() function
  • In new-lexeme-special-page.git (T306515):
    1. Read and include the option within the Spelling Variant Lookup component
    2. Implement the filtering logic for the lookup

Change 785310 had a related patch set uploaded (by Michael Große; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseLexeme@master] Show and filter language names in spelling variant lookup

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

Change 785310 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Show and filter language names in spelling variant lookup

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