Page MenuHomePhabricator

Create a framework for localizing templates titles and parameter names
Open, Needs TriagePublic


When templates will be global some day (T6547, T52329), it will be essential to make it possible to use them in wiki syntax in the language of each wiki.

The initial description doesn't offer the technical architecture for a solution. In particular, it doesn't offer the way in which the translations will be stored. Perhaps it will be something like Wikibase, perhaps an MCR slot, perhaps a JSON page in TemplateData or some other format, and perhaps something else. Whatever works well for the comfort of template maintainers and template users (editors and readers), as well as performance and stability.

Localization process
Whereas the user interface messages of the template must obviously be translatable in the Translate extension, it's possible that it shouldn't be done for template and parameter names. They shouldn't be changed frequently because the names may be quite technical and because it can break existing transclusions. There should nevertheless be a dedicated editing interface. If TemplateData will be used for storage, perhaps it can be integrated with it.

The main requirement of global templates is making them immediatly usable in all wikis once they are published. Therefore:

  • Localization must be optional, and the template must work even if its name was not translated.
  • As with tags and parser functions, the English name should be the default and work everywhere, even if it is translated.
  • In wikis where the content language is not English, both the English and the localized name must work.

For more on the initial proposal on doing this, see the Global templates draft spec, especially the sections Localizing the template name "Localizing parameters".

Localizing titles of Scribunto modules and parameters could possibly also be nice, but it is less necessary because modules are more rarely used directly in articles by end users, and are even more code-oriented than templates.