Template:Autotranslate/doc
This is a documentation subpage for Template:Autotranslate. It contains usage information, categories, and other content that is not part of the original template page. |
This template is used to show a template in the user's interface language. It works for template manually translated; for templates which use Translate extension (with <translate>
tags), use {{TNT}}, {{Dynamite}} or {{TNTN}} instead.
How to convert a template
editBefore you apply this template, first you have to prepare the template.
Pick a template
editFirst you have to pick a template to autotranslate.
Create a layout template
editIf the template is not to difficult you should create a layout template to contain the layout of all language versions of the template. This template should not add any categories when transcluded.
Modify the en language link
editUsually the English link points to the main template, point it to the /en subpage.
Create a documentation page
editCreate a documentation page at template name/doc. This documentation page should include some code for creating language versions of the template. Include this documentation in the main template by adding {{documentation}}
Convert existing language versions
editEach language version of the template should be checked and converted to use the layout template. Start with the English language version and compare it to the current template.
Note that everything that is not supposed to be included together with the template, like “{{translated tag|cleanup}}” and documentation, must be inside a “<noinclude>” tag.
Convert the main template
editThe last step is to enable the template. Be sure to check everything before you enable the template. You can cause a really big mess! To enable the template, put this code in the template for the layout part: {{Autotranslate|1={{{1|}}}|2={{{2|}}}|3={{{3|}}}|base=template name}}
Protect templates
editThe main template page is probably already protected. You should probably also protect /layout, /lang & /en.
Code snippet
editTo use this template, include the following code:
{{Autotranslate|1={{{1|}}}|2={{{2|}}}|3={{{3|}}}|4={{{4|}}}|5={{{5|}}}|6={{{6|}}}|base={{subst:PAGENAME}}}}