2021:Submissions/Global templates, component templates/Notes

From Wikimania

Etherpad source: https://etherpad.wikimedia.org/p/wikimania2021-global-templates

Slightly edited while copying by Amir Aharoni.

SESSION OVERVIEW[edit | edit source]

Title
Global templates, component templates
Day & time
Saturday, August 14. 15:15-15:45
Session wikilink
https://wikimania.wikimedia.org/wiki/2021:Submissions/Global_templates,_component_templates
Speaker(s)
Amir Aharoni, Adam Wight
Notetakers
ADD NOTETAKER(S) HERE (I don't know who it was, and I'd love to know! Please add yourself! --Amir E. Aharoni (talk))
Attendees (optional, self-reported)
  • Count: 71

SESSION SUMMARY[edit | edit source]

Amir Aharoni[edit | edit source]

Templates like infoboxes are 80% the same across different language Wikipedias

Same for references

en.Wikipedia has half-million pages (incl. documentation) in Template: namespace

There is no global storage for this and much duplication

Lots of duplicated and forked code. This is bad practice.

The important thing is making more information available.

Helping small Wikipedias to get up to speed instead of taking years importing templates from other languages.

Global templates will allow these things to happen.

Solution proposed:

Repo to make it possible to store the code of the templates.

Not all templates have to be here, just like images on Commons: have local images on Wikis for various reasons.

Templates have lots of text! How to translate it?

Will look like translatewiki.

Very simple and robust. Propose it for templates.

Example: Citation needed template.

Use it in enwiki: look it up locally. If locally available, use it.

Same in ruwiki: if it exists with this English name, use it. Otherwise, look in global repo.

But in ruwiki, the actual name is "нет АИ", and it can be used, too. Template titles and parameter names will be translatable.

Don't want to make everyone use the enwiki templates! Allow everyone to innovate and use code from other languages.

Design doesn't have to be the same across languages.

This is just a proposal, not yet a project.

Translatable modules is already a project. This will allow convenient translation of LUA modules (initially) and later enable template translation.

"Templates Translation" (confusing name: should be more like "template adaptation"). The most common request in the Community Wishlist. If you want to copy a ref from dewiki to enwiki, for example, you need to translate all the parameters, and if this is implemented, it will become automatic.

Abstract wikipedia

{{Cite Q}} - templates powered by Wikidata. Intentionally developed for globalisation.

( https://en.wikipedia.org/wiki/Template:Cite_Q )

Vision! (Imagine a world...) If every single human can't use the same templates, we can't achieve the vision.

Adam Wight[edit | edit source]

Dawn of the transcluded templates:

Many elements are transcluded on wiki pages.

In three years, templates changed from text placeholders into Turing-complete monster.

Not everyone can edit templates!

If you've ever tried to import a template, you will note that they have dependencies. LUA modules, other templates, docs, styles, etc.

Special:export and special:import will only notice what's used on a specific page.

Intended to work on the MVC model, but nowadays, there is no model and the controller is lumped into the view.

Proposal is to encapsulate templates into single files, so that each template has all of the modules that it needs right there, including i18n.

If you want to make them portable, you need this.

PRESENTATION / SLIDES / LINKS TO MATERIAL SHARED[edit | edit source]

Slides for Global templates:

https://wikimania.wikimedia.org/wiki/File:Global_templates_-_Wikimania_2021.pdf

Slides for Component templates

https://docs.google.com/presentation/d/1UwNThnWPdGSe998ABZeGf7zuI7_yWF5lJTVQHoTeW-s/edit#slide=id.ge7bb911d47_0_11

Draft RFC for component templates

https://www.mediawiki.org/wiki/User:Adamw/Drafts/Component_templates_RFC

interactive sessions only: ACTION ITEMS / RECOMMENDATIONS / NEXT STEPS[edit | edit source]

See also https://www.mediawiki.org/wiki/Global_templates/Status

James Forrester (WMF) (he/him): I don't think I've seen any research about how readers think about infoboxes. Of course most readers are on mobile and so don't see infoboxes unless they click to expand them.

Isaac Fischer: We have some research on that at Fandom, @James.

Sam Wilson: it's interesting that some wikis include the brackets in the [cn] link, and some don't

Alex Stinson (Astinson WMF/User:Sadads): Infoboxes are iconic in that they are frequently one of those elements used in pop culture, i.e. in the netflix series Lupin or inspiration for things like Google Knowledge graph boxes

Andy Mabbett: Even routine code like imperial/metric conversion is duplicated between wikis

James Hare: I work with cross-wiki templating almost every day and it constantly flusters me, you see the same template multiple times on the same wiki

Mahir Morshed: Yes, I've discovered in the process of merging items about templates on Wikidata wikis with both English-named and local-named equivalents

James Hare:I have an idea for a "convergent templating" tool that could tide us over, I am looking for a tool developer to help me with this. It will tide us over until Global Templates redeem us

amador alvarez: catalan infoboxes, for instance. 100% WD powered

Dumisani [WMF]: This would really lower the high bar of tech-tax in small wikis, so that we con concentrate on content, instead of migrating complicated templates! Alles!

(Q&A only) QUESTIONS FOR THE SPEAKER[edit | edit source]

Do our readers like infoboxes?

there is research which shows they use them
Amire can't cite any paper [from memory], but a designer researched it, and readers like the unified look that make the articles appear more reliable. Make the WP brand more trustworthy.

There are templates that the English Wikipedia has specifically decided against (e.g.,  Support), but are common on other wikis. Will there be a way of blocking templates from being used?

One option is "just don't use them" and revert them if they do. For example in some wiki there might be a policy not to use certain images from Commons, and they don't use a filter for that. Could be done, though.
Public comment: simply make a local template that does not do anything. That would mean the global template is not used.
Adam: Maybe tap into title-protection? [I don't understand this, so hard to note]

Some wikis (especially English Wikipedia) use complicated many-levels transcluded (sub)template system, others use single templates instead. Is there a preference which one will be used for the global one? Who will decide, and how?

Currently every large wiki has a bunch of template devs. Unfortunately there is no good collaboration space for template devs across languages. I hope that a social change might emerge from the global templates project, so that they will collaborate and set up their own standards about whether to have flatter or deeper reference structure. The project is agnostic towards this.

If there is a new development, who will decide if this will be included in the global one (as it can affect hundreds of other wikis)?

It's a wiki: it will propagate. If anyone is concerned that a change in a global template will affect other wikis should be concerned about Commons as well!
If you're concerned about a specific global template, make a local copy, just like with Commons images.

Could the shared templates and Lua modules be stored in Commons? Is there an argument to use a different infrastructure?

It's unimportant. We can keep them on Commons or put thems somewhere else. It's an implementation detail. Let the software engineers who know MW well decide what's best.

Is there tooling that template developers can use to coordinate templates across wikis in the meantime?

Kind of: a few months ago a prominent MW dev User:Yurik developed a set of tools to make it easy to copy templates across. Called dibabel. The server was https://dibabel.toolforge.org/ . Unfortunately, it doesn't work at the moment, but the source code is available, and perhaps Yurik or someone else can bring it back to life.

I think what Adam has presented is a way to make it even more complicated and require even more expertise to maintain it all. Kinda like the standards xkcd situation ( https://xkcd.com/927/ )

Adam: This could be the case, I've wondered that myself.
Some examples worked through here, https://www.mediawiki.org/wiki/User:Adamw/Drafts/Component_templates_RFC
Two things happened:
Whatever snippets we're using now can be copied across with small adjustments, there shouldn't be any huge change adding complexity.
Logic is extracted from the templates themselves, so that wikitext is reduced to a block of markup with variable placeholders. This simplification of templates is a big benefit.
Is there tooling that template developers can use to coordinate templates across wikis in the meantime?