Currently translating a section with templates is problematic in Section Translation. For example, translating the "reception" section for "Battleheart (video game)" from English to Spanish the mobile editor lets you translate the different cells of the review tables (note below that "score" is selected below with a suggested translation you can apply for it). However, after publishing a template is added instead (it is shown in red because the template definition is missing in the test server where it was published):
Translating | Published |
---|---|
Looking at the source wikitext of the translated contents, the template was copied over form the source article, whithout any adaptation to create the corresponding template in the target language.
This shows the following problems:
- Templates should be represented in the editor as a single unit. Users should be able to edit them with Visual Editor as a template. However, editing individual rendered contents should not be allowed since these may be generated from the template automatically and translating them has no effect (i.e., the "Score" header is not part of the parameters/information of the template).
- The template added to the translation should be the equivalent one from the target wiki not copying the source one. In this case the Video game reviews template in English should be converted to the Crítica de videojuego template in Spanish.
Both aspects are supported by Content Translation (with their limitations and complexities: T102964), so we want to reuse the approaches.
Types of templates
- For in-line templates (those inside the content) we can proceed by selecting the sentence in the usual way and the templates inside would be converted automatically. In case the conversion is not possible, they can be added as "plain text". That is, removing any html styling elements and preserving the contents (it may contain bold, links and other styling elements that can be edited in VE).
- For block templates (presented as an independent paragraph, such as an infobox), we need to define how the suggested translation card looks like.