Template:Autotranslate/doc

From NC Commons
Jump to navigation Jump to search

Template:Shared Template Warning

Lua error in Module:Autotranslate at line 77: No fallback page found for autotranslate (base=Documentation subpage, lang=⧼lang⧽).__EXPECTED_UNCONNECTED_PAGE__ No description yet available.

The template automatically sets the following categories: Category:Autotranslated templates

Usage

<poem>{{Autotranslate

|base = 

}}</poem>

Template parameters

ParameterDescriptionDefaultStatus
baseemptyrequired
...emptyoptional
langTemplate:Magic wordoptional
Template data
Lua error in Module:Autotranslate at line 77: No fallback page found for autotranslate (base=TemplateDataInfo/i18n, lang=⧼lang⧽).

This template is used as a part of the larger mechanism to show a template content in the user's interface language. It allows you to set up set of language subtemplates and call proper subtemplate based on users chosen language. All parameters passed to Autotranslate will be passed to the subtemplates. See “Help:Autotranslate” for help on the whole process.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
...

Any additional parameter passed to {{Autotranslate}} will be passed to {{Autotranslate}}'s subtemplates. Parameter names are case independent and the subtemplates **will only *see lower case* names**.

Unknownoptional
Translations Pagebase

Name of the template's translations page, like "Template:Information", or "Template:Information/i18n".

Auto value
{{subst:PAGENAME}}/i18n
Templaterequired
Languagelang

display language

Default
{{int:lang}}
Stringoptional

Additional information

The template is intended to be used in the following namespaces: the Template namespace

The template is intended to be used by the following user groups: all users

Placement: At the top of the page

Relies on:
Module:Autotranslate

⧼Seealso⧽

  • {{LangSwitch}} for all-translations-on-one-page template i18n mechanism template.

Localization

This template is not intended to be localized.

How to convert a template

Before you apply this template, first you have to prepare the template.

Pick a template

—See for example Template:Cc-by-1.0 before changes.
First you have to pick a template to autotranslate.
In this documentation, we will name our "selected template" as: Template:Template name

Create a layout template

—See for example Template:Apache/layout.
You must create a layout template, named Template:Template name/layout, to contain the layout of all language versions of the template. The easiest way to do this is to copy a layout template of a similar template.
This template should not add any categories when transcluded.

Convert existing language versions

—See for example Template:Apache/en.
All versions must be subpages of Template:Template name, and this name must use the appropriate prefix, as used on Wikipedia when adding a new language –ISO 639 language code–.

For example, the Spanish subpage must be named Template:Template name/es

Usually the English-language template links to the main template –Template:Template name–. This is incorrect, point it instead to the Template:Template name/en subpage.

Each language version of the template should be checked and converted to use the layout template –Template:Template name/layout–.
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}} or {{documentation}}, must be inside a <noinclude> tag.

Here is the syntax you must use for Template:Template name/<prefix>.

{{Template name/layout
|text=<translated text of the template>
|lang=<prefix>
}}<noinclude>
{{translated tag|license}}
</noinclude>

Create a documentation page

—See for example Template:Apache/doc.
Create a documentation page at Template:Template name/doc. This documentation page should include some code for creating language versions of the template. {{TemplateBox}} has a |il8n=autotranslate option which provides a standard explanation of how to localise an autotranslated template.

Convert the main template

—See for example Template:Apache.
The 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 –Template:Template name–.

{{Autotranslate|base=template name}}

See also

Lua error in Module:Autotranslate at line 77: No fallback page found for autotranslate (base=I18n templates, lang=⧼lang⧽).