For much more details about this project, see https://www.mediawiki.org/wiki/Translatable_modules
Scribunto modules that are useful in more than one language need a convenient and uniform localization framework for translating their messages.
This is needed for modules that are used across wikis, and even for modules that are used in multilingual wikis such as Commons or Wikidata.
At the moment there is no such framework. Like templates, modules can be translated by copying the module code to another wiki, going through its wiki syntax, and changing the strings. This is very flexible, but also extremely inefficient because it creates a forked copy and severs the connection to the original module and doesn't allow proper code reuse and collaboration.
There is also the TNT system, which is based on the Translate extension's page translation capability, but it is primarily made for templates, and has various disadvantages (see T238411).
Some modules try to include capability for translations using arrays indexed by language code, but there is no uniform framework for it nor a tool that allows their translation without diving into Lua code.
It would be much nicer if modules could be translated the same way extensions are:
- Having the same underlying algorithmic and page layout code for all the languages, but separate translations.
- Using a dedicated translation interface so that translators wouldn't have to deal with any code or wiki syntax (probably with the Translate extension).
My user-level proposal for how this will be done is described in more detail on the page Global_templates/Draft_spec/TLDR and in even more detail on the page Global_templates/Draft_spec.
Some steps to making this reality:
- Some adaptations in the Translate extension: Showing translatable modules in the message group selector, and possibly other things.
- Decision on which syntax to use for inserting messages into the module code. This is already possible with https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Message_library , but could perhaps be enhanced.
- Decision on where to store the messages, and how to customize them per project.
- And probably more things.
Unlike templates, modules are probably easier and better equipped for becoming properly localizable. For example, it's desirable to allow the translation of of template titles and parameter names, because they are frequently used by end users who edit wiki content pages, but since modules are rarely transcluded directly into content pages, this feature is less essential for modules.
A truly comprehensive solution will only come around when it will be possible to efficiently share templates and modules across wikis (T41610, T52329, T121470), but some steps towards designing it and making necessary modifications in Translate can possibly be made earlier.
Some good steps towards designing and implementing such a thing were made in T122086: Use bot to share templates and modules between wikis, and a lot of the ideas from that project could be shared with this one.
This task is specifically for modules. Templates and gadgets have some similar requirements, but they are handled in other tasks. See also: