 Hello. Hi. My name is Amira Aroni and I'm here with Adam White and we're going to speak about templates. These are two distinct topics, but both of them are related to templates and templates. The reason we're doing this together and the reason we feel that it's even important is that templates are almost everywhere. It's one of the most basic parts of the user experience of the editors in all the languages and all the wikis. They are involved in one way or another in almost all edits. However, in recent years, there were very few changes in how templates work and a lot of changes are needed. So we're going to present two ideas for improving how they work. And again, they are distinct, but both of them separately will hopefully improve the user experience for editors in all the languages. And how do I actually share this screen so it is seen? Yes, now it is seen. And let's start. So I will start. My name is Amira Aroni. Again, and in my day job, I'm the senior language strategist in the Wikimedia Foundation. And this is not exactly the project I'm working on officially. This is a pet project I've been thinking about for a while. I hope that it will become a more official project sometime soon. But for now, it's not yet so official. And this is about making templates global. And this is going to be a very, very short presentation. I already spoke about this in some other conferences in much more length. Also, another little comment. This session cannot be translated, unfortunately. I did make all my slides almost all my slides bilingual in English and Russian. Hopefully it's helpful to at least some people. So this is going to be very, very short. For much more information, you can check these pages. Just go to MediaWiki.org and search for global templates and especially global templates slash status. It has a few videos where I speak about this topic and some other people speak about this topic. These pages are translated to a lot of languages. So this is going to be a very, very short presentation about the problem and the most frequently asked questions. And the few words about the status of what is happening with this. So a central fact is that a lot of the features of all our wikis are implemented as templates. They are features. They are software. And, you know, people don't care. The people who read Wikipedia in any language or Wiki source or whatever, they don't care where do the templates come from. They see, for example, info boxes. Info boxes are very common. They are iconic. They are one of the most identifiable features of Wikipedia. They appear in a lot of languages. Now, you can see here an example of an info box from English Wikipedia and from the French Wikipedia. And it's similar. Functionally, it's like 80, 90% similar. And by design, by the look of it, it's also quite similar. And another example is citation needed. One of the most iconic things in Wikipedia. It's also, as you can see, available in a lot of languages. And another example, of course, is the references. References, technically, they are not templates. In practice, however, a lot of references, the vast majority of references, they have some kind of template inside them. Now, these are just three examples of templates or features that are implemented as templates. There are many, many thousands of others. This is a very rudimentary count in a few languages. You can see that in the English Wikipedia, there are well over half a million pages in the template namespace. A lot of them are actually documentation pages for templates. But nevertheless, it's many, many, many thousands of templates and many thousands in other languages. And the problem with this, like this is really the central technical problem, is that there is no global storage for the code of the templates. Every template is replicated in every wiki. And this is pretty awful because the functionality is mostly the same. Mostly, not completely. Some templates are only needed in one language and that's fine. Some templates are slightly different in some languages and that's also fine. However, very large part of the functionality is the same. Nevertheless, the code is replicated and forked. And from the software engineering perspective, this is not a very good practice. Now, why is this important? I often say that this is the most important thing. More precisely, this is not exactly the most important thing by itself. It's a thing that will be, it's a thing that will allow other important things. Like the really important things is making more information available in more languages. It's making the user experience for all the editors in all the languages easier. It's allowing new languages, new small languages, and by small I mean small online, not necessarily small in real life. Languages that are spoken by millions of people that don't have wikipedia yet and they hopefully will have wikipedia. But once they have wikipedia, they will have to invest literally years in importing templates. And I'm not exaggerating. It's literally literally years in importing templates from some other larger wikipedia like English or Spanish or Russian. And having global templates is the most important thing that will allow these other even more important things. But this is the thing that we have to do now so that we will be able to have good things, good important things in the future. And what is the solution that I am proposing? And the solution that I'm proposing is to make a repository where the code of the templates will be stored and available to all the languages. Now, note that I say make it possible to store the templates in the shared repository because I'm not saying let's put all the templates in the shared repository. Because it's similar to images on comments. For well over 15 years, we had images on comments, but we also had some local images. So if you have, for whatever reason, for whatever technical or licensing reason, you want to have a local image in your wiki, it's fine. And I propose the same thing with templates. If you want a local copy of your template that is important for the community, that you want to keep locally for whatever reason, that's fine. I'm not suggesting to delete that. I'm not suggesting to remove this independence. But the templates that are shared and whose functionality is needed in multiple wikis, they should be moved to a global repository. Now, another important central question that is very frequently asked about this, templates have a lot of text in them. How will this text be translated? My response, I have a much longer response. I will very briefly just say here that it will look a lot like translate wiki. So if you're familiar with how midi wiki core and extensions and some tools are translated in translate wiki, the translation of templates will be very similar to that. A similar experience. It's very robust. It's quite successful for midi wiki core and extensions. I propose the same thing for templates. Now, here's a very, very rudimentary simple example. Now, let's imagine that in the English Wikipedia, in an article in the English Wikipedia, you have this code, citation needed. This will look up once we have the global templates. It will look up this page called citation needed in the template namespace. And if it exists there in the English Wikipedia, then this will be used, even if there is a global template for citation needed. If it's not in the English Wikipedia, but it exists in the global repository, the one from the global repository will be used. The same thing in the Russian Wikipedia, exactly the same thing. If in a Russian Wikipedia article, you're trying to use this template with this name, like this English name, citation needed. If it exists in the Russian Wikipedia, that will be used. If it doesn't exist in the Russian Wikipedia, but it exists in the global repository, that will be used. Now, a slightly more complicated example. In the Russian Wikipedia, this is the actual name of the citation needed template in the Russian Wikipedia, and if it exists in Russian, it will be used. If it doesn't exist in Russian, it will be loaded from the global repository, but it's actually the same template as the English citation needed. Because it will be possible, in my proposal, to give templates multiple names in multiple languages, just like it is now. Because it's useful to have different titles in different languages. So this is a very, very brief introduction to how I suggest it will work. There's a 30-page document you can find on mediawiki.org. I won't read all of it here, but this is the very brief introduction. So probably the most frequently asked question is, are you going to force all the wikis to use English Wikipedia templates? Lots of people ask this, and the answer, of course, is no, absolutely, like no, no, no, no, no, no, no, no. No, this is not the intention. And the reason this is not the intention is that, well, lots of reasons, because Wikipedia has already now had the independence to use whatever templates they want. However, another bigger reason, and this comes really out of respect to all the wikis in all the languages, is that there is a lot of innovation in templates, in a lot of wikis, not just in the English Wikipedia. There are a lot of really cool templates in the Chinese Wikipedia, which are not used in any other language. Why not make them available also to other languages? Same for French, same for Spanish, same for Hebrew, same for Arabic, and a lot of other languages. I want to make this innovation actually more available to all the languages, so that the different languages will see how cool it is that other languages have something useful, and just instead of importing pages and looking up strings and doing it in a very difficult way, you will be able to just use it, just easily use it from another language. I respect this autonomy, I respect this innovation in all the languages. Another important example is that the design of these are the same info boxes they mentioned already. Their design is slightly different, and that's okay. It will be okay to preserve the differences in the design between whatever different languages. You will be able to have some code in common in the repository, and some local changes to change the design, to change the information that is displayed, that's also fine. This is the proposal in general. What is already being done? This is not quite a project yet. What is being done already, however? One is a project called Translatable Modules. This is actually in development already by the team in which I am, the language team at the Wikimedia Foundation. This part will allow a convenient translation of initially lower modules, but eventually probably also templates. This is not yet actually using them in different wikis. This is just within one wiki. Our first targets will probably be commons and wiki data and meta. Later maybe will be extended to other wikis. This is just within one wiki, but later it will, once we have an actual global templates repository, this will be extended to all the templates. The next part is templates translation. This is a confusing name, but it actually means that it's not so much template translation, it's more like template adaptation. This is the most popular community wish in the latest community wish list survey. This wish is about template adaptation. Currently, for example, if you want to copy reference a footnote from the German wikipedia to the English wikipedia, you have to go through the parameters of that reference template and change them from the German names to the English names. This is just an example. I could give any two languages as an example. This project will hopefully make using templates across languages easier if they already exist in the other language. Abstract wikipedia, I'm not an abstract wikipedia person myself. There is another session at this wikimania about abstract wikipedia. You should ask them. But abstract wikipedia is kind of similar. It will possibly be possible to share some technology between abstract wikipedia and global templates. Another nice example is SiteQ. SiteQ is a template in English wikipedia which allows references powered by wiki data. It's developers made it intentionally so that it will be possible to easily make it global someday. There is already some work by the community to make global templates possible. The largest piece, of course, is the actual infrastructure which will allow translating template from one wiki to another. This doesn't exist yet. I hope that this will be developed in the foreseeable future. I would like to finish with the vision, the wikimedia vision, which we all know. Imagine a world in which every single human being can freely share the sum of all knowledge. If we cannot use the same templates, if every single human being cannot use the same templates as people in the other wikis, then we cannot reach this vision. This is really about equity in software and tools. Thanks a lot. I hope to hear your questions. I give the time to Adam. Thank you. Hi. Let's see. Hopefully I've taken over the screen. There's not much time, but this is a shorter presentation. I think it's complementary, so we decided to do this session together. I just wanted to talk about two of the problems with templates and proposals that might solve them, along with some other issues. Since 2003, we've had the ability to have templates at all. There's an animation here. Hopefully you can see these rectangles are the different blocks which are transcluded. I might have made a mistake, but I skipped a few, but you can see that most of the elements on the page other than the content texts are being transcluded somehow. Three years later, templates went from being just a simple text expansion to containing logic. I'm calling it the monkey's paw here because it's this pound if that made it possible to have this amazing flourishing of functionality that we see on the wikis and allowed the editors to do almost anything they wanted with wiki text. At the same time, I think there was quite a painful trade-off, which is that now the templates are something that not everybody can edit, that you basically need to be a wikipedia editor and software engineer to even touch. I'm going to quickly show you what a template can look like these days. But if it causes you anxiety to see something like this, you're not alone. In fact, in my next slide, I've gotten rid of all the code. And now we just have colored rectangles. The rest of my talk will just be colored rectangles because I prefer that. And so I wanted to show that if you've looked at a template, especially if you've tried to import a template, you've probably noticed that a template relies on sub-templates. Some are kind of like a shared library. Others are a smaller page that is transcluded into a piece of the template and it gets stored as its own page. There are bits of documentation in different places. There are Lua modules, styles, images that are necessary for the template to work properly. And you kind of have to find these yourself. Unfortunately, the special export and import are not guaranteed to work. It's a little bit of a story, but they can only tell you to export what is currently visible in one rendering of the template. So if there's a if statement, for example, you only get one version, but I'm spending too long on this. Point is, templates are made of a bunch of little pieces. And they're also, I think, intended to work on this now kind of old model view controller model. This is what model view controller is supposed to work like in theory, but I think what we do is more like this. There's no model. The controller is lumped into the view. And the one attempt to fix this, which has been Lua modules, I think makes the problem better in some places and worse in others. And so I want to give this potential implementation, which is to have templates which are encapsulated in a single file, if possible. And that file would, if you've seen view or web components, it would be a similar idea or HTML itself. HTML can contain style sheets, JavaScript text and images. And so the proposal here is that a template itself would contain the logic that it needs built in. It would have its own templates as part of it. And you could even have internationalization messages, styles, different types of documentation. It would all be built into one page. I think, yeah, without going too far into the pros and cons of this, I think this is pretty complementary to the global templates proposal. It means that if you want to make templates portable, then keeping them in one place is a nice way to accomplish that. I'll stop sharing it. I'll just say that, yeah, I would love to have a little bit of question and answer now. We can use the etherpad to, yeah, if you want to start collecting questions in the etherpad, we'll be looking there. And these component templates actually have a proof of concept implementation. If you want, you can go through the meeting link. You can get the slides there. You can also go to the sort of draft RFC that I've put on the Wiki. And that will have, that will link to the software that you can use to try this out. All the examples in that RFC are, they can be used directly if you load this extension on your Wiki. So, I'll go to the etherpad. Wow, thank you for taking all these notes, people. Yes, enormous thanks to the note takers. It's really, it's really, really useful to everybody, to us the speakers and to everybody else. The first question, do our readers like info boxes? It looks like someone has answered there's research which shows they use them. I unfortunately don't know too much to you, Amir. I cannot cite any paper or something. I did speak to a designer who worked at the Wikimedia Foundation a few years ago. And they told me that they researched this in multiple languages. And they said that not just the readers like info boxes, the info boxes and the relatively unified look that they give to the articles is one of the simple things that make the articles more reliable. So, I don't, unfortunately, I don't think that this was published anywhere, but that's what the designer told me. You'll have to believe me. But that's the uniformity of the design that the info boxes provide. They make the articles reliable. They make the Wikipedia brand more trustworthy. The next question, there are some templates which have been basically banned from Wikis. For example, a support on English Wikipedia, Common and other Wikis. Will there be a way of blocking templates? I think yes, you just, or no. Well, I actually haven't thought about this particular thing. One immediate thought, maybe it's not a very good solution, but one very easy thing is just don't use them. That's one thing. And if somebody uses them, revert the page, it's just like with an image. Like, let's say that there's a policy in certain Wikipedia not to use certain images from Commons. So are you actively blocking these images using abuse filter or something? Or do you just expect the users to respect this? So, to respect the rule. I guess you could make an abuse filter rule. Maybe it could be built into the repository software, like the global templates, cross-weakie, exclusion software, some kind of a blocking mechanism to disallow this. I think it makes the things a bit too complicated. But yeah, it's a valid question. I will definitely think about this. It's definitely like a valid concern. Quick thought is that you might be able to tap into title protection, so you wouldn't be able to create that template and you also would then not be able to exclude it. Some Wikis use many levels of exclusion with some sub-templates. Other use single templates. Is there a preference which will be used for the global template system? We will decide. The community wants. Currently, there are a lot of template developers in a lot of Wikis. Every large Wiki, English Wikipedia, English Wiki source, Wikidata, Commons, French Wikipedia, Spanish Wikipedia, Hebrew Wikipedia, Russian Wikipedia, each of these Wikis has a community of template developers. Unfortunately, there is no good collaboration space for template developers in different languages. I hope that as some kind of a social change, a community change that will emerge from this global templates project, there will be a community of template developers who will help each other and who will collaborate on developing and improving templates. And they will decide what is better, multi-level of exclusion or something more flat. Anything is fine because the global template's proposal is not about changing the Wiki syntax or changing the Lua syntax. It's only about a different storage mechanism and a different exclusion mechanism. But the templates themselves, whatever the templates developers decide. Next question is also for you. If a global template has changed, who decides if, or if there's a new development in a template, who will decide if that gets used in the global template, which then propagates everywhere? So it's a Wiki and it will propagate everywhere. And if anybody is concerned that a change in a global template can make a bad change in all the wikis, should also be concerned about commons and about wiki data. And some of the more sensitive templates can be protected, for example. And if any wiki is concerned that a certain template can have a bad effect on that wiki, that a change in the code of that template can have a bad effect and protecting the template in the global repository is not good enough, so don't use that global template. Have a local copy and use only that. It's just the same as with images on commons. It's just that we are so accustomed to images from commons, which have been with us since 2004 or so, that we just don't think about this like almost never. I almost never heard any concerns that what happens if an image on commons is changed? Almost nothing. Yes, it's possible to vandalize commons, which will affect lots of languages, but it's just the same thing. Protect the image or don't use that image in the articles. Okay. One more. Can shared templates and modules be kept on commons? Do we need to have another domain? Different infrastructure. It's really unimportant. We can have another domain or we can keep them on commons, whatever. I honestly don't care. It's not an important question. It's just a tiny implementation detail. My whole idea, it has almost no engineering concerns. At some point, software engineers who know MediaWiki platform well will have to decide how to implement the transfusion and where will the templates reside on the new domain or in commons or in wiki data. Any of them is okay. It's really not important. I think it just makes more sense to put them in a common, like in a new repository, but it's really not an important thing. But this question has been asked a few times in the past, but it's really like whatever. It doesn't matter. While we're waiting for global templates, is there any tooling that template maintainers can use as a workaround? Kind of. A few months ago, a pretty prominent MediaWiki developer, user Urik, why you are IK, he developed a set of tools which make templates easy to copy from one wiki to another. It's called debubble, D-I-B-A-B-E-L. Unfortunately, last time I checked, it didn't actually work. The server, the transit, it was just not responsive, which is sad. I hope that either Urik himself comes back and fixes it or maybe somebody else takes over the code. It was a pretty cool thing. Unfortunately, it's not functional right now. I hope it will be fixed because it is a kind of a nice interim solution. But that's the only thing I know. The last one, you can read it from me. Or I can read it. So someone posed a question to me saying, my proposal is probably going to make things more complicated and take even more expertise to maintain. And has an appropriate link to XKCD. Yes, that's definitely possible. I was worried about that myself, but when I worked through some examples, which I linked to there, what I found was that it actually did have the effect I wanted. And two things happened. The first was that whatever technologies we're using right now, so template data and Lua, whatever that is, that can all be copied over just like it is. Just small changes with small changes. The second thing that happens, though, is actually quite significant, and it's that logic comes out of the templates themselves. So all you're left with is the original intention of WikiText. It's a block of markup, and in the markup you have some placeholders, and those are variables. All of the setting of those variables is done from logic that's external to the template. So the simplification of the templates itself, I feel, is one of the big benefits here. And having it all in one place reduces the amount of detective work you need to do to actually change anything and understand it. But I think it's all an open question for now. I'd love to have someone disprove that or make a good argument against it. Looks like we're out of time. Any last question? Thank you. I wish we could see and hear you, but it's been very enjoyable. Thank you, Mir. Thank you, Adam. Thanks to the note-pakers, and thanks for the questions, relevant questions. I'm open to more questions. I'm sure that Adam is. Thank you.