Community Wishlist Survey 2021/Translation/Easy and effective way to translate gadgets and userscripts

From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search
Random proposal◄ Translation  The survey has concluded. Here are the results!

Easy and effective way to translate gadgets and userscripts

  • Problem: Gadgets and Userscripts are an important part of the Wikiverse. There are numerous such scripts that are used by a large number of users. Currently, those scripts are often copy-pasted from one wiki to another, to allow to translate them into the local language of the wikis. By that process lots of duplicates emerge that need to be maintained and improved independently. Further often several different scripts exist for one problem, because the script was not known outside the origin wiki, often again due to the language barrier (as well as the issue of missing findability of scripts – but this problem is currently tackled by a different WMF project).

Some scripts have translations into multiple languages integrated (mostly on Commons/Wikidata), there are issues with that. See below.

  • Who would benefit: All editors and some readers
  • Proposed solution: There should be one simple way to make the user interfaces of an userscript/gadget translatable (known as i18n). The mechanism has to full fill the following requirements:
    1. Easy to use for tool developers. Something like mw.translate("English text") should be enough.
    2. The translations should be saved separated to the script. Probably as a page with content model JSON.
    3. All regular editors should have the rights to translate scripts. Which user group ("autoconfirmed", "editor", …) will be needed is up to debate but the current situation where only the script author and sysops can translate the script must be avoided.
    4. Translating should not require technical know-how. An easy-to-use user interface is required.
  • More comments:
  • Phabricator tickets:
  • Proposer: MichaelSchoenitzer (talk) 16:52, 21 November 2020 (UTC)Reply[reply]


  • point 1 is technically already possible. mw.msg() translates a message-key into a translated string (just like used in core). Gadget authors can add their own keys and translations by making a json table and importing each key with mw.messages.set(). It just lacks in terms of conventions for gadget authors on how to store the translations and to a large degree also people simply putting in the effort to consistently add internatinalization as well as a way in which more users can contributed with the translation process. —TheDJ (talkcontribs) 19:20, 21 November 2020 (UTC)Reply[reply]
  • Are you thinking of something like a Wikimedia Weblate instance, MichaelSchoenitzer? HLHJ (talk) 01:10, 24 November 2020 (UTC)Reply[reply]
  • This will possibly be addressed by the mw:Translatable modules project. Its initial scope is for Scribunto modules, but it may be extended also to gadgets. --Amir E. Aharoni (talk) 08:47, 27 November 2020 (UTC)Reply[reply]