Page MenuHomePhabricator

Use ULS for language selection
Closed, ResolvedPublic

Description

The Spelling Dictionary extension requires language selection for viewing words of the database. Presently, the language can be selected by using a dropdown of languages. The interface can be improved by replacing the dropdown by the extension:ULS.

Extension code available here.

Event Timeline

Ankitashukla claimed this task.
Ankitashukla raised the priority of this task from to Medium.
Ankitashukla updated the task description. (Show Details)
Ankitashukla moved this task to Admin Page on the SpellingDictionary board.

@Ankitashukla: Could you extend / elaborate the task description and provide documentation pointers for potential contributors?

@Ankitashukla: Could you extend / elaborate the task description and provide documentation pointers for potential contributors?

(And feel free to remove the GCI project here if you might have changed your mind and think this is too complex for a GCI student. Just saying :)

The Spelling Dictionary extension requires language selection for viewing words of the database. Presently, this is how the language can be selected, using a dropdown:

viewbylanguage.png (768×1 px, 100 KB)

The interface can be improved by replacing the dropdown by ULS.

@Ankitashukla this still needs clarification. You haven't mentioned:

  • if we have to replace the dropdown with ULS everywhere possible
  • how the final result should look (since ULS can look like many things, e.g. popup, another popup style, not popup), you should add a mockup or something

Thank you

The GCI student came to IRC asking for clarification, so I'm provisionally putting this out there, in the hopes that Ankitashukla further clarifies what exactly needs to happen soon, otherwise I suggest the student should return the task as being unclear.

  • The code for this will go into the Spelling Dictionary extension, specifically its "/specials/SpecialViewByLanguage.php" page
  • The code will have to check if ULS is present/defined
  • A new ResourceLoader Javascript module will need to be created, that can be added to this page. (Look for the addModules() function)
  • This new ResourceLoader module will depend on the relevant ULS JS modules.
  • The new ResourceLoader will probably have to do something similar to what happens here, to produce the language selector similarly to how it is used on the main page of TranslateWiki.

@Victorbarbu The dropdown currently is only a dummy implementation with a few languages. The purpose here is to replace the dropdown by the ULS by setting the position of the ULS trigger on some text like Select Language.

The dropdown exists on two Special pages -

  • where the user can submit valid words ("/specials/SpecialSpellingDictionary.php")
  • where you can select a language to view words of that language ("/specials/SpecialViewByLanguage.php")

Both these instances need to be replaced by ULS. One way of achieving this could be by using the jquery.uls. Look at the example given by TheDJ for reference.

What is needed here is a popup showing the languages when the ULS-trigger is invoked.

Thanks @TheDJ :)

Change 261911 had a related patch set uploaded (by Victorbarbu):
Replace language selection dropdown with ULS

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

Change 261911 merged by TTO:
Replace language selection dropdown with ULS

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

TTO subscribed.

Thanks TTO and Victor, this code duplication reduction is lovely. :)