Multilingual Templates and Modules

Intro
This project describes how templates and modules can be kept in sync between multiple languages and projects.

Since the beginning of Wikipedia, language wikis copied templates, and users kept asking to be able to share the same templates and modules on multiple wikis, without spending precious developer time copy/pasting them between hundreds of languages and projects. It would be ideal for MediaWiki to support this functionality, but that turned to be much more difficult challenge than anticipated. This project is designed to work around MediaWiki limitation, while offering the so much needed functionality.

Method

 * DiBabel bot will copy templates and modules from mediawiki.org to all other sites/languages listed in Wikidata for that page.
 * A page will be copied ONLY if Wikidata item has "instance of" set to (Q63090714).
 * A page will be copied ONLY if the current content of the page exists in the history of mediawiki.org's (origin) version. E.g. if a user modifies English version of the page, it will not be overwritten unless that exact text ever existed in the history of the page on mediawiki.org.  To resume automatic synchronization, a user must copy the latest origin's version of the page. Note that simply reverting a page to an older version will not be enough, a page has to be different from any of origin's revisions (e.g. add a note why the page was modified)

Translating Content
There is very little value in having non-translated content copied as is. The Module:TNT was created specifically to solve that. Instead of storing English text in a module or a template, TNT allows them to be designed language-neutral, and store multilingual text in the tabular data pages on Commons. This way your module or template will use those translated strings (messages), or if the message has not yet been translated, will fallback to English. When someone updates the translation table, your page will automatically update (might take some time, or you can purge it), but no change in the template or module is needed on any of the wikis. This process is very similar to MediaWiki's localisation, and supports all standard localization conventions such as NaN undefineds and other parameters.

For a simple example, see Data:I18n/Template:Graphs.tab - a table with two messages, each message having a single parameter. By convention, all translation pages should have  Data:I18n/...  prefix to separate them from other types of data.

Global Modules
Just like templates, modules should also use TNT module for localization. TODO: lua example

Translating Template Parameters
Template parameters are usually stored as a JSON templatedata block inside the template's /doc subpage. This makes it convenient to translate, but when a new parameter is added to a global template, all /doc pages need to be updated in every language. TNT helps with this by automatically generating the templatedata block from a table stored on Commons. Placing this line into every /doc sub-page will use Data:Templatedata/Graph:Lines.tab table to generate all the needed templatedata information in every language. Even if the local community has not translated the full template documentation, they will be able to see all template parameters, centrally updated.