Template:Main: Difference between revisions
Template page
More actions
mark template language machine-readably, use template language for language-dependent things instead of page language |
use of system messages |
||
| Line 1: | Line 1: | ||
<div class="noprint" lang="{{BCP47|{{{lang|}}}}}" dir="auto"> | <div class="noprint" lang="{{BCP47|{{{lang|}}}}}" dir="auto"> | ||
: {{#switch:{{{lang|}}} | : {{#switch:{{{lang|{{PAGELANGUAGE}}}}} | ||
|ja|ko|wuu|yue|zh|zh-hans|zh-hant=<!--no italics--> | |ja|ko|wuu|yue|zh|zh-hans|zh-hant=<!--no italics--> | ||
|#default=''}}{{#if: {{{2|}}} | |#default=''}}<!-- | ||
-->{{int|wm-commonstrings-mainarticle-prompt| |{{#if:{{{2|}}}|2|1}}}}<!-- | |||
-->{{#switch:{{{lang|{{PAGELANGUAGE}}}}} | |||
|ja|ko|wuu|yue|zh|zh-hans|zh-hant=<!--no italics--> | |ja|ko|wuu|yue|zh|zh-hans|zh-hant=<!--no italics--> | ||
|#default=''}}{{List | |#default=''}}{{List | ||
| Line 22: | Line 20: | ||
}}<!-- | }}<!-- | ||
-->{{#if: {{{10|}}} | [[Category:Template:Main/too many parameters]] }} | -->{{#if: {{{10|}}} | [[Category:Template:Main/too many parameters]] }} | ||
</div> | </div><noinclude>{{documentation|Template:Main/doc}}</noinclude> | ||
Revision as of 08:14, 6 March 2024
This documentation is transcluded from Template:Main/doc.
Usage
To link to a main article on a topic like Example, use
{{Main|Example}}
which renders as
You can add up to 5 article names in parameters:
{{Main|MediaWiki/de|MediaWiki/en|MediaWiki/es|MediaWiki/fr|MediaWiki/zh}}
which renders as
These parameters are used to generate links and may include namespace prefixes or interwiki prefixes. If you want to hide these prefixes (for example here for a link to English Wikipedia) and display an alternative text you can use
{{Main|w:en:Example{{!}}Example (in English Wikipedia)}}
which renders as
Internationalisation
Many articles on Meta should be translatable, in that case use
{{ Main |Special:MyLanguage/Example{{!}}<translate nowrap><!--T:2--> Example</translate>}}
which renders as
Translations
Template:Twiki/row1/top Template:Translatewiki-link/row1 |}
See also
- {{Further}}
- {{TNT}} (shortcut for {{Translatable template}})
- {{TNTN}} (shortcut for {{Translatable template name}})
- {{Ll}} (shortcut for {{Localized link}})