「ヘルプ:Magic words」の版間の差分

提供: ひつじ小屋別館2代目
移動先: 案内検索
(Technical metadata: What a pain to have to wrap {{REVISIONUSER}} in {{URLENCODE:|WIKI}} to get a {{REVISIONUSERE}} version...)
(1版 をインポートしました)
 
(10人の利用者による、間の32版が非表示)
1行目: 1行目:
'''Magic words''' are strings of text that MediaWiki associates with a return value or function, such as time, site details, or page names. This page is about usage of standard magic words; for a technical reference, see {{Mediawiki|Manual:Magic words}}.
+
<languages/>
 +
{{TOCRight}}
 +
{{TNT|PD Help Page}}
 +
<translate><!--T:1-->
 +
'''Magic words''' are strings of text that MediaWiki associates with a return value or function, such as time, site details, or page names. This page explains only the standard magic words; for a technical reference, see {{Mediawiki|<tvar|manual-magic-words>Special:MyLanguage/Manual:Magic words</>|Manual:Magic words}}.
  
 +
<!--T:2-->
 
There are three general types of magic words:
 
There are three general types of magic words:
* '''[[#Behavior switches|Behavior switches]]''': these are uppercase words surrounded by double underscores, ''e.g.'' '''__FOO__'''.
 
* '''[[#Variables|Variables]]''': these are uppercase words surrounded by double braces, ''e.g.'' '''<code><nowiki>{{FOO}}</nowiki></code>'''. As such, they look a lot like [[Help:Templates|templates]].
 
* '''[[#Parser functions|Parser functions]]''': these take parameters and are either of the form '''<code><nowiki>{{foo:...}}</nowiki></code>''' or '''<code><nowiki>{{#foo:...}}</nowiki></code>'''. See also {{mediawiki|Help:Extension:ParserFunctions}}.
 
  
Variables and parser functions can use [[Manual:subst|subst:]], just like templates. Page-dependent magic words will affect or return data about the ''current'' page (by default), even if the word is added through a transcluded template or included system message.
+
<!--T:3-->
 +
* '''[[<tvar|bs>#Behavior switches</>|Behavior switches]]''': these are uppercase words surrounded by double underscores, ''e.g.'' '''__FOO__'''.
  
== Behavior switches ==
+
<!--T:4-->
 +
* '''[[<tvar|var>#Variables</>|Variables]]''': these are uppercase words surrounded by double braces, ''e.g.'' '''<code><nowiki>{{FOO}}</nowiki></code>'''. As such, they look a lot like [[<tvar|help-templates>Special:MyLanguage/Help:Templates</>|templates]].
  
A behavior switch controls the layout or behavior of the page and can often be used to specify desired omissions and inclusions in the content.
+
<!--T:5-->
 +
* '''[[<tvar|pfunc>#Parser functions</>|Parser functions]]''': these take parameters and are either of the form '''<code><nowiki>{{foo:...}}</nowiki></code>''' or '''<code><nowiki>{{#foo:...}}</nowiki></code>'''. See also <tvar|help-ext-parser-functions>{{ll|Help:Extension:ParserFunctions}}</>.
 +
 
 +
<!--T:6-->
 +
Variables and parser functions can use [[<tvar|manual-subst>Special:MyLanguage/Manual:subst</>|subst:]], just like templates. Page-dependent magic words will affect or return data about the ''current'' page (by default), even if the word is added through a transcluded template or included system message.</translate>
 +
 
 +
{{anchor|Behavior switches}}
 +
<translate>
 +
== Behavior switches == <!--T:7-->
 +
 
 +
<!--T:8-->
 +
A behavior switch controls the layout or behavior of the page and can often be used to specify desired omissions and inclusions in the content.</translate>
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Word
+
! width="20%" | <translate><!--T:9-->
! Description
+
Word</translate>
! Versions
+
! <translate><!--T:10-->
 +
Description</translate>
 +
! width="15%" | <translate><!--T:11-->
 +
Versions</translate>
 
|-
 
|-
! colspan="3" style="background-color: #DDDDDD;"| [[Table of contents]]
+
! colspan="3" style="background-color: #DDDDDD;"| <translate><!--T:257-->
 +
[[<tvar|manual-toc>Special:MyLanguage/Manual:Table of contents</>|Table of contents]]</translate>
 
|-
 
|-
 
| <code><nowiki>__NOTOC__</nowiki></code>
 
| <code><nowiki>__NOTOC__</nowiki></code>
| Hides the [[table of contents]] (TOC).
+
| <translate><!--T:12-->
 +
Hides the [[<tvar|manual-toc>Special:MyLanguage/table of contents</>|table of contents]] (TOC).</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>__FORCETOC__</nowiki></code>
 
| <code><nowiki>__FORCETOC__</nowiki></code>
| Forces the table of contents to appear at its normal position (before the first header).
+
| <translate><!--T:13-->
 +
Forces the table of contents to appear at its normal position (before the first header, overriding <tvar|notoc><code><nowiki>__NOTOC__</nowiki></code></>).</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>__TOC__</nowiki></code>
 
| <code><nowiki>__TOC__</nowiki></code>
| Places a table of contents at the word's current position (overriding <code><nowiki>__NOTOC__</nowiki></code>). If this is used multiple times, the table of contents will appear at the first word's position.
+
| <translate><!--T:14-->
 +
Places a table of contents at the word's current position (overriding <tvar|notoc><code><nowiki>__NOTOC__</nowiki></code></>). If this is used multiple times, the table of contents will appear at the first word's position.</translate>
 
|
 
|
 
|-
 
|-
! colspan="3" style="background-color: #DDDDDD;"| Editing
+
! colspan="3" style="background-color: #DDDDDD;"| <translate><!--T:15-->
 +
Editing</translate>
 
|-
 
|-
 
| <code><nowiki>__NOEDITSECTION__</nowiki></code>
 
| <code><nowiki>__NOEDITSECTION__</nowiki></code>
| Hides the section edit links beside headings. This is especially useful, where a heading is created from within a template: the normal wiki section-edit would in this case edit the template code, which is normally counterintuitive to the user. If a template contains multiple headings, it may be necessary to add "<code><nowiki>__NOEDITSECTION__</nowiki></code>" after each heading.
+
| <translate><!--T:16-->
 +
Hides the section edit links beside headings. This is especially useful where a heading is created from within a template: the normal wiki section-edit would in this case edit the template code, which is normally counterintuitive to the user.</translate> <translate><!--T:345-->
 +
Use of this in a template will extend the effect to that template, the pages it's included on, ''and'' any other templates included on the same page.</translate> <translate><!--T:346-->
 +
For a workaround, see [[<tvar|meta>m:Special:MyLanguage/Help:Editing sections of included templates</>|here]].</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>__NEWSECTIONLINK__</nowiki></code>
 
| <code><nowiki>__NEWSECTIONLINK__</nowiki></code>
| Adds a link beside the "edit" tab for adding a new section on a non-talk page (see {{mediawiki|m:Help:Section#Adding a section at the end|Adding a section to the end}}).
+
| <translate><!--T:17-->
| 1.7+
+
Adds a link beside the "edit" tab for adding a new section on a non-talk page (see {{mediawiki|<tvar|meta-help-section>m:Special:MyLanguage/Help:Section#Adding a section at the end</>|Adding a section to the end}}).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>__NONEWSECTIONLINK__</nowiki></code>
 
| <code><nowiki>__NONEWSECTIONLINK__</nowiki></code>
| Removes the link beside the "edit" tab on pages in talk namespaces.
+
| <translate><!--T:18-->
| {{mediawiki|rev:47522|1.15+}}
+
Removes the link beside the "edit" tab on pages in talk namespaces.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.15|compact=y|comment=and after|r=47522}}
 
|-
 
|-
! colspan="3"| Categories
+
! colspan="3"| <translate><!--T:19-->
 +
Categories</translate>
 
|-
 
|-
 
| <code><nowiki>__NOGALLERY__</nowiki></code>
 
| <code><nowiki>__NOGALLERY__</nowiki></code>
| Used on a category page, replaces thumbnails in the category view with normal links.
+
| <translate><!--T:20-->
| 1.7+
+
Used on a category page, replaces thumbnails in the category view with normal links.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>__HIDDENCAT__</nowiki></code>
 
| <code><nowiki>__HIDDENCAT__</nowiki></code>
| Used on a category page, hides the category from the lists of categories in its members and parent categories (there is an option in the [[Help:Preferences|user preferences]] to show them).<!-- hiddencategory hiddencat hide category categories -->
+
| <translate><!--T:21-->
| 1.13+
+
Used on a category page, hides the category from the lists of categories in its members and parent categories (there is an option in the [[<tvar|help-preferences>Special:MyLanguage/Help:Preferences</>|user preferences]] to show them).</translate><!-- hiddencategory hiddencat hide category categories -->
 +
| {{ {{TNTN|MW version}} |version=1.13|compact=y|comment=and after}}
 
|-
 
|-
! colspan="3" style="background-color: #DDDDDD;"| Language conversion
+
! colspan="3" style="background-color: #DDDDDD;"| <translate><!--T:22-->
 +
Language conversion</translate>
 
|-
 
|-
 
| <code><nowiki>__NOCONTENTCONVERT__</nowiki></code> <br /> <code><nowiki>__NOCC__</nowiki></code>
 
| <code><nowiki>__NOCONTENTCONVERT__</nowiki></code> <br /> <code><nowiki>__NOCC__</nowiki></code>
| On wikis with language variants, don't perform any content language conversion (character and phase) in article display; for example, only show Chinese (zh) instead of variants like zh_cn, zh_tw, zh_sg, or zh_hk.
+
| <translate><!--T:23-->
 +
On wikis with language variants, don't perform any content language conversion (character and phase) in article display; for example, only show Chinese (zh) instead of variants like zh_cn, zh_tw, zh_sg, or zh_hk.</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>__NOTITLECONVERT__</nowiki></code> <br /> <code><nowiki>__NOTC__</nowiki></code>
 
| <code><nowiki>__NOTITLECONVERT__</nowiki></code> <br /> <code><nowiki>__NOTC__</nowiki></code>
| On wikis with language variants, don't perform language conversion on the title (all other content is converted).
+
| <translate><!--T:24-->
 +
On wikis with language variants, don't perform language conversion on the title (all other content is converted).</translate>
 
|
 
|
 
|-
 
|-
! colspan="3" style="background-color: #DDDDDD;"| Other
+
! colspan="3" style="background-color: #DDDDDD;"| <translate><!--T:25-->
 +
Other</translate>
 
|-
 
|-
 
| <code><nowiki>__START__</nowiki></code>
 
| <code><nowiki>__START__</nowiki></code>
| No effect.
+
| <translate><!--T:347-->
|
+
No effect.</translate> <translate><!--T:348-->
 +
Was used to point where database message starts after comment that should not be transcluded.</translate> <small><translate><!--T:26-->
 +
Removed in [[Special:Code/MediaWiki/1695|r1695]] and completely removed in [[Special:Code/MediaWiki/24784|r24784]]</translate></small>
 +
| {{ {{TNTN|MW version}} |version=1.10|compact=y|comment=and before|r=1610}}
 
|-
 
|-
 
| <code><nowiki>__END__</nowiki></code>
 
| <code><nowiki>__END__</nowiki></code>
| Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace. Removed in {{mediawiki|rev:19213|19213}}.
+
| <translate><!--T:27-->
| 1.1–1.8
+
Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace. Removed in {{mediawiki|rev:19213|19213}}.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.1|compact=y|version2=1.8}}
 
|-
 
|-
 
| <code><nowiki>__INDEX__</nowiki></code>
 
| <code><nowiki>__INDEX__</nowiki></code>
| Tell search engines to index the page (overrides {{mediawiki|Manual:$wgArticleRobotPolicies|$wgArticleRobotPolicies}}, but not robots.txt). It obeys [[Manual:$wgExemptFromUserRobotsControl|$wgExemptFromUserRobotsControl]] variable.
+
| <translate><!--T:28-->
| 1.14+
+
Tell search engines to index the page (overrides <tvar|manual-wg-bot-policy>{{mediawiki|Special:MyLanguage/Manual:$wgArticleRobotPolicies|$wgArticleRobotPolicies}}</>, but not robots.txt). It obeys <tvar|manual-wg-exempt-from-bot>[[Special:MyLanguage/Manual:$wgExemptFromUserRobotsControl|$wgExemptFromUserRobotsControl]]</> variable.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.14|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>__NOINDEX__</nowiki></code>
 
| <code><nowiki>__NOINDEX__</nowiki></code>
| Tell search engines not to index the page (i.e. do not list in search engines' results). It obeys [[Manual:$wgExemptFromUserRobotsControl|$wgExemptFromUserRobotsControl]] variable.
+
| <translate><!--T:29-->
| {{mediawiki|rev:37973|1.14+}}
+
Tell search engines not to index the page (i.e. do not list in search engines' results). It obeys <tvar|manual-wg-exempt-from-bot>[[Special:MyLanguage/Manual:$wgExemptFromUserRobotsControl|$wgExemptFromUserRobotsControl]]</> variable.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.14|compact=y|comment=and after|r=37973}}
 
|-
 
|-
 
| <code><nowiki>__STATICREDIRECT__</nowiki></code>
 
| <code><nowiki>__STATICREDIRECT__</nowiki></code>
| On redirect pages, don't allow MediaWiki to automatically update the link when someone moves a page and checks "Update any redirects that point to the original title".
+
| <translate><!--T:30-->
| {{mediawiki|rev:37928|1.13+}}
+
On redirect pages, don't allow MediaWiki to automatically update the link when someone moves a page and checks "<tvar|fixDoubleRedirects>{{int:Fix-double-redirects}}</>" (which requires [[<tvar|var>Special:MyLanguage/Manual:$wgFixDoubleRedirects</>|$wgFixDoubleRedirects]]).</translate>
|-
+
| {{ {{TNTN|MW version}} |version=1.13|compact=y|comment=and after|r=37928}}
| <code><nowiki>__DISAMBIG__</nowiki></code>
 
| Marks a page as a disambiguation page and places it in [[Special:DisambiguationPages]], and places inward links in [[Special:DisambiguationPageLinks]]. See [[Extension:Disambiguator]].
 
| requires [[Extension:Disambiguator|Disambiguator extension]]
 
 
|}
 
|}
  
== Variables ==
+
{{anchor|Variables}}
 +
<translate>
 +
 
 +
== Variables == <!--T:33-->
  
Variables return information about the current page, wiki, or date. Their syntax is similar to [[Help:Templates|templates]]. Variables marked as "<span style="background: #FED;">'''[expensive]'''</span>" are tracked by the software, and the number that can be included on a page is limited.
+
<!--T:34-->
 +
Variables return information about the current page, wiki, or date. Their syntax is similar to [[<tvar|help-templates>Special:MyLanguage/Help:Templates</>|templates]]. Variables marked as "<span style="background: #FED;">'''[expensive]'''</span>" are tracked by the software, and the number that can be included on a page is limited.
  
If a template name conflicts with a variable, the variable will be used (so to transclude the template [[{{ns:10}}:PAGENAME]] you would need to write <code><nowiki>{{</nowiki>{{ns:10}}:PAGENAME<nowiki>}}</nowiki></code>). In some cases, adding parameters will force the parser to invoke a template; for example, <code><nowiki>{{CURRENTDAYNAME|x}}</nowiki></code> transcludes [[{{ns:10}}:CURRENTDAYNAME]], ''not'' the variable.
+
<!--T:35-->
 +
If a template name conflicts with a variable, the variable will be used (so to transclude the template [[{{ns:10}}:PAGENAME]] you would need to write <tvar|code><code><nowiki>{{</nowiki>{{ns:10}}:</>PAGENAME<tvar|code-end><nowiki>}}</nowiki></code></>). In some cases, adding parameters will force the parser to invoke a template; for example, <tvar|tpl-currentdayname-code><code><nowiki>{{CURRENTDAYNAME|x}}</nowiki></code></> transcludes <tvar|tpl-currentdayname-result>[[{{ns:10}}:CURRENTDAYNAME]]</>, ''not'' the variable.
 +
</translate>
  
=== Date and time ===
+
{{anchor|Date and time}}
 +
<translate>
 +
=== Date and time === <!--T:36-->
  
 +
<!--T:37-->
 
The following variables return the current date and time in [[w:UTC|UTC]].
 
The following variables return the current date and time in [[w:UTC|UTC]].
  
 +
<!--T:38-->
 
Due to MediaWiki and browser caching, these variables frequently show when the page was ''cached'' rather than the current time.
 
Due to MediaWiki and browser caching, these variables frequently show when the page was ''cached'' rather than the current time.
  
The date and time magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, they depend on the [[page content language]].
+
<!--T:39-->
 +
The date and time magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, they depend on the [[<tvar|manual-pagelang>Special:MyLanguage/Manual:Language#page-content-lang</>|page content language]].</translate>
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Variable
+
! <translate><!--T:40-->
! Output
+
Variable</translate>
! Description
+
! <translate><!--T:41-->
! Versions
+
Output</translate>
 +
! <translate><!--T:42-->
 +
Description</translate>
 +
! <translate><!--T:43-->
 +
Versions</translate>
 
|-
 
|-
! colspan="4" style="background-color: #DDDDDD;"| Year{{Anchor|CURRENTYEAR}}
+
! colspan="4" style="background-color: #DDDDDD;"| <translate><!--T:44-->
 +
Year</translate>{{Anchor|CURRENTYEAR}}
 
|-
 
|-
 
| <code><nowiki>{{CURRENTYEAR}}</nowiki></code>
 
| <code><nowiki>{{CURRENTYEAR}}</nowiki></code>
 
| {{CURRENTYEAR}}
 
| {{CURRENTYEAR}}
| Year
+
| <translate><!--T:45-->
 +
Year</translate>
 
|
 
|
 
|-
 
|-
! colspan="4" style="background-color: #DDDDDD;"| Month{{Anchor|CURRENTMONTH|CURRENTMONTHNAME|CURRENTMONTHNAMEGEN|CURRENTMONTHABBREV}}
+
! colspan="4" style="background-color: #DDDDDD;"| <translate><!--T:46-->
 +
Month</translate>{{Anchor|CURRENTMONTH|CURRENTMONTH1|CURRENTMONTHNAME|CURRENTMONTHNAMEGEN|CURRENTMONTHABBREV}}
 
|-
 
|-
 
| <code><nowiki>{{CURRENTMONTH}}</nowiki></code>
 
| <code><nowiki>{{CURRENTMONTH}}</nowiki></code>
 
| {{CURRENTMONTH}}
 
| {{CURRENTMONTH}}
| Month (zero-padded number)
+
| <translate><!--T:47-->
 +
Month (zero-padded number)</translate>
 +
|
 +
|-
 +
| <code><nowiki>{{CURRENTMONTH1}}</nowiki></code>
 +
| {{CURRENTMONTH1}}
 +
| <translate><!--T:304-->
 +
Month (unpadded number)</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{CURRENTMONTHNAME}}</nowiki></code>
 
| <code><nowiki>{{CURRENTMONTHNAME}}</nowiki></code>
 
| {{CURRENTMONTHNAME}}
 
| {{CURRENTMONTHNAME}}
| Month (name)
+
| <translate><!--T:48-->
 +
Month (name)</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki></code>
 
| <code><nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki></code>
 
| {{CURRENTMONTHNAMEGEN}}
 
| {{CURRENTMONTHNAMEGEN}}
| Month ([[wikipedia:genitive|genitive form]])
+
| <translate><!--T:49-->
 +
Month ([[wikipedia:genitive|genitive form]])</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{CURRENTMONTHABBREV}}</nowiki></code>
 
| <code><nowiki>{{CURRENTMONTHABBREV}}</nowiki></code>
 
| {{CURRENTMONTHABBREV}}
 
| {{CURRENTMONTHABBREV}}
| Month (abbreviation)
+
| <translate><!--T:50-->
| 1.5+
+
Month (abbreviation)</translate>
 +
| {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}}
 
|-
 
|-
! colspan="4" style="background-color: #DDDDDD;"| Day{{Anchor|CURRENTDAY|CURRENTDAY2|CURRENTDOW|CURRENTDAYNAME}}
+
! colspan="4" style="background-color: #DDDDDD;"| <translate><!--T:51-->
 +
Day</translate>{{Anchor|CURRENTDAY|CURRENTDAY2|CURRENTDOW|CURRENTDAYNAME}}
 
|-
 
|-
 
| <code><nowiki>{{CURRENTDAY}}</nowiki></code>
 
| <code><nowiki>{{CURRENTDAY}}</nowiki></code>
 
| {{CURRENTDAY}}
 
| {{CURRENTDAY}}
| Day of the month (unpadded number)
+
| <translate><!--T:52-->
 +
Day of the month (unpadded number)</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{CURRENTDAY2}}</nowiki></code>
 
| <code><nowiki>{{CURRENTDAY2}}</nowiki></code>
 
| {{CURRENTDAY2}}
 
| {{CURRENTDAY2}}
| Day of the month (zero-padded number)
+
| <translate><!--T:53-->
| 1.6+
+
Day of the month (zero-padded number)</translate>
 +
| {{ {{TNTN|MW version}} |version=1.6|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{CURRENTDOW}}</nowiki></code>
 
| <code><nowiki>{{CURRENTDOW}}</nowiki></code>
 
| {{CURRENTDOW}}
 
| {{CURRENTDOW}}
| Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday)
+
| <translate><!--T:54-->
 +
Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday)</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{CURRENTDAYNAME}}</nowiki></code>
 
| <code><nowiki>{{CURRENTDAYNAME}}</nowiki></code>
 
| {{CURRENTDAYNAME}}
 
| {{CURRENTDAYNAME}}
| Day of the week (name)
+
| <translate><!--T:55-->
 +
Day of the week (name)</translate>
 
|
 
|
 
|-
 
|-
! colspan="4" style="background-color: #DDDDDD;"| Time{{Anchor|CURRENTTIME|CURRENTHOUR}}
+
! colspan="4" style="background-color: #DDDDDD;"| <translate><!--T:56-->
 +
Time</translate>{{Anchor|CURRENTTIME|CURRENTHOUR}}
 
|-
 
|-
 
| <code><nowiki>{{CURRENTTIME}}</nowiki></code>
 
| <code><nowiki>{{CURRENTTIME}}</nowiki></code>
 
| {{CURRENTTIME}}
 
| {{CURRENTTIME}}
| Time (24-hour HH:mm format)
+
| <translate><!--T:57-->
 +
Time (24-hour HH:mm format)</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{CURRENTHOUR}}</nowiki></code>
 
| <code><nowiki>{{CURRENTHOUR}}</nowiki></code>
 
| {{CURRENTHOUR}}
 
| {{CURRENTHOUR}}
| Hour (24-hour zero-padded number)
+
| <translate><!--T:58-->
 +
Hour (24-hour zero-padded number)</translate>
 
|
 
|
 
|-
 
|-
! colspan="4" style="background-color: #DDDDDD;"| Other{{Anchor|CURRENTWEEK|CURRENTTIMESTAMP}}
+
! colspan="4" style="background-color: #DDDDDD;"| <translate><!--T:59-->
 +
Other</translate>{{Anchor|CURRENTWEEK|CURRENTTIMESTAMP}}
 
|-
 
|-
 
| <code><nowiki>{{CURRENTWEEK}}</nowiki></code>
 
| <code><nowiki>{{CURRENTWEEK}}</nowiki></code>
 
| {{CURRENTWEEK}}
 
| {{CURRENTWEEK}}
| Week (number)
+
| <translate><!--T:60-->
 +
Week (number)</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{CURRENTTIMESTAMP}}</nowiki></code>
 
| <code><nowiki>{{CURRENTTIMESTAMP}}</nowiki></code>
 
| {{CURRENTTIMESTAMP}}
 
| {{CURRENTTIMESTAMP}}
| YYYYMMDDHHmmss timestamp
+
| <translate><!--T:61-->
| 1.7+
+
YYYYMMDDHHmmss timestamp</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 
|}
 
|}
  
The following variables do the same as the preceding ones, but using the site's server config or $wgLocaltimezone.
+
<translate><!--T:62-->
 +
The following variables do the same as the preceding ones, but using the site's server config or <tvar|manual-wg-localtimezone>[[Special:MyLanguage/Manual:$wgLocaltimezone|$wgLocaltimezone]]</>.
 +
</translate>
 
* <code><nowiki>{{LOCALYEAR}}</nowiki>
 
* <code><nowiki>{{LOCALYEAR}}</nowiki>
 
* <nowiki>{{LOCALMONTH}}</nowiki>
 
* <nowiki>{{LOCALMONTH}}</nowiki>
 +
* <nowiki>{{LOCALMONTH1}}</nowiki>
 
* <nowiki>{{LOCALMONTHNAME}}</nowiki>
 
* <nowiki>{{LOCALMONTHNAME}}</nowiki>
 
* <nowiki>{{LOCALMONTHNAMEGEN}}</nowiki>
 
* <nowiki>{{LOCALMONTHNAMEGEN}}</nowiki>
205行目: 285行目:
 
* <nowiki>{{LOCALTIMESTAMP}}</nowiki></code>
 
* <nowiki>{{LOCALTIMESTAMP}}</nowiki></code>
  
''For more thorough time formatting, you may want to install [[Extension:ParserFunctions]] to use the [[Help:Extension:ParserFunctions#.23time|#time parser function]]''.
+
<translate><!--T:63-->
 +
''For more thorough time formatting, you may want to install <tvar|ext-parserfunctions>{{ll|Extension:ParserFunctions}}</> to use the [[<tvar|ext-parserfunct-t>Special:MyLanguage/Help:Extension:ParserFunctions#.23time</>|#time parser function]]''.
  
=== Technical metadata ===
+
=== Technical metadata === <!--T:64-->
  
''Note:'' Revision variables return data about the '''latest edit to the current page''', even if viewing an older version of the page.
+
<!--T:65-->
 +
''Note:'' Revision variables return data about the '''latest edit to the current page''', even if viewing an older version of the page.</translate>
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Variable
+
! width="10%" | <translate><!--T:66-->
! Output
+
Variable</translate>
! Description
+
! width="15%" | <translate><!--T:67-->
! Versions
+
Output</translate>
 +
! <translate><!--T:68-->
 +
Description</translate>
 +
! width="10%" | <translate><!--T:69-->
 +
Versions</translate>
 
|-
 
|-
! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|Site|SITENAME|SERVER|SERVERNAME|DIRMARK|DIRECTIONMARK}}{{Anchor|SCRIPTPATH|STYLEPATH|CURRENTVERSION|CONTENTLANGUAGE|CONTENTLANG}}Site
+
! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|Site|SITENAME|SERVER|SERVERNAME|DIRMARK|DIRECTIONMARK}}{{Anchor|SCRIPTPATH|STYLEPATH|CURRENTVERSION|CONTENTLANGUAGE|CONTENTLANG}}<translate><!--T:70-->
 +
Site</translate>
 
|-
 
|-
 
| <code><nowiki>{{SITENAME}}</nowiki></code>
 
| <code><nowiki>{{SITENAME}}</nowiki></code>
 
| {{SITENAME}}
 
| {{SITENAME}}
| The wiki's site name ({{mediawiki|Manual:$wgSitename|$wgSitename}}).
+
| <translate><!--T:71-->
 +
The wiki's site name (<tvar|manual-wg-sitename>{{mediawiki|Special:MyLanguage/Manual:$wgSitename|$wgSitename}}</>).</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{SERVER}}</nowiki></code>
 
| <code><nowiki>{{SERVER}}</nowiki></code>
 
| {{SERVER}}
 
| {{SERVER}}
| Domain [http://en.wikipedia.org/wiki/URL URL] ({{mediawiki|Manual:$wgServer|$wgServer}}).
+
| <translate><!--T:72-->
 +
Domain [[w:URL|URL]] (<tvar|manual-wg-server>{{mediawiki|Special:MyLanguage/Manual:$wgServer|$wgServer}}</>).</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{SERVERNAME}}</nowiki></code>
 
| <code><nowiki>{{SERVERNAME}}</nowiki></code>
 
| {{SERVERNAME}}
 
| {{SERVERNAME}}
| Subdomain and domain name (no longer dependent on {{mediawiki|Manual:$wgServerName|$wgServerName}} as of version 1.17).  
+
| <translate><!--T:73-->
 +
Subdomain and domain name (no longer dependent on <tvar|manual-wg-servername>{{mediawiki|Special:MyLanguage/Manual:$wgServerName|$wgServerName}}</> as of version 1.17).</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{DIRMARK}}</nowiki></code> <br /><code><nowiki>{{DIRECTIONMARK}}</nowiki></code>
 
| <code><nowiki>{{DIRMARK}}</nowiki></code> <br /><code><nowiki>{{DIRECTIONMARK}}</nowiki></code>
 
| {{DIRMARK}} <br />{{DIRECTIONMARK}}
 
| {{DIRMARK}} <br />{{DIRECTIONMARK}}
| Outputs a [http://en.wikipedia.org/wiki/Unicode Unicode] directional mark that matches the wiki's default language's direction (<code>&amp;lrm;</code> on left-to-right wikis, <code>&amp;rlm;</code> on right-to-left wikis), useful in text with multi-directional text. Since {{r|94680|1.19}}, it depends on the [[page content language]].
+
| <translate><!--T:74-->
| {{r|14442|1.7+}}
+
Outputs a [[w:Unicode|Unicode]] directional mark that matches the wiki's default language's direction (<code>&amp;lrm;</code> on left-to-right wikis, <code>&amp;rlm;</code> on right-to-left wikis), useful in text with multi-directional text. Since {{r|94680|1.19}}, it depends on the [[<tvar|manual-pagelang>Special:MyLanguage/Manual:Language#page-content-lang</>|page content language]].</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after|r=14442}}
 
|-
 
|-
 
| <code><nowiki>{{SCRIPTPATH}}</nowiki></code>
 
| <code><nowiki>{{SCRIPTPATH}}</nowiki></code>
 
| {{SCRIPTPATH}}
 
| {{SCRIPTPATH}}
| Relative script path ({{mediawiki|Manual:$wgScriptPath|$wgScriptPath}}).
+
| <translate><!--T:75-->
 +
Relative script path (<tvar|manual-wg-scriptpath>{{mediawiki|Special:MyLanguage/Manual:$wgScriptPath|$wgScriptPath}}</>).</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{STYLEPATH}}</nowiki></code>
 
| <code><nowiki>{{STYLEPATH}}</nowiki></code>
 
| {{STYLEPATH}}
 
| {{STYLEPATH}}
| Relative style path ({{mediawiki|Manual:$wgStylePath|$wgStylePath}}).
+
| <translate><!--T:76-->
| 1.16+
+
Relative style path (<tvar|manual-wg-stylepath>{{mediawiki|Special:MyLanguage/Manual:$wgStylePath|$wgStylePath}}</>).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.16|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{CURRENTVERSION}}</nowiki></code>
 
| <code><nowiki>{{CURRENTVERSION}}</nowiki></code>
 
| {{CURRENTVERSION}}
 
| {{CURRENTVERSION}}
| The wiki's MediaWiki version.
+
| <translate><!--T:77-->
| {{r|14199|1.7+}}
+
The wiki's MediaWiki version.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after|r=14199}}
 
|-
 
|-
 
| <code><nowiki>{{CONTENTLANGUAGE}}</nowiki></code> <br /><code><nowiki>{{CONTENTLANG}}</nowiki></code>
 
| <code><nowiki>{{CONTENTLANGUAGE}}</nowiki></code> <br /><code><nowiki>{{CONTENTLANG}}</nowiki></code>
 
| {{CONTENTLANGUAGE}} <br />{{CONTENTLANG}}
 
| {{CONTENTLANGUAGE}} <br />{{CONTENTLANG}}
| The wiki's default interface language ({{mediawiki|Manual:$wgLanguageCode|$wgLanguageCode}}).
+
| <translate><!--T:78-->
| {{r|14661|1.7+}}
+
The wiki's default interface language (<tvar|manual-wg-langcode>{{mediawiki|Special:MyLanguage/Manual:$wgLanguageCode|$wgLanguageCode}}</>).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after|r=14661}}
 
|-
 
|-
! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|Page|PAGEID|PAGESIZE|PROTECTIONLEVEL}}Page
+
! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|Page|PAGEID|PROTECTIONLEVEL|PROTECTIONEXPIRY|CASCADINGSOURCES}}<translate><!--T:79-->
 +
Page</translate>
 
|-
 
|-
 
| <code><nowiki>{{PAGEID}}</nowiki></code>
 
| <code><nowiki>{{PAGEID}}</nowiki></code>
 
| {{PAGEID}}
 
| {{PAGEID}}
| Returns the page identifier.
+
| <translate><!--T:80-->
| {{mediawiki|gerrit:9858|1.20+}}
+
Returns the page identifier.</translate>
|-style="background: #FED;"
+
| {{ {{TNTN|MW version}} |version=1.20|compact=y|comment=and after|gerrit change=9858}}
| <code><nowiki>{{PAGESIZE:</nowiki>''page name''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESIZE:</nowiki>''page name''<nowiki>|R}}</nowiki>
 
| {{PAGESIZE:Help:Magic_words}} <br />{{PAGESIZE:Help:Magic_words|R}}
 
| '''[Expensive]''' Returns the byte size of the specified page. Use "<code><nowiki>|R</nowiki></code>" to get raw (unformatted) numbers.
 
| {{mediawiki|rev:33551|1.13+}}
 
 
|-
 
|-
| <code><nowiki>{{PROTECTIONLEVEL:</nowiki>''action''<nowiki>}}</nowiki></code>
+
| <code><nowiki>{{</nowiki>PROTECTIONLEVEL:<translate><!--T:261-->
 +
''action''</translate>}}</code>
 
| <!-- Leave this empty. -->
 
| <!-- Leave this empty. -->
| Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the current page or an empty string if not protected.
+
| <translate><!--T:81-->
| {{mediawiki|rev:45587|1.15+}}
+
Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the current page. Returns an empty string if not protected.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.15|compact=y|comment=and after|r=45587}}
 
|-
 
|-
! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|revision|REVISIONID|REVISIONDAY|REVISIONDAY2|REVISIONMONTH|REVISIONMONTH1|REVISIONYEAR|REVISIONTIMESTAMP|REVISIONUSER}}Latest revision to current page
+
| <code><nowiki>{{</nowiki>PROTECTIONEXPIRY:''<translate><!--T:342-->
 +
action</translate>''}}</code>
 +
| <!-- Leave this empty. -->
 +
| <translate><!--T:343-->
 +
Outputs the protection expiry (e.g. "20160418155030", "infinity") for a given action (e.g. "edit", "move") on the current page.</translate> <translate><!--T:344-->
 +
Returns "infinity" if not protected.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.27|compact=y|comment=and after|gerrit change=255717}}
 +
|- style="background:#FED;"
 +
| <code><nowiki>{{CASCADINGSOURCES}}</nowiki></code>
 +
| <!-- Leave this empty. -->
 +
| '''[<translate><!--T:326-->
 +
Expensive</translate>]''' <translate><!--T:291-->
 +
Returns the sources of any cascading protection acting on the current page. Pages will not return their own title unless they transclude themselves.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.23|compact=y|comment=and after|gerrit change=104999}}
 +
|-
 +
! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|revision|REVISIONID|REVISIONDAY|REVISIONDAY2|REVISIONMONTH|REVISIONMONTH1|REVISIONYEAR|REVISIONTIMESTAMP|REVISIONUSER}}<translate><!--T:82-->
 +
Latest revision to current page</translate>
 
|-
 
|-
 
| <code><nowiki>{{REVISIONID}}</nowiki></code>
 
| <code><nowiki>{{REVISIONID}}</nowiki></code>
 
| {{REVISIONID}}
 
| {{REVISIONID}}
| Unique revision ID.
+
| <translate><!--T:83-->
| 1.5+
+
Unique revision ID.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{REVISIONDAY}}</nowiki></code>
 
| <code><nowiki>{{REVISIONDAY}}</nowiki></code>
 
| {{REVISIONDAY}}
 
| {{REVISIONDAY}}
| Day edit was made (unpadded number).
+
| <translate><!--T:84-->
| 1.8+
+
Day edit was made (unpadded number).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{REVISIONDAY2}}</nowiki></code>
 
| <code><nowiki>{{REVISIONDAY2}}</nowiki></code>
 
| {{REVISIONDAY2}}
 
| {{REVISIONDAY2}}
| Day edit was made (zero-padded number).
+
| <translate><!--T:85-->
| 1.8+
+
Day edit was made (zero-padded number).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{REVISIONMONTH}}</nowiki></code>
 
| <code><nowiki>{{REVISIONMONTH}}</nowiki></code>
 
| {{REVISIONMONTH}}
 
| {{REVISIONMONTH}}
| Month edit was made (zero-padded number as of {{mediawiki|rev:66200|1.17+}}, unpadded number in prior versions).
+
| <translate><!--T:86-->
| 1.8+
+
Month edit was made (zero-padded number as of {{mediawiki|rev:66200|1.17+}}, unpadded number in prior versions).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{REVISIONMONTH1}}</nowiki></code>
 
| <code><nowiki>{{REVISIONMONTH1}}</nowiki></code>
 
| {{REVISIONMONTH1}}
 
| {{REVISIONMONTH1}}
| Month edit was made (unpadded number).
+
| <translate><!--T:87-->
| {{mediawiki|rev:66200|1.17+}}
+
Month edit was made (unpadded number).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.17|compact=y|comment=and after|r=66200}}
 
|-
 
|-
 
| <code><nowiki>{{REVISIONYEAR}}</nowiki></code>
 
| <code><nowiki>{{REVISIONYEAR}}</nowiki></code>
 
| {{REVISIONYEAR}}
 
| {{REVISIONYEAR}}
| Year edit was made.
+
| <translate><!--T:88-->
| 1.8+
+
Year edit was made.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{REVISIONTIMESTAMP}}</nowiki></code>
 
| <code><nowiki>{{REVISIONTIMESTAMP}}</nowiki></code>
 
| {{REVISIONTIMESTAMP}}
 
| {{REVISIONTIMESTAMP}}
| Timestamp as of time of edit.
+
| <translate><!--T:89-->
| 1.8+
+
Timestamp as of time of edit.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}}
 
|-
 
|-
| <code><nowiki>{{REVISIONUSER}}</nowiki></code><br /><code><nowiki>{{URLENCODE:{{REVISIONUSER}}|WIKI}}</nowiki></code>
+
| <code><nowiki>{{REVISIONUSER}}</nowiki></code>
| {{REVISIONUSER}}<br />{{URLENCODE:{{REVISIONUSER}}|WIKI}}
+
| {{REVISIONUSER}}
| The username of the user who made the most recent edit to the page, or the current user when previewing an edit.
+
| <translate><!--T:90-->
| {{mediawiki|rev:48149|1.15+}}
+
The username of the user who made the most recent edit to the page, or the current user when previewing an edit.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.15|compact=y|comment=and after|r=48149}}
 
|-
 
|-
! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|DISPLAYTITLE|DEAFULTSORT|DEFAULTCATEGORYSORT|DEFAULTSORTKEY}}Affects page content
+
| <code><nowiki>{{REVISIONSIZE}}</nowiki></code>
 +
| {{REVISIONSIZE}}
 +
| <translate><!--T:91-->
 +
The size (bytes of wikitext) of the current revision of this page</translate>
 +
| {{ {{TNTN|MW version}} |version=1.22|compact=y|comment=and after|gerrit change=82650}}
 
|-
 
|-
| {{anchor|Displaytitle}} <code><nowiki>{{DISPLAYTITLE:</nowiki>''title''<nowiki>}}</nowiki></code>
+
! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|DISPLAYTITLE|DEAFULTSORT|DEFAULTCATEGORYSORT|DEFAULTSORTKEY}}<translate><!--T:92-->
 +
Affects page content</translate>
 +
|-
 +
| {{anchor|Displaytitle}} <code><nowiki>{{DISPLAYTITLE:</nowiki><translate><!--T:262-->
 +
''title''</translate><nowiki>}}</nowiki></code>
 
|
 
|
| Format the current page's title header. The value must be equivalent to the default title: only capitalization changes and replacing spaces with underscores are allowed (this can be changed with {{manual|$wgRestrictDisplayTitle}}). It can be disabled or enabled by {{mediawiki|Manual:$wgAllowDisplayTitle|$wgAllowDisplayTitle}}; disabled by default before 1.10+, enabled by default thereafter.
+
| <translate><!--T:93-->
| 1.7+
+
Format the current page's title header. The value must be equivalent to the default title: only capitalization changes to certain parts of the title (not all) and replacing spaces with underscores are allowed (this can be changed with <tvar|manual-wg-restrict-disp-title>{{mediawiki|Special:MyLanguage/Manual:$wgRestrictDisplayTitle|$wgRestrictDisplayTitle}}</>). It can be disabled or enabled by <tvar|manual-wg-allow-disp-title>{{mediawiki|Special:MyLanguage/Manual:$wgAllowDisplayTitle|$wgAllowDisplayTitle}}</>; disabled by default before 1.10+, enabled by default thereafter.</translate>
 +
<translate><!--T:300-->
 +
It can take a second argument of ''noerror'' or ''noreplace'' to suppress error messages when multiple displaytitles are used on one page or to make this <tt>displaytitle</tt> do nothing if a <tt>displaytitle</tt> was already specified earlier in the page.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}<br/>{{ {{TNTN|MW version}} |version=1.24|compact=y|comment=and after|gerrit change=144870}} <br /> (<translate><!--T:299-->
 +
for noerror and noreplace</translate>)
 
|-
 
|-
| {{anchor|Defaultsort}} <code><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{DEFAULTSORTKEY:</nowiki>''sortkey''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{DEFAULTCATEGORYSORT:</nowiki>''sortkey''<nowiki>}}</nowiki></code> <br/><code><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>|noerror}}</nowiki></code> <br/><code><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>|noreplace}}</nowiki></code>
+
| {{anchor|Defaultsort}} <code><nowiki>{{DEFAULTSORT:</nowiki><translate><!--T:263-->
 +
''sortkey''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{DEFAULTSORTKEY:</nowiki></>''sortkey''<tvar|code2><nowiki>}}</nowiki></code> <br /><code><nowiki>{{DEFAULTCATEGORYSORT:</nowiki></>''sortkey''<tvar|code3><nowiki>}}</nowiki></code> <br/><code><nowiki>{{DEFAULTSORT:</nowiki></>''sortkey''<tvar|code4><nowiki>|noerror}}</nowiki></code> <br/><code><nowiki>{{DEFAULTSORT:</nowiki></>''sortkey''</translate><nowiki>|noreplace}}</nowiki></code>
 
|
 
|
| Used for categorizing pages, sets a default [[Help:Categories|category sort key]]. For example if you put <code><nowiki>{{DEFAULTSORT:Smith, John}}</nowiki></code> at the end of [[John Smith]], the page would be sorted under "S" by default in categories. It can take a second argument of ''noerror'' or ''noreplace'' to suppress error messages when multiple defaultsortkeys are used on one page or to make this <tt>defaultsort</tt> do nothing if a <tt>defaultsort</tt> was already specified earlier in the page.
+
| <translate><!--T:94-->
| 1.10+ <br/>{{mediawiki|rev:96767|1.19+}} (for noerror and noreplace)
+
Used for categorizing pages, sets a default [[<tvar|help-categories>Special:MyLanguage/Help:Categories</>|category sort key]]. For example if you put <tvar|sort><code><nowiki>{{DEFAULTSORT:</>Smith , John<tvar|sort-end>}}</nowiki></code></> at the end of [[John Smith]], the page would be sorted under "S" by default in categories. It can take a second argument of ''noerror'' or ''noreplace'' to suppress error messages when multiple defaultsortkeys are used on one page or to make this <tvar|sort2><tt>defaultsort</tt></> do nothing if a <tvar|sort3><tt>defaultsort</tt></> was already specified earlier in the page.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.10|compact=y|comment=and after}}<br/>{{ {{TNTN|MW version}} |version=1.19|compact=y|comment=and after|r=96767}} <br /> (<translate><!--T:95-->
 +
for noerror and noreplace</translate>)
 
|}
 
|}
  
=== Statistics ===
+
<translate>
  
Numbers returned by these variables normally contain separators (commas or spaces, depending on the local language), but can return raw numbers with the ":R" flag (for example, <code><nowiki>{{NUMBEROFPAGES}}</nowiki></code> &rarr; {{NUMBEROFPAGES}} and <code><nowiki>{{NUMBEROFPAGES:R}}</nowiki></code> &rarr; {{NUMBEROFPAGES:R}}). Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example <code><nowiki>{{PAGESINCATEGORY:Help}}</nowiki></code> and <code><nowiki>{{PAGESINCATEGORY:Help|R}}</nowiki></code>, or <code><nowiki>{{PAGESINCATEGORY:Help|subcats}}</nowiki></code> and <code><nowiki>{{PAGESINCATEGORY:Help|subcats|R}}</nowiki></code>). Also applicable to <code><nowiki>{{PAGESIZE:</nowiki>''page name''<nowiki>}}</nowiki></code> hereinbefore.
+
=== Statistics === <!--T:96-->
  
The number magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, it depends on the [[page content language]].
+
<!--T:97-->
 +
Numbers returned by these variables normally contain separators (commas, dots or spaces, depending on the local language) but can return raw numbers with the ":R" flag (for example, <tvar|nop-code><code><nowiki>{{NUMBEROFPAGES}}</nowiki></code></> &rarr; <tvar|nop-result>{{NUMBEROFPAGES}}</> and <tvar|nop-r-code><code><nowiki>{{NUMBEROFPAGES:R}}</nowiki></code></> &rarr; <tvar|nop-r-result>{{NUMBEROFPAGES:R}}</>).
 +
 
 +
<!--T:98-->
 +
Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example <tvar|pic><code><nowiki>{{PAGESINCATEGORY:Help}}</nowiki></code></> and <tvar|pic-r><code><nowiki>{{PAGESINCATEGORY:Help|R}}</nowiki></code></>, or <tvar|pic-subcats><code><nowiki>{{PAGESINCATEGORY:Help|subcats}}</nowiki></code></> and <tvar|pic-subcats-r><code><nowiki>{{PAGESINCATEGORY:Help|subcats|R}}</nowiki></code></>). Also applicable to <tvar|pagesize><code><nowiki>{{PAGESIZE:</nowiki></>''page name''<tvar|pagesize-end><nowiki>}}</nowiki></code></> hereinbefore.
 +
 
 +
<!--T:99-->
 +
The number magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, it depends on the [[<tvar|manual-pagelang>Special:MyLanguage/Manual:Language#page-content-lang</>|page content language]].</translate>
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Variable
+
! width="10%" | <translate><!--T:100-->
! Output
+
Variable</translate>
! Description
+
! width="10%" | <translate><!--T:101-->
! Versions
+
Output</translate>
 +
! <translate><!--T:102-->
 +
Description</translate>
 +
! width="10%" | <translate><!--T:103-->
 +
Versions</translate>
 
|-
 
|-
 
| <code><nowiki>{{NUMBEROFPAGES}}</nowiki></code>
 
| <code><nowiki>{{NUMBEROFPAGES}}</nowiki></code>
 
| {{NUMBEROFPAGES}}
 
| {{NUMBEROFPAGES}}
| Number of wiki pages.
+
| {{Anchor|NUMBEROFPAGES}}<translate><!--T:104-->
| 1.7+
+
Number of wiki pages.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{NUMBEROFARTICLES}}</nowiki></code>
 
| <code><nowiki>{{NUMBEROFARTICLES}}</nowiki></code>
 
| {{NUMBEROFARTICLES}}
 
| {{NUMBEROFARTICLES}}
| Number of pages in {{mediawiki|Manual:Using custom namespaces#Content namespaces|content namespaces}}.
+
| {{Anchor|NUMBEROFARTICLES}}<translate><!--T:105-->
 +
Number of pages in {{mediawiki|<tvar|manual-content-ns>Special:MyLanguage/Manual:Using custom namespaces#content-ns</>|content namespaces}}.</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{NUMBEROFFILES}}</nowiki></code>
 
| <code><nowiki>{{NUMBEROFFILES}}</nowiki></code>
 
| {{NUMBEROFFILES}}
 
| {{NUMBEROFFILES}}
| Number of uploaded files.
+
| {{Anchor|NUMBEROFFILES}}<translate><!--T:106-->
| 1.5+
+
Number of uploaded files.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{NUMBEROFEDITS}}</nowiki></code>
 
| <code><nowiki>{{NUMBEROFEDITS}}</nowiki></code>
 
| {{NUMBEROFEDITS}}
 
| {{NUMBEROFEDITS}}
| Number of wiki edits.
+
| {{Anchor|NUMBEROFEDITS}}<translate><!--T:107-->
| {{mediawiki|rev:21319|1.10+}}
+
Number of wiki edits.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.10|compact=y|comment=and after|r=21319}}
 
|-
 
|-
 
| <code><nowiki>{{NUMBEROFVIEWS}}</nowiki></code>
 
| <code><nowiki>{{NUMBEROFVIEWS}}</nowiki></code>
| {{NUMBEROFVIEWS}}
+
|
| Number of page views. Usually useless on a wiki using [[Manual:Cache|caching]].
+
| {{Anchor|NUMBEROFVIEWS}}<translate><!--T:108-->
| {{mediawiki|rev:42721|1.14+}}
+
Number of page views. Usually useless on a wiki using [[<tvar|manual-cache>Special:MyLanguage/Manual:Cache</>|caching]].</translate> <translate><!--T:303-->
 +
Removed in <tvar|gerrit>{{gerrit|150699}}</>.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.14|compact=y|version2=1.24|r=42721}}
 
|-
 
|-
 
| <code><nowiki>{{NUMBEROFUSERS}}</nowiki></code>
 
| <code><nowiki>{{NUMBEROFUSERS}}</nowiki></code>
 
| {{NUMBEROFUSERS}}
 
| {{NUMBEROFUSERS}}
| Number of registered users.
+
| {{Anchor|NUMBEROFUSERS}}<translate><!--T:109-->
| 1.7+
+
Number of registered users.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{NUMBEROFADMINS}}</nowiki></code>
 
| <code><nowiki>{{NUMBEROFADMINS}}</nowiki></code>
 
| {{NUMBEROFADMINS}}
 
| {{NUMBEROFADMINS}}
| Number of users in the ''sysop'' {{mediawiki|Manual:User rights|group}}.
+
| {{Anchor|NUMBEROFADMINS}}<translate><!--T:110-->
| 1.7+
+
Number of users in the ''sysop'' {{mediawiki|<tvar|manual-userrights>Special:MyLanguage/Manual:User rights</>|group}}.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{NUMBEROFACTIVEUSERS}}</nowiki></code>
 
| <code><nowiki>{{NUMBEROFACTIVEUSERS}}</nowiki></code>
 
| {{NUMBEROFACTIVEUSERS}}
 
| {{NUMBEROFACTIVEUSERS}}
| Number of active users, based on the criteria used in [[Special:Statistics]].
+
| {{Anchor|NUMBEROFACTIVEUSERS}}<translate><!--T:111-->
| {{mediawiki|rev:47392|1.15+}}
+
Number of active users, based on the criteria used in [[Special:Statistics]].</translate>
 +
| {{ {{TNTN|MW version}} |version=1.15|compact=y|comment=and after|r=47392}}
 
|- style="background:#FED;"
 
|- style="background:#FED;"
| <code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESINCAT:</nowiki>''categoryname''<nowiki>}}</nowiki></code>
+
| {{Anchor|PAGESINCATEGORY|PAGESINCAT}}<code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESINCAT:</nowiki>''categoryname''<nowiki>}}</nowiki></code>
 
| {{PAGESINCATEGORY:Help}} <br />{{PAGESINCAT:Help}}
 
| {{PAGESINCATEGORY:Help}} <br />{{PAGESINCAT:Help}}
| '''[Expensive]''' Number of pages (including any subcategories and files) in the given [[Help:Categories|category]].
+
| '''[<translate><!--T:327-->
| {{mediawiki|rev:32932|1.13+}}
+
Expensive</translate>]''' <translate><!--T:112-->
 +
Number of pages (including subcategories and files) in the given [[<tvar|help-categories>Special:MyLanguage/Help:Categories</>|category]]. <small>([[:Category:Help]] used for demonstration)</small></translate>
 +
| {{ {{TNTN|MW version}} |version=1.13|compact=y|comment=and after|r=32932}}
 
|- style="background:#FED;"
 
|- style="background:#FED;"
| <code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|all}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|pages}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|subcats}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|files}}</nowiki></code>
+
| <code><nowiki>{{PAGESINCATEGORY:</nowiki><translate><!--T:264-->
 +
''categoryname''<tvar|code1><nowiki>|all}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki></>''categoryname''<tvar|code2><nowiki>|pages}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki></>''categoryname''<tvar|code3><nowiki>|subcats}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki></>''categoryname''</translate><nowiki>|files}}</nowiki></code>
 
| {{PAGESINCATEGORY:Help|all}} <br />{{PAGESINCATEGORY:Help|pages}} <br />{{PAGESINCATEGORY:Help|subcats}} <br />{{PAGESINCATEGORY:Help|files}}
 
| {{PAGESINCATEGORY:Help|all}} <br />{{PAGESINCATEGORY:Help|pages}} <br />{{PAGESINCATEGORY:Help|subcats}} <br />{{PAGESINCATEGORY:Help|files}}
| '''[Expensive]''' Respectively, the number of
+
| '''[<translate><!--T:328-->
 +
Expensive</translate>]''' <translate><!--T:113-->
 +
Respectively, the number of
 
* all pages
 
* all pages
 
* ordinary pages (excluding subcategories and files)
 
* ordinary pages (excluding subcategories and files)
 
* subcategories or
 
* subcategories or
 
* files
 
* files
in the given [[Help:Categories|category]].
+
in the given [[<tvar|help-categories>Special:MyLanguage/Help:Categories</>|category]]. <small>([[:Category:Help]] used for demonstration)</small></translate>
| [//gerrit.wikimedia.org/r/#/c/12790/ 1.20+]
+
| {{ {{TNTN|MW version}} |version=1.20|compact=y|comment=and after|gerrit change=12790}}
 
|-
 
|-
| <code><nowiki>{{NUMBERINGROUP:</nowiki>''groupname''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{NUMINGROUP:</nowiki>''groupname''<nowiki>}}</nowiki></code>
+
| <code><nowiki>{{NUMBERINGROUP:</nowiki><translate><!--T:265-->
| {{NUMBERINGROUP:bureaucrat}} <br />{{NUMINGROUP:bureaucrat}} <br /><small><nowiki>({{NUMBERINGROUP:bureaucrat}} used here)</nowiki></small>
+
''groupname''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{NUMINGROUP:</nowiki></>''groupname''</translate><nowiki>}}</nowiki></code>
| Number of users in a specific {{mediawiki|Manual:User rights|group}}.
+
| {{Anchor|NUMBERINGROUP|NUMINGROUP}}{{NUMBERINGROUP:bureaucrat}} <br />{{NUMINGROUP:bureaucrat}} <br /><small><nowiki>({{NUMBERINGROUP:bureaucrat}} used here)</nowiki></small>
| {{mediawiki|rev:40116|1.14+}}
+
| <translate><!--T:114-->
|-
+
Number of users in a specific {{mediawiki|<tvar|manual-userrights>Special:MyLanguage/Manual:User rights</>|group}}.</translate>
| <code><nowiki>{{PAGESINNS:</nowiki>''index''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESINNAMESPACE:</nowiki>''index''<nowiki>}}</nowiki></code>
+
| {{ {{TNTN|MW version}} |version=1.14|compact=y|comment=and after|r=40116}}
| ''Not enabled''
+
|- style="background:#FED;"
| Number of pages in the given [[Help:Namespaces|namespace]] (replace ''index'' with the relevant [[Manual:Namespace|namespace index]]). For instance, <code><nowiki>{{PAGESINNAMESPACE:</nowiki>''14''<nowiki>}}</nowiki></code> will output the number of category pages. <code><nowiki>{{PAGESINNS:0}}</nowiki></code> differs from <code><nowiki>{{NUMBEROFARTICLES}}</nowiki></code> in that the former includes redirects and disambiguation pages. Disabled by default, enable with {{mediawiki|Manual:$wgAllowSlowParserFunctions|$wgAllowSlowParserFunctions}}.  
+
| <code><nowiki>{{PAGESINNS:</nowiki><translate><!--T:266-->
| 1.7+
+
''index''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESINNAMESPACE:</nowiki></>''index''</translate><nowiki>}}</nowiki></code>
 +
| <translate><!--T:115-->
 +
''Not enabled''</translate>
 +
| {{Anchor|PAGESINNS|PAGESINNAMESPACE}} '''[<translate><!--T:329-->
 +
Expensive</translate>]''' <translate><!--T:116-->
 +
Number of pages in the given [[<tvar|help-ns>Special:MyLanguage/Help:Namespaces</>|namespace]] (replace ''index'' with the relevant [[<tvar|manual-ns>Special:MyLanguage/Manual:Namespace</>|namespace index]]). For instance, <tvar|pins14><code><nowiki>{{PAGESINNAMESPACE:</nowiki>''14''<nowiki>}}</nowiki></code></> will output the number of category pages. <tvar|pins0><code><nowiki>{{PAGESINNS:0}}</nowiki></code></> differs from <tvar|noa><code><nowiki>{{NUMBEROFARTICLES}}</nowiki></code></> in that the former includes redirects and disambiguation pages. Disabled by default, enable with <tvar|manual-wg-allow-slow-parser-funct>{{mediawiki|Special:MyLanguage/Manual:$wgAllowSlowParserFunctions|$wgAllowSlowParserFunctions}}</>. </translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 
|}
 
|}
  
=== Page names ===
+
{{Anchor|Page-names|Page names}}
 +
<translate>
 +
 
 +
=== Page names === <!--T:117-->
 +
</translate>
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Variable
+
! width="10%" | <translate><!--T:118-->
! Output
+
Variable</translate>
! Description
+
! width="10%" | <translate><!--T:119-->
! Versions
+
Output</translate>
 +
! <translate><!--T:120-->
 +
Description</translate>
 +
! width="10%" | <translate><!--T:121-->
 +
Versions</translate>
 
|-
 
|-
 
| {{Anchor|FULLPAGENAME|fullpagename}}<code><nowiki>{{FULLPAGENAME}}</nowiki></code>
 
| {{Anchor|FULLPAGENAME|fullpagename}}<code><nowiki>{{FULLPAGENAME}}</nowiki></code>
 
| {{FULLPAGENAME}}
 
| {{FULLPAGENAME}}
| Namespace and full page title (including all subpage levels).
+
| <translate><!--T:122-->
| 1.6+
+
Namespace and full page title (including all subpage levels).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.6|compact=y|comment=and after}}
 
|-
 
|-
 
| {{Anchor|PAGENAME|pagename}}<code><nowiki>{{PAGENAME}}</nowiki></code>
 
| {{Anchor|PAGENAME|pagename}}<code><nowiki>{{PAGENAME}}</nowiki></code>
 
| {{PAGENAME}}
 
| {{PAGENAME}}
| Full page title (including all subpage levels) without the namespace.
+
| <translate><!--T:123-->
 +
Full page title (including all subpage levels) without the namespace.</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{BASEPAGENAME}}</nowiki></code>
 
| <code><nowiki>{{BASEPAGENAME}}</nowiki></code>
 
| {{BASEPAGENAME}}
 
| {{BASEPAGENAME}}
| {{Anchor|BASEPAGENAME|basepagename}}Page title of the page in the immediately superior [[Help:Subpages|subpage]] level without the namespace ("Title/foo" on "Help:Title/foo/bar").
+
| {{Anchor|BASEPAGENAME|basepagename}}<translate><!--T:124-->
For more complex splitting, use <code><nowiki>{{</nowiki>[[Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> from the [[Help:Extension:ParserFunctions|ParserFunctions extension]].
+
Page title of the page in the immediately superior [[<tvar|help-subpages>Special:MyLanguage/Help:Subpages</>|subpage]] level without the namespace ("Title/foo" on "Help:Title/foo/bar").
| 1.7+
+
 
 +
<!--T:260-->
 +
For more complex splitting, use <tvar|help-ext-pf-titleparts><code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code></> from the [[<tvar|help-ext-pf>Special:MyLanguage/Help:Extension:ParserFunctions</>|ParserFunctions extension]].</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 
|-
 
|-
 
| {{Anchor|SUBPAGENAME|subpagename}}<code><nowiki>{{SUBPAGENAME}}</nowiki></code>
 
| {{Anchor|SUBPAGENAME|subpagename}}<code><nowiki>{{SUBPAGENAME}}</nowiki></code>
 
| {{SUBPAGENAME}}
 
| {{SUBPAGENAME}}
| The [[Help:Subpages|subpage]] title ("bar" on "Help:Title/foo/bar").
+
| <translate><!--T:125-->
| 1.6+
+
The [[<tvar|help-subpages>Special:MyLanguage/Help:Subpages</>|subpage]] title ("bar" on "Help:Title/foo/bar").</translate>
 +
| {{ {{TNTN|MW version}} |version=1.6|compact=y|comment=and after}}
 
|-
 
|-
 
| {{Anchor|SUBJECTPAGENAME|ARTICLEPAGENAME|subjectpagename|articlepagename}}<code><nowiki>{{SUBJECTPAGENAME}}</nowiki></code> <br/><code><nowiki>{{ARTICLEPAGENAME}}</nowiki></code>
 
| {{Anchor|SUBJECTPAGENAME|ARTICLEPAGENAME|subjectpagename|articlepagename}}<code><nowiki>{{SUBJECTPAGENAME}}</nowiki></code> <br/><code><nowiki>{{ARTICLEPAGENAME}}</nowiki></code>
 
| {{SUBJECTPAGENAME}}<br/>{{ARTICLEPAGENAME}}
 
| {{SUBJECTPAGENAME}}<br/>{{ARTICLEPAGENAME}}
| Full page name of the associated subject page.
+
| <translate><!--T:126-->
| 1.7+
+
Full page name of the associated subject (e.g. article or file). Useful on talk pages.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 
|-
 
|-
 
| {{Anchor|TALKPAGENAME|talkpagename}}<code><nowiki>{{TALKPAGENAME}}</nowiki></code>
 
| {{Anchor|TALKPAGENAME|talkpagename}}<code><nowiki>{{TALKPAGENAME}}</nowiki></code>
 
| {{TALKPAGENAME}}
 
| {{TALKPAGENAME}}
| Full page name of the associated talk page.
+
| <translate><!--T:127-->
| 1.7+
+
Full page name of the associated talk page.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 +
|-
 +
| {{Anchor|ROOTPAGENAME|rootpagename}}<code><nowiki>{{ROOTPAGENAME}}</nowiki></code>
 +
| {{ROOTPAGENAME}}
 +
| <translate><!--T:301-->
 +
Name of the root of the current page.</translate> <translate><!--T:302-->
 +
Would return <tvar|foo><code>Title</code></> on page <tvar|baz><code>Help:Title/Foo/Bar</code></></translate>
 +
| {{ {{TNTN|MW version}} |version=1.22|compact=y|comment=and after}}
 
|}
 
|}
  
The <code><nowiki>{{BASEPAGENAME}}</nowiki></code> and <code><nowiki>{{SUBPAGENAME}}</nowiki></code> magic words only work in namespaces that have subpages enabled.  See {{mediawiki|Manual:$wgNamespacesWithSubpages}} for information on enabling subpages.
+
<translate><!--T:128-->
 +
The <tvar|basepagename><code><nowiki>{{BASEPAGENAME}}</nowiki></code></> and <tvar|subpagename><code><nowiki>{{SUBPAGENAME}}</nowiki></code></> magic words only work in namespaces that have subpages enabled.  See <tvar|manual-wg-ns-with-subpages>{{mediawiki|Special:MyLanguage/Manual:$wgNamespacesWithSubpages|$wgNamespacesWithSubpages}}</> for information on enabling subpages.
  
 +
<!--T:129-->
 
As of {{mediawiki|rev:46662|1.15+}}, these can all take a parameter, allowing specification of the page to be operated on, instead of just the current page:
 
As of {{mediawiki|rev:46662|1.15+}}, these can all take a parameter, allowing specification of the page to be operated on, instead of just the current page:
* <code><nowiki>{{PAGENAME:Template:Main Page}}</nowiki></code> &rarr; '''{{PAGENAME:Template:Main Page}}'''
+
* <tvar|code><code><nowiki>{{PAGENAME:Template:Main Page}}</nowiki></code></> &rarr; '''<tvar|result>{{PAGENAME:Template:Main Page}}</>'''
 +
</translate>
  
{{Warning|Page titles containing certain characters, such as apostrophes <code>'</code> or asterisks <code>*</code>, may produce unexpected results when handled with these magic words, e.g. <code><nowiki>{{PAGESINCATEGORY:{{PAGENAME}}}}</nowiki></code>. See bugs {{mediawiki|bugzilla:14779|14779}}, {{mediawiki|bugzilla:16474|16474}} and {{mediawiki|bugzilla:35628|35628}}. One simple way to fix this is wrapping the pagename in #titleparts (parser function).}}
+
{{TNT|Warning}} <translate><!--T:130-->
 
+
Page titles containing certain characters, such as apostrophes <code>'</code> or asterisks <code>*</code>, may produce unexpected results when handled with these magic words, e.g. <tvar|pic><code><nowiki>{{PAGESINCATEGORY:{{PAGENAME}}}}</nowiki></code></>. See bugs {{mediawiki|phabricator:T16779|T16779}}, {{mediawiki|phabricator:T18474|T18474}}, {{mediawiki|phabricator:T37628|T37628}}, and {{mediawiki|phabricator:T37746|T37746}}. One simple way to fix this is wrapping the pagename in <tvar|titleparts><code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code></> from the [[<tvar|help-ext-pf>Special:MyLanguage/Help:Extension:ParserFunctions</>|ParserFunctions extension]].</translate>
For example, if page name is "L'Aquila", the following code will produce the string "Numeric char encoding":
 
  
 +
<translate>
 +
<!--T:131-->
 +
For example, if page name is "<tvar|pagename>L'Aquila</>", the following code will produce the string "<tvar|result>Numeric char encoding</>":
 +
</translate>
 
<pre><nowiki>{{#switch:{{PAGENAME}}
 
<pre><nowiki>{{#switch:{{PAGENAME}}
 
| L'Aquila = No translation
 
| L'Aquila = No translation
468行目: 661行目:
 
}}</nowiki></pre>
 
}}</nowiki></pre>
  
==== URL encoded page names ====
+
<translate>
 +
==== URL encoded page names ==== <!--T:133-->
 +
 
 +
<!--T:134-->
 +
The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters [[wikipedia:Numeric character reference|HTML escaped using numeric character encoding]]):</translate>
  
The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters [[wikipedia:Numeric character reference|HTML escaped using numeric character encoding]]):
 
 
* <code><nowiki>{{FULLPAGENAMEE}}</nowiki>
 
* <code><nowiki>{{FULLPAGENAMEE}}</nowiki>
 
* <nowiki>{{PAGENAMEE}}</nowiki>
 
* <nowiki>{{PAGENAMEE}}</nowiki>
477行目: 673行目:
 
* <nowiki>{{SUBJECTPAGENAMEE}}</nowiki>
 
* <nowiki>{{SUBJECTPAGENAMEE}}</nowiki>
 
* <nowiki>{{ARTICLEPAGENAMEE}}</nowiki>
 
* <nowiki>{{ARTICLEPAGENAMEE}}</nowiki>
* <nowiki>{{TALKPAGENAMEE}}</nowiki></code>
+
* <nowiki>{{TALKPAGENAMEE}}</nowiki>
 +
* <nowiki>{{ROOTPAGENAMEE}}</nowiki></code>
 +
 
 +
<translate><!--T:135-->
 +
Note that <tvar|pagename><code><nowiki>{{PAGENAME:...}}</nowiki></code></>, <tvar|pagenamee><code><nowiki>{{PAGENAMEE:...}}</nowiki></code></> and <tvar|uec><code><nowiki>{{urlencode:...}}</nowiki></code></> have distinct implementations. See [[<tvar|manual-pagename-encoding>Special:MyLanguage/Manual:PAGENAMEE encoding</>|Manual:PAGENAMEE encoding]] for details.
 +
</translate>
  
Note that <code><nowiki>{{PAGENAME}}</nowiki></code>, <code><nowiki>{{PAGENAMEE}}</nowiki></code> and <code><nowiki>{{urlencode:}}</nowiki></code> have distinct implementations. See [[Manual:PAGENAMEE encoding]] for details.
+
{{anchor|Namespaces}}
 +
<translate>
  
=== Namespaces ===
+
=== Namespaces === <!--T:136-->
 +
</translate>
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Variable
+
! <translate><!--T:137-->
! Output
+
Variable</translate>
! Description
+
! <translate><!--T:138-->
! Versions
+
Output</translate>
 +
! <translate><!--T:139-->
 +
Description</translate>
 +
! <translate><!--T:140-->
 +
Versions</translate>
 
|-
 
|-
 
| <code><nowiki>{{NAMESPACE}}</nowiki></code>
 
| <code><nowiki>{{NAMESPACE}}</nowiki></code>
 
| {{NAMESPACE}}
 
| {{NAMESPACE}}
| Name of the page's namespace
+
| <translate><!--T:141-->
 +
Name of the page's namespace</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>{{NAMESPACENUMBER}}</nowiki></code>
 
| <code><nowiki>{{NAMESPACENUMBER}}</nowiki></code>
 
| {{NAMESPACENUMBER}}
 
| {{NAMESPACENUMBER}}
| ID of the page's namespace
+
| <translate><!--T:142-->
| [[gerrit:4056|1.20+]]
+
[[<tvar|manual-ns-id>Special:MyLanguage/Manual:Namespace#Built-in_namespaces</>|ID]] of the page's namespace</translate>
 +
| {{ {{TNTN|MW version}} |version=1.20|compact=y|comment=and after|gerrit change=4056}}
 
|-
 
|-
 
| <code><nowiki>{{SUBJECTSPACE}}</nowiki></code> <br /><code><nowiki>{{ARTICLESPACE}}</nowiki></code>
 
| <code><nowiki>{{SUBJECTSPACE}}</nowiki></code> <br /><code><nowiki>{{ARTICLESPACE}}</nowiki></code>
 
| {{SUBJECTSPACE}} <br />{{ARTICLESPACE}}
 
| {{SUBJECTSPACE}} <br />{{ARTICLESPACE}}
| Name of the associated content namespace
+
| <translate><!--T:143-->
| 1.7+
+
Name of the associated content namespace</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{TALKSPACE}}</nowiki></code>
 
| <code><nowiki>{{TALKSPACE}}</nowiki></code>
 
| {{TALKSPACE}}
 
| {{TALKSPACE}}
| Name of the associated talk namespace
+
| <translate><!--T:144-->
| 1.7+
+
Name of the associated talk namespace</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 
|}
 
|}
  
The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded):
+
<translate><!--T:145-->
* <code><nowiki>{{NAMESPACEE}}</nowiki>
+
The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded):</translate>
* <nowiki>{{SUBJECTSPACEE}}</nowiki>
+
 
* <nowiki>{{TALKSPACEE}}</nowiki></code>
+
* <code><nowiki>{{NAMESPACEE}}</nowiki></code>
 +
* <code><nowiki>{{SUBJECTSPACEE}}</nowiki></code>
 +
* <code><nowiki>{{ARTICLESPACEE}}</nowiki></code>
 +
* <code><nowiki>{{TALKSPACEE}}</nowiki></code>
 +
 
 +
<translate><!--T:146-->
 +
As of {{mediawiki|rev:46630|1.15+}}, these can take a full-page-name parameter and will return the requested namespace associated with that page, instead of with the current page:</translate>
  
As of {{mediawiki|rev:46630|1.15+}}, these can take a full-page-name parameter and will return the requested namespace associated with that page, instead of with the current page:
 
 
* <code><nowiki>{{NAMESPACE:Template:Main Page}}</nowiki></code> &rarr; '''{{NAMESPACE:Template:Main Page}}'''
 
* <code><nowiki>{{NAMESPACE:Template:Main Page}}</nowiki></code> &rarr; '''{{NAMESPACE:Template:Main Page}}'''
 
* <code><nowiki>{{SUBJECTSPACE:Template:Main Page}}</nowiki></code> &rarr; '''{{SUBJECTSPACE:Template:Main Page}}'''
 
* <code><nowiki>{{SUBJECTSPACE:Template:Main Page}}</nowiki></code> &rarr; '''{{SUBJECTSPACE:Template:Main Page}}'''
 
* <code><nowiki>{{TALKSPACE:Template:Main Page}}</nowiki></code> &rarr; '''{{TALKSPACE:Template:Main Page}}'''
 
* <code><nowiki>{{TALKSPACE:Template:Main Page}}</nowiki></code> &rarr; '''{{TALKSPACE:Template:Main Page}}'''
Parameter must not be a namespace name:
+
<translate><!--T:147-->
 +
Parameter must not be a namespace name:</translate>
 
* <code><nowiki>{{SUBJECTSPACE:Help talk}}</nowiki></code> &rarr; '''{{SUBJECTSPACE:Help talk}}<!-- empty -->&nbsp;''' (''Empty'')
 
* <code><nowiki>{{SUBJECTSPACE:Help talk}}</nowiki></code> &rarr; '''{{SUBJECTSPACE:Help talk}}<!-- empty -->&nbsp;''' (''Empty'')
  
== Parser functions ==
+
<translate>
 +
=== Other === <!--T:293-->
 +
</translate>
 +
{| class="wikitable"
 +
|-
 +
! <translate><!--T:294-->
 +
Variable</translate>
 +
! <translate><!--T:295-->
 +
Output</translate>
 +
! <translate><!--T:296-->
 +
Description</translate>
 +
! <translate><!--T:297-->
 +
Versions</translate>
 +
|-
 +
| <code><nowiki>{{!}}</nowiki></code>
 +
|style="text-align:center;"| <nowiki>|</nowiki>
 +
| {{Anchor|PIPE|Pipe|pipe|.7C|.7c}}<translate><!--T:298-->
 +
Used to include a pipe character as part of a template argument or table cell contents. Before this was added as a magic word, many wikis implemented this by creating [[Template:!]] with <code><nowiki>|</nowiki></code> as the content.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.24|compact=y|comment=and after|gerrit change=136234}}
 +
|}
  
Parser functions are very similar to variables, but take one or more parameters (technically, any magic word that takes a parameter is a parser function), and the name is sometimes prefixed with a hash to distinguish them from templates.
+
{{anchor|Parser functions}}
 +
<translate>
 +
== Parser functions == <!--T:148-->
  
This page only describes parser functions that are integral to the MediaWiki software. Other parser functions may be added by MediaWiki extensions such as the {{mediawiki|Extension:ParserFunctions|ParserFunctions extension}}. For those see [[Help:Extension:ParserFunctions]].
+
<!--T:149-->
 +
Parser functions are very similar to variables, but take one or more parameters (technically, any magic word that takes a parameter is a parser function), and the name is sometimes prefixed with a [[:en:Number sign|hash]] to distinguish them from templates.
  
=== URL data ===
+
<!--T:150-->
 +
This page only describes parser functions that are integral to the MediaWiki software. Other parser functions may be added by MediaWiki extensions such as the <tvar|ext-pf>{{ll|Extension:ParserFunctions}}</>. For those see <tvar|help-ext-pf>{{ll|Help:Extension:ParserFunctions}}</>.
 +
 
 +
=== Technical metadata of another page === <!--T:151-->
 +
</translate>
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Parser function
+
! width="15%" | <translate><!--T:152-->
! Input → Output
+
Parser function</translate>
! Description
+
! width="10%" | <translate><!--T:153-->
! Versions
+
Output<br />(for page [[MediaWiki]])</translate>
 +
! <translate><!--T:154-->
 +
Description</translate>
 +
! width="10%" | <translate><!--T:155-->
 +
Versions</translate>{{Anchor|PAGEID:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{PAGEID: </nowiki><translate><!--T:267-->
 +
''page name''</translate><nowiki> }}</nowiki></code>
 +
| {{PAGEID: MediaWiki }}
 +
| '''[<translate><!--T:330-->
 +
Expensive</translate>]''' <translate><!--T:156-->
 +
Returns the page identifier of the specified page*.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.23|compact=y|comment=and after|gerrit change=76534}}{{Anchor|PAGESIZE:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{PAGESIZE: </nowiki><translate><!--T:268-->
 +
''page name''<tvar|code1><nowiki> }}</nowiki></code> <br /><code><nowiki>{{PAGESIZE: </nowiki></>''page name''</translate><nowiki> |R}}</nowiki>
 +
| {{PAGESIZE: MediaWiki }} <br />{{PAGESIZE: MediaWiki |R}}
 +
| '''[<translate><!--T:331-->
 +
Expensive</translate>]''' <translate><!--T:157-->
 +
Returns the byte size of the specified page. Use "<tvar|r><code><nowiki>|R</nowiki></code></>" to get raw (unformatted) numbers.</translate>
 +
| {{Anchor|PAGESIZE}}{{ {{TNTN|MW version}} |version=1.13|compact=y|comment=and after|r=33551}}{{Anchor|PROTECTIONLEVEL:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{</nowiki>PROTECTIONLEVEL:<translate><!--T:269-->
 +
''action''</translate> &#124; <translate><!--T:270-->
 +
''page name''</translate>}}</code>
 +
| {{PROTECTIONLEVEL: edit | MediaWiki }}
 +
| '''[<translate><!--T:332-->
 +
Expensive</translate>]''' <translate><!--T:158-->
 +
Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the specified page. Returns an empty string if not protected.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.21|compact=y|comment=and after|r=44683}}{{Anchor|PROTECTIONEXPIRY:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{</nowiki>PROTECTIONEXPIRY:
 +
''action'' &#124;
 +
''page name''}}</code>
 +
| {{PROTECTIONLEVEL: edit | MediaWiki }}
 +
| '''[Expensive]''' Outputs the protection expiry (e.g. "20160418155030", "infinity") for a given action (e.g. "edit", "move") on the specified page. Returns "infinity" if not protected.
 +
| {{ {{TNTN|MW version}} |version=1.27|compact=y|comment=and after|gerrit change=255717}}{{Anchor|CASCADINGSOURCES:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{CASCADINGSOURCES:</nowiki> ''page name''<nowiki>}}</nowiki></code>
 +
| <!-- Leave this empty. -->
 +
| '''[<translate><!--T:333-->
 +
Expensive</translate>]''' <translate><!--T:292-->
 +
Returns the sources of any cascading protection acting on the specified page. Pages will not return their own title unless they transclude themselves.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.23|compact=y|comment=and after|gerrit change=104999}}{{Anchor|REVISIONID:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{REVISIONID: </nowiki><translate><!--T:271-->
 +
''page name''</translate><nowiki> }}</nowiki></code>
 +
| {{REVISIONID: MediaWiki }}
 +
| '''[<translate><!--T:334-->
 +
Expensive</translate>]''' <translate><!--T:160-->
 +
Unique revision ID of the last revision on the specified page*.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.23|compact=y|comment=and after|gerrit change=76534}}{{Anchor|REVISIONDAY:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{REVISIONDAY: </nowiki><translate><!--T:272-->
 +
''page name''</translate><nowiki> }}</nowiki></code>
 +
| {{REVISIONDAY: MediaWiki }}
 +
| '''[<translate><!--T:335-->
 +
Expensive</translate>]''' <translate><!--T:161-->
 +
Day of edit from the last revision of the specified page* (unpadded number).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.23|compact=y|comment=and after|gerrit change=76534}}{{Anchor|REVISIONDAY2:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{REVISIONDAY2: </nowiki><translate><!--T:273-->
 +
''page name''</translate><nowiki> }}</nowiki></code>
 +
| {{REVISIONDAY2: MediaWiki }}
 +
| '''[<translate><!--T:336-->
 +
Expensive</translate>]''' <translate><!--T:162-->
 +
Day of edit from the last revision of the specified page* (zero-padded number).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.23|compact=y|comment=and after|gerrit change=76534}}{{Anchor|REVISIONMONTH:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{REVISIONMONTH: </nowiki><translate><!--T:274-->
 +
''page name''</translate><nowiki> }}</nowiki></code>
 +
| {{REVISIONMONTH: MediaWiki }}
 +
| '''[<translate><!--T:337-->
 +
Expensive</translate>]''' <translate><!--T:163-->
 +
Month of edit from the last revision of the specified page* (zero-padded number as of {{mediawiki|rev:66200|1.17+}}, unpadded number in prior versions).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.23|compact=y|comment=and after|gerrit change=76534}}{{Anchor|REVISIONMONTH1:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{REVISIONMONTH1: </nowiki><translate><!--T:275-->
 +
''page name''</translate><nowiki> }}</nowiki></code>
 +
| {{REVISIONMONTH1: MediaWiki }}
 +
| '''[<translate><!--T:338-->
 +
Expensive</translate>]''' <translate><!--T:164-->
 +
Month of edit from the last revision of the specified page* (unpadded number).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.23|compact=y|comment=and after|gerrit change=76534}}{{Anchor|REVISIONYEAR:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{REVISIONYEAR: </nowiki><translate><!--T:276-->
 +
''page name''</translate><nowiki> }}</nowiki></code>
 +
| {{REVISIONYEAR: MediaWiki }}
 +
| '''[<translate><!--T:339-->
 +
Expensive</translate>]''' <translate><!--T:165-->
 +
Year of edit from the last revision of the specified page*.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.23|compact=y|comment=and after|gerrit change=76534}}{{Anchor|REVISIONTIMESTAMP:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{REVISIONTIMESTAMP: </nowiki><translate><!--T:277-->
 +
''page name''</translate><nowiki> }}</nowiki></code>
 +
| {{REVISIONTIMESTAMP: MediaWiki }}
 +
| '''[<translate><!--T:340-->
 +
Expensive</translate>]''' <translate><!--T:166-->
 +
Timestamp as of time of edit on the specified page*.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.23|compact=y|comment=and after|gerrit change=76534}}{{Anchor|REVISIONUSER:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{REVISIONUSER: </nowiki><translate><!--T:278-->
 +
''page name''</translate><nowiki> }}</nowiki></code>
 +
| {{REVISIONUSER: MediaWiki }}
 +
| '''[<translate><!--T:341-->
 +
Expensive</translate>]''' <translate><!--T:167-->
 +
The username from the last revision on the specified page*.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.23|compact=y|comment=and after|gerrit change=76534}}
 +
|-
 +
| colspan="4" | <translate><!--T:168-->
 +
*When the given param is equal to the current title of the parser, the parser function will yield the previous versions on preview and on substitution, that includes empty strings when used on page creation, but using the values from the current version for page view, including viewing old revisions. In this case it is a non-expensive parser function.</translate>
 +
|}
 +
 
 +
<translate>
 +
 
 +
=== URL data === <!--T:169-->
 +
</translate>
 +
 
 +
{| class="wikitable"
 +
|-
 +
! <translate><!--T:170-->
 +
Parser function</translate>
 +
! <translate><!--T:171-->
 +
Input → Output</translate>
 +
! <translate><!--T:172-->
 +
Description</translate>
 +
! <translate><!--T:173-->
 +
Versions</translate>
 
|-
 
|-
 
| colspan="4"| {{Anchor|localurl|LOCALURL}}
 
| colspan="4"| {{Anchor|localurl|LOCALURL}}
 
|-
 
|-
| <code><nowiki>{{localurl:</nowiki>''page name''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{localurl:</nowiki>''page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></code>
+
| <code><nowiki>{{localurl:</nowiki><translate><!--T:279-->
| <code><nowiki>{{localurl:MediaWiki}}</nowiki></code> → {{localurl:MediaWiki}} <br /><code><nowiki>{{localurl:MediaWiki|printable=yes}}</nowiki></code> → {{localurl:MediaWiki|printable=yes}}
+
''page name''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{localurl:</nowiki></>''page name''<br /><tvar|code2><nowiki>|</nowiki></>''query_string''</translate><nowiki>}}</nowiki></code>
| The relative path to the title.  
+
| <code><nowiki>{{localurl:MediaWiki}}</nowiki></code><br />→ {{localurl:MediaWiki}} <br /><code><nowiki>{{localurl:MediaWiki|printable=yes}}</nowiki></code><br />→ {{localurl:MediaWiki|printable=yes}}
 +
| <translate><!--T:174-->
 +
The relative path to the title. </translate>
 
|
 
|
 
|-
 
|-
 
| colspan="4"| {{Anchor|fullurl|FULLURL}}
 
| colspan="4"| {{Anchor|fullurl|FULLURL}}
 
|-
 
|-
| <code><nowiki>{{fullurl:</nowiki>''page name''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{fullurl:</nowiki>''page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{fullurl:</nowiki>''interwiki:remote page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></code>
+
| <code><nowiki>{{fullurl:</nowiki><translate><!--T:280-->
| <code><nowiki>{{fullurl:Category:Top level}}</nowiki></code> → {{fullurl:Category:Top level}} <br />
+
''page name''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{fullurl:</nowiki></>''page name''<tvar|code2><br /><nowiki>|</nowiki></>''query_string''<tvar|code3><nowiki>}}</nowiki></code> <br /><code><nowiki>{{fullurl:</nowiki></>''interwiki:remote page name''<tvar|code4><br /><nowiki>|</nowiki></>''query_string''</translate><nowiki>}}</nowiki></code>
<code><nowiki>{{fullurl:Category:Top level|action=edit}}</nowiki></code> → {{fullurl:Category:Top level|action=edit}}
+
| <code><nowiki>{{fullurl:Category:Top level}}</nowiki></code><br />→ {{fullurl:Category:Top level}} <br />
| A protocol-relative path to the title. This will also resolve [[Manual:Interwiki|interwiki]] prefixes. '''Note:''' Unbracketed (plain) protocol-relative links are not automagically linked.
+
<code><nowiki>{{fullurl:Category:Top level|action=edit}}</nowiki></code><br />→ {{fullurl:Category:Top level|action=edit}}<br />
| 1.5+
+
<code><nowiki>https:{{fullurl:s:Electra|action=edit}}</nowiki></code><br />→ https:{{fullurl:s:Electra|action=edit}}<br />
 +
<code><nowiki>https:{{fullurl:s:es:Electra|action=edit}}</nowiki></code><br />→ https:{{fullurl:s:es:Electra|action=edit}}
 +
| <translate><!--T:175-->
 +
A protocol-relative path to the title. This will also resolve [[<tvar|manual-interwiki>Special:MyLanguage/Manual:Interwiki</>|interwiki]] prefixes. '''Note:''' Unbracketed (plain) protocol-relative links are not automagically linked.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}}
 
|-
 
|-
 
| colspan="4"| {{Anchor|canonicalurl|CANONICALURL}}
 
| colspan="4"| {{Anchor|canonicalurl|CANONICALURL}}
 
|-
 
|-
| <code><nowiki>{{canonicalurl:</nowiki>''page name''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{canonicalurl:</nowiki>''page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{canonicalurl:</nowiki>''interwiki:remote page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></code>
+
| <code><nowiki>{{canonicalurl:</nowiki><translate><!--T:281-->
| <code><nowiki>{{canonicalurl:Category:Top level}}</nowiki></code> → {{canonicalurl:Category:Top level}} <br />
+
''page name''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{canonicalurl:</nowiki></>''page name''<tvar|code2><br /><nowiki>|</nowiki></>''query_string''<tvar|code3><nowiki>}}</nowiki></code> <br /><code><nowiki>{{canonicalurl:</nowiki></>''interwiki:remote page name''<tvar|code4><br /><nowiki>|</nowiki></>''query_string''</translate><nowiki>}}</nowiki></code>
<code><nowiki>{{canonicalurl:Category:Top level|action=edit}}</nowiki></code> → {{canonicalurl:Category:Top level|action=edit}}
+
| <code><nowiki>{{canonicalurl:Category:Top level}}</nowiki></code><br />→ {{canonicalurl:Category:Top level}} <br />
| The absolute path to the title, using the canonical URL. This will also resolve [[Manual:Interwiki|interwiki]] prefixes.
+
<code><nowiki>{{canonicalurl:Category:Top level|action=edit}}</nowiki></code><br />→ {{canonicalurl:Category:Top level|action=edit}}
| 1.18+
+
| <translate><!--T:176-->
 +
The absolute path to the title, using the canonical URL. This will also resolve [[<tvar|manual-interwiki>Special:MyLanguage/Manual:Interwiki</>|interwiki]] prefixes.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.18|compact=y|comment=and after}}
 
|-
 
|-
 
| colspan="4"| {{Anchor|filepath|FILEPATH}}
 
| colspan="4"| {{Anchor|filepath|FILEPATH}}
 
|-
 
|-
| <code><nowiki>{{filepath:</nowiki>''file name''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{filepath:</nowiki>''file name''<nowiki>|nowiki}}</nowiki></code> <br /><code><nowiki>{{filepath:</nowiki>''file name''<nowiki>|</nowiki>''thumbnail_size''<nowiki>}}</nowiki></code>
+
| <code><nowiki>{{filepath:</nowiki><translate><!--T:282-->
| <code><nowiki>{{filepath:Wiki.png}}</nowiki></code> → {{filepath:Wiki.png}} <br />
+
''file name''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{filepath:</nowiki></>''file name''<tvar|code2><nowiki>|nowiki}}</nowiki></code> <br /><code><nowiki>{{filepath:</nowiki></>''file name''<tvar|code3><nowiki>|</nowiki></>''thumbnail_size''</translate><nowiki>}}</nowiki></code>
<code><nowiki>{{filepath:Wiki.png|nowiki}}</nowiki></code> → {{filepath:Wiki.png|nowiki}} <br />
+
| <code><nowiki>{{filepath:Wiki.png}}</nowiki></code><br />→ {{filepath:Wiki.png}} <br />
<code><nowiki>{{filepath:Example.svg|300}}</nowiki></code> → {{filepath:Example.svg|300}} <br />
+
<code><nowiki>{{filepath:Wiki.png|nowiki}}</nowiki></code><br />→ {{filepath:Wiki.png|nowiki}} <br />
| A protocol-relative path to the full size or thumbnail ({{mediawiki|rev:80813|1.18+}}) of a media file.
+
<code><nowiki>{{filepath:Example.svg|300}}</nowiki></code><br />→ {{filepath:Example.svg|300}} <br />
| {{mediawiki|rev:25854|1.12+}} <br />{{mediawiki|rev:80813|1.18+}}
+
| <translate><!--T:177-->
 +
A protocol-relative path to the full size or thumbnail ({{mediawiki|rev:80813|1.18+}}) of a media file.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.12|compact=y|comment=and after|r=25854}} <br />{{ {{TNTN|MW version}} |version=1.18|compact=y|comment=and after|r=80813}}
 
|-
 
|-
 
| colspan="4"| {{Anchor|urlencode|URLENCODE}}
 
| colspan="4"| {{Anchor|urlencode|URLENCODE}}
 
|-
 
|-
| <code><nowiki>{{urlencode:</nowiki>''string''<nowiki>}}</nowiki></code> (or <code><nowiki>{{urlencode:</nowiki>''string''<nowiki>|QUERY}}</nowiki></code>) <br /><code><nowiki>{{urlencode:</nowiki>''string''<nowiki>|WIKI}}</nowiki></code> <br /><code><nowiki>{{urlencode:</nowiki>''string''<nowiki>|PATH}}</nowiki></code>
+
| <code><nowiki>{{urlencode:</nowiki><translate><!--T:283-->
| <code><nowiki>{{urlencode:x y z á é}}</nowiki></code> (or <code><nowiki>{{urlencode:x y z á é|QUERY}})</nowiki></code> → {{urlencode:x y z á é}} <br /><code><nowiki>{{urlencode:x y z á é|WIKI}}</nowiki></code> → x_y_z_%C3%A1_%C3%A9 <br /><code><nowiki>{{urlencode:x y z á é|PATH}}</nowiki></code> → x%20y%20z%20%C3%A1%20%C3%A9
+
''string''<tvar|code1><nowiki>}}</nowiki></code></> or <br /><tvar|code2><code><nowiki>{{urlencode:</nowiki></>''string''<tvar|code3><nowiki>|QUERY}}</nowiki></code></> <tvar|code4><br /><code><nowiki>{{urlencode:</nowiki></>''string''<tvar|code5><nowiki>|WIKI}}</nowiki></code> <br /><code><nowiki>{{urlencode:</nowiki></>''string''</translate><nowiki>|PATH}}</nowiki></code>
Note that the default changed from <code>|WIKI</code> to <code>|QUERY</code> in 1.17; this may break templates that rely on this function.
+
| <code><nowiki>{{urlencode:x:y/z á é}}</nowiki></code> or <br /><code><nowiki>{{urlencode:x:y/z á é|QUERY}}</nowiki></code><br />→ {{urlencode:x:y/z á é}} <br /><code><nowiki>{{urlencode:x:y/z á é|WIKI}}</nowiki></code><br />→ {{urlencode:x:y/z á é|WIKI}} <br /><code><nowiki>{{urlencode:x:y/z á é|PATH}}</nowiki></code><br />→ {{urlencode:x:y/z á é|PATH}}
| The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete [[Extension:StringFunctions]].
+
<translate><!--T:178-->
| {{mediawiki|rev:14273|1.7+}} (or {{mediawiki|rev:64726|1.17+}}) <br />{{mediawiki|rev:64726|1.17+}} <br />{{mediawiki|rev:64726|1.17+}}
+
Note that the default changed from <tvar|wiki><code>|WIKI</code></> to <tvar|query><code>|QUERY</code></> in 1.17; this may break templates that rely on this function.</translate>
 +
| <translate><!--T:179-->
 +
The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete <tvar|ext-stringfunctions>{{ll|Extension:StringFunctions}}</></translate>.<br /><table class="wikitable"><caption><translate><!--T:305-->
 +
Encoding</translate></caption><tr><th><translate><!--T:306-->
 +
code</translate></th><th><translate><!--T:307-->
 +
space</translate></th></tr><tr><td>&nbsp;''none''</td><td><samp>&nbsp;+&nbsp;</samp></td></tr><tr><td><kbd>QUERY</kbd></td><td><samp>&nbsp;+&nbsp;</samp></td></tr><tr><td><kbd>&nbsp;WIKI</kbd></td><td><samp>&nbsp;_&nbsp;</samp></td></tr><tr><td><kbd>&nbsp;PATH</kbd></td><td><samp>%20</samp></td></tr></table>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after|r=14273}} (or {{ {{TNTN|MW version}} |version=1.17|compact=y|comment=and after|r=64726}} <br />{{ {{TNTN|MW version}} |version=1.17|compact=y|comment=and after|r=64726}} <br />{{ {{TNTN|MW version}} |version=1.17|compact=y|comment=and after|r=64726}})
 
|-
 
|-
 
| colspan="4"| {{Anchor|anchorencode|ANCHORENCODE}}
 
| colspan="4"| {{Anchor|anchorencode|ANCHORENCODE}}
 
|-
 
|-
| <code><nowiki>{{anchorencode:</nowiki>''string''<nowiki>}}</nowiki></code>
+
| <code><nowiki>{{anchorencode:</nowiki><translate><!--T:284-->
| <code><nowiki>{{anchorencode:x y z á é}}</nowiki></code> → {{anchorencode:x y z á é}}
+
''string''</translate><nowiki>}}</nowiki></code>
| The input encoded for use in URL section anchors (after the “#” symbol in a URL).
+
| <code><nowiki>{{anchorencode:x y z á é}}</nowiki></code><br />→ {{anchorencode:x y z á é}}
| {{mediawiki|rev:16279|1.8+}}
+
| <translate><!--T:180-->
 +
The input encoded for use in URL section anchors (after the “#” symbol in a URL).</translate>
 +
| {{ {{TNTN|MW version}} |version=1.6|compact=y|comment=and after|r=16279}}
 
|}
 
|}
  
=== Namespaces ===
+
{{anchor|Namespaces_2}}
 +
<translate>
 +
=== Namespaces === <!--T:181-->
  
<code><nowiki>{{ns:}}</nowiki></code> returns the current localized name for the [[Help:Namespace|namespace]] with that index, canonical name, or local alias. Thus <code><nowiki>{{ns:6}}</nowiki></code>, <code><nowiki>{{ns:File}}</nowiki></code>, and <code><nowiki>{{ns:Image}}</nowiki></code> (an old name for the File namespace) all return "{{ns:6}}". On a wiki where the content language is French, <code><nowiki>{{ns:Fichier}}</nowiki></code> is also valid, but <code><nowiki>{{ns:Datei}}</nowiki></code> (the localisation of "File" in German) is not.
+
<!--T:182-->
 +
<tvar|ns><code><nowiki>{{ns:}}</nowiki></code></> returns the current localized name for the [[<tvar|help-ns>Special:MyLanguage/Help:Namespace</>|namespace]] with that index, canonical name, or local alias. Thus <tvar|ns6><code><nowiki>{{ns:6}}</nowiki></code></>, <tvar|ns-file><code><nowiki>{{ns:File}}</nowiki></code></>, and <tvar|ns-img><code><nowiki>{{ns:Image}}</nowiki></code></> (an old name for the File namespace) all return "{{ns:6}}". On a wiki where the content language is French, <tvar|ns-file-de><code><nowiki>{{ns:Fichier}}</nowiki></code></> is also valid, but <tvar|ns-file-incorrect><code><nowiki>{{ns:Datei}}</nowiki></code></> (the localisation of "File" in German) is not.
 +
 
 +
<!--T:183-->
 +
<tvar|nse><code><nowiki>{{nse:}}</nowiki></code></> is the equivalent encoded for MediaWiki URLs. It does the same, but it replaces spaces with underscores, making it usable in external links.</translate>
  
<code><nowiki>{{nse:}}</nowiki></code> is the equivalent encoded for MediaWiki URLs. It does the same, but it replaces spaces with underscores, making it usable in external links.
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! colspan="2" width="50%" | Content namespaces
+
! colspan="2" width="50%" | <translate><!--T:258-->
! rowspan="12" |
+
Content namespaces</translate>
! colspan="2" width=%50%" | Talk namespaces
+
! rowspan="11" |
 +
! colspan="2" width=%50%" | <translate><!--T:259-->
 +
Talk namespaces</translate>
 
|-
 
|-
! Usage
+
! <translate><!--T:184-->
! Output
+
Usage</translate>
! Usage
+
! <translate><!--T:185-->
! Output
+
Output</translate>
 +
! <translate><!--T:186-->
 +
Usage</translate>
 +
! <translate><!--T:187-->
 +
Output</translate>
 
|-
 
|-
| <code><nowiki>{{ns:-2}}</nowiki></code> or <code><nowiki>{{ns:Media}}</nowiki></code>
+
| <code><nowiki>{{ns:-2}}</nowiki></code> / <code><nowiki>{{ns:Media}}</nowiki></code>
| {{ns:-2}} || ||
+
| {{ns:-2}}  
 +
| <code><nowiki>{{ns:-1}}</nowiki></code> / <code><nowiki>{{ns:Special}}</nowiki></code>
 +
| {{ns:-1}}<br/>''(no '''talk''' page)''
 
|-
 
|-
| <code><nowiki>{{ns:-1}}</nowiki></code> or <code><nowiki>{{ns:Special}}</nowiki></code>
+
| <code><nowiki>{{ns:0}}</nowiki></code> / <code><nowiki>{{ns:}}</nowiki></code>
| {{ns:-1}} || ||
+
| {{ns:0}}
|-
+
| <code><nowiki>{{ns:1}}</nowiki></code> / <code><nowiki>{{ns:Talk}}</nowiki></code>
| <code><nowiki>{{ns:0}}</nowiki></code> or <code><nowiki>{{ns:}}</nowiki></code>
 
| {{ns:}}
 
| <code><nowiki>{{ns:1}}</nowiki></code> or <code><nowiki>{{ns:Talk}}</nowiki></code>
 
 
| {{ns:1}}
 
| {{ns:1}}
 
|-
 
|-
| <code><nowiki>{{ns:2}}</nowiki></code> or <code><nowiki>{{ns:User}}</nowiki></code>
+
| <code><nowiki>{{ns:2}}</nowiki></code> / <code><nowiki>{{ns:User}}</nowiki></code>
 
| {{ns:2}}
 
| {{ns:2}}
| <code><nowiki>{{ns:3}}</nowiki></code> or <code><nowiki>{{ns:User talk}}</nowiki></code>
+
| <code><nowiki>{{ns:3}}</nowiki></code> / <code><nowiki>{{ns:User talk}}</nowiki></code>
 
| {{ns:3}}
 
| {{ns:3}}
 
|-
 
|-
| <code><nowiki>{{ns:4}}</nowiki></code> or <code><nowiki>{{ns:Project}}</nowiki></code>
+
| <code><nowiki>{{ns:4}}</nowiki></code> / <code><nowiki>{{ns:Project}}</nowiki></code>
 
| {{ns:4}} <br/>''Varies between wikis''
 
| {{ns:4}} <br/>''Varies between wikis''
| <code><nowiki>{{ns:5}}</nowiki></code> or <code><nowiki>{{ns:Project talk}}</nowiki></code>
+
| <code><nowiki>{{ns:5}}</nowiki></code> / <code><nowiki>{{ns:Project talk}}</nowiki></code>
 
| {{ns:5}}
 
| {{ns:5}}
 
|-
 
|-
| <code><nowiki>{{ns:6}}</nowiki></code> or <code><nowiki>{{ns:File}}</nowiki></code> or <code><nowiki>{{ns:Image}}</nowiki></code>
+
| <code><nowiki>{{ns:6}}</nowiki></code> / <code><nowiki>{{ns:File}}</nowiki></code> or <code><nowiki>{{ns:Image}}</nowiki></code>
 
| {{ns:6}}
 
| {{ns:6}}
| <code><nowiki>{{ns:7}}</nowiki></code> or <code><nowiki>{{ns:File talk}}</nowiki></code> or <code><nowiki>{{ns:Image talk}}</nowiki></code>
+
| <code><nowiki>{{ns:7}}</nowiki></code> / <code><nowiki>{{ns:File talk}}</nowiki></code> or <code><nowiki>{{ns:Image talk}}</nowiki></code>
 
| {{ns:7}}
 
| {{ns:7}}
 
|-
 
|-
| <code><nowiki>{{ns:8}}</nowiki></code> or <code><nowiki>{{ns:MediaWiki}}</nowiki></code>
+
| <code><nowiki>{{ns:8}}</nowiki></code> / <code><nowiki>{{ns:MediaWiki}}</nowiki></code>
 
| {{ns:8}}
 
| {{ns:8}}
| <code><nowiki>{{ns:9}}</nowiki></code> or <code><nowiki>{{ns:MediaWiki talk}}</nowiki></code>
+
| <code><nowiki>{{ns:9}}</nowiki></code> / <code><nowiki>{{ns:MediaWiki talk}}</nowiki></code>
 
| {{ns:9}}
 
| {{ns:9}}
 
|-
 
|-
| <code><nowiki>{{ns:10}}</nowiki></code> or <code><nowiki>{{ns:Template}}</nowiki></code>
+
| <code><nowiki>{{ns:10}}</nowiki></code> / <code><nowiki>{{ns:Template}}</nowiki></code>
 
| {{ns:10}}
 
| {{ns:10}}
| <code><nowiki>{{ns:11}}</nowiki></code> or <code><nowiki>{{ns:Template talk}}</nowiki></code>
+
| <code><nowiki>{{ns:11}}</nowiki></code> / <code><nowiki>{{ns:Template talk}}</nowiki></code>
 
| {{ns:11}}
 
| {{ns:11}}
 
|-
 
|-
| <code><nowiki>{{ns:12}}</nowiki></code> or <code><nowiki>{{ns:Help}}</nowiki></code>
+
| <code><nowiki>{{ns:12}}</nowiki></code> / <code><nowiki>{{ns:Help}}</nowiki></code>
 
| {{ns:12}}
 
| {{ns:12}}
| <code><nowiki>{{ns:13}}</nowiki></code> or <code><nowiki>{{ns:Help talk}}</nowiki></code>
+
| <code><nowiki>{{ns:13}}</nowiki></code> / <code><nowiki>{{ns:Help talk}}</nowiki></code>
 
| {{ns:13}}
 
| {{ns:13}}
 
|-
 
|-
| <code><nowiki>{{ns:14}}</nowiki></code> or <code><nowiki>{{ns:Category}}</nowiki></code>
+
| <code><nowiki>{{ns:14}}</nowiki></code> / <code><nowiki>{{ns:Category}}</nowiki></code>
 
| {{ns:14}}
 
| {{ns:14}}
| <code><nowiki>{{ns:15}}</nowiki></code> or <code><nowiki>{{ns:Category talk}}</nowiki></code>
+
| <code><nowiki>{{ns:15}}</nowiki></code> / <code><nowiki>{{ns:Category talk}}</nowiki></code>
 
| {{ns:15}}
 
| {{ns:15}}
 
|}
 
|}
  
Don't confuse localised namespaces with [[Manual:Using custom namespaces|custom namespaces]].
+
<translate><!--T:188-->
 +
Don't confuse localised namespaces with [[<tvar|manual-custom-ns>Special:MyLanguage/Manual:Using custom namespaces</>|custom namespaces]].</translate>
  
=== Formatting ===
+
{{anchor|Formatting}}
 
+
<translate>
<!-- Well gosh, with the source of the examples hidden, who can tell what you are inputting without looking here in the source? -->
+
=== Formatting === <!--T:189-->
 +
</translate>
  
 
{| class="wikitable"
 
{| class="wikitable"
! Usage
+
! width="10%" | <translate><!--T:190-->
! Input → Output
+
Usage</translate>
! Description
+
! width="40%" | <translate><!--T:191-->
! Version
+
Input → Output</translate>
 +
! <translate><!--T:192-->
 +
Description</translate>
 +
! width="10%" | <translate><!--T:193-->
 +
Version</translate>
 
|-
 
|-
| <code><nowiki>{{formatnum:</nowiki>''unformatted number''<nowiki>}}</nowiki></code> <br />
+
| <code><nowiki>{{formatnum:</nowiki>''unformatted number''<nowiki>}}</nowiki></code> <br />
 
<code><nowiki>{{formatnum:</nowiki>''formatnum-formatted&nbsp;number''<nowiki>|R}}</nowiki></code> <br />
 
<code><nowiki>{{formatnum:</nowiki>''formatnum-formatted&nbsp;number''<nowiki>|R}}</nowiki></code> <br />
<code><nowiki>{{formatnum:</nowiki>''unformatted number''<nowiki>|NOSEP}}</nowiki></code>
+
<code><nowiki>{{formatnum:</nowiki>''unformatted number''<nowiki>|NOSEP}}</nowiki></code>
 
|  
 
|  
* Simple:
+
* <translate><!--T:194-->
** <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code> <br/> → {{formatnum:987654321.654321}} <br />
+
Simple:</translate>
** <code><nowiki>{{formatnum:987,654,321.654321|R}}</nowiki></code> <br/> → {{formatnum:987,654,321.654321|R}}
+
** <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code> <br/> → {{formatnum:987654321.654321}}
* Advanced:
+
** <code><nowiki>{{formatnum:</nowiki>{{formatnum:987654321.654321}}<nowiki>|R}}</nowiki></code> <br/> → {{formatnum:{{formatnum:987654321.654321}}|R}}
** <code><nowiki>{{formatnum:{{formatnum:987654321.654321}}|R}}</nowiki></code> <br/> → 987654321.654321 (on any locale) <br />
+
* <translate><!--T:195-->
** <code><nowiki>{{formatnum:00001}}</nowiki></code> <br/> → {{formatnum:00001}} <br />
+
Advanced:</translate>
** Examples with {{#language:hi|en}} locale:
+
** <code><nowiki>{{formatnum:{{formatnum:987654321.654321}}|R}}</nowiki></code> <br/> → {{formatnum:{{formatnum:987654321.654321}}|R}} <translate><!--T:196-->
*** <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code> <br/> → 98,76,54,321.654321
+
(on any locale)</translate>
*** <code><nowiki>{{formatnum:987654321.654321 |NOSEP}}</nowiki></code> <br/> → 987654321.654321
+
** <code><nowiki>{{formatnum:00001}}</nowiki></code> <br/> → {{formatnum:00001}}
*** <code><nowiki>{{formatnum:98,76,54,321.654321 |NOSEP|R}}</nowiki></code> <br/> → 98,76,54,321.654321
+
** <code><nowiki>{{formatnum:987654321.654321 |NOSEP}}</nowiki></code> <br/> → {{formatnum:987654321.654321 |NOSEP}}
 
+
** <translate><!--T:197-->
 +
Examples with [[w:Bengali numerals|{{#language:bn|en}} locale]]:</translate>
 +
*** <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code> <br/> → ৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১
 +
*** <code><nowiki>{{formatnum:987654321.654321 |NOSEP}}</nowiki></code> <br/> → ৯৮৭৬৫৪৩২১.৬৫৪৩২১
 +
*** <code><nowiki>{{formatnum:৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১ |R}}</nowiki></code> <br/> → 987654321.654321
 
----
 
----
Unsupported: <br />
+
<translate><!--T:198-->
<code><nowiki>{{formatnum:{{formatnum:987.654.321}}}}</nowiki></code> <br/> → 987 654 321 (e.g. with Italian locale)
+
Unsupported:</translate> <br />
 +
<code><nowiki>{{formatnum:{{formatnum:987.654.321}}}}</nowiki></code> <br/> → 987 654 321 <translate><!--T:199-->
 +
(e.g. with Italian locale)</translate>
 
----
 
----
Examples of wrong input (unreliable output), with or without <code>|R</code>: <br />
+
<translate><!--T:200-->
<code><nowiki>{{formatnum:987,654.321|R}}</nowiki></code> (the least broken) <br/>
+
Examples of wrong input (unreliable output), with or without <code>|R</code>:</translate> <br />
 +
<code><nowiki>{{formatnum:987,654.321|R}}</nowiki></code> <translate><!--T:201-->
 +
(the least broken)</translate> <br/>
 
<code><nowiki>{{formatnum:987.654,321|R}}</nowiki></code> <br/>
 
<code><nowiki>{{formatnum:987.654,321|R}}</nowiki></code> <br/>
 
<code><nowiki>{{formatnum:987 654,321|R}}</nowiki></code> <br/>
 
<code><nowiki>{{formatnum:987 654,321|R}}</nowiki></code> <br/>
 
<code><nowiki>{{formatnum:987&amp;nbsp;654,321|R}}</nowiki></code>
 
<code><nowiki>{{formatnum:987&amp;nbsp;654,321|R}}</nowiki></code>
| Takes an unformatted number (arab, no group separators and <code>.</code> as decimal separator) and outputs it in the localized digit script and formatted with decimal and decimal group separators, according to the wiki's default locale. <br />
+
| <translate><!--T:202-->
The <code><nowiki>|</nowiki>R</code> parameter can be used to reverse the behaviour, for use in mathematical situations: it's reliable and should be used only to deformat numbers who are known to be formatted exactly as formatnum formats them with the wiki's locale. <br/>
+
Takes an unformatted number (arab, no group separators and <code>.</code> as decimal separator) and outputs it in the localized digit script and formatted with decimal and decimal group separators, according to the wiki's default locale. <br />
<small>{{warning}} Leading zeroes are not removed, you can use <nowiki>{{#expr:00001}}</nowiki> instead if you have [[Extension:ParserFunctions]] installed.</small> <br/>
+
The <code><nowiki>|R</nowiki></code> parameter can be used to reverse the behavior, for use in mathematical situations: it's reliable and should be used only to deformat numbers which are known to be formatted exactly as formatnum formats them with the wiki's locale.</translate><br/>
<small>{{warning}} If you don't input numbers in the exact format required, don't expect any reliable output, especially on non-English wikis.</small><br/>
+
<translate><!--T:205-->
<small>{{warning}} The <code>NOSEP</code> ("no separators") parameter means that no group / decimal separators are changed; formatnum will only transform the digits themselves in languages which don't use the [[w:en:Hindu–Arabic numeral system|Hindu–Arabic numeral system]]. <code>NOSEP</code> can also prevent non-standard digit groupings you wouldn't expect.</small>
+
The <code>NOSEP</code> ("no separators") parameter means that no group / decimal separators are changed; formatnum will only transform the digits themselves in languages which don't use the [[w:en:Hindu–Arabic numeral system|Hindu–Arabic numeral system]]. <code>NOSEP</code> can also prevent non-standard digit groupings you wouldn't expect.</translate>
 +
 
 +
<small>{{TNT|warning}} <translate><!--T:203-->
 +
Leading zeroes are not removed, you can use <nowiki>{{#expr:00001}}</nowiki> instead if you have <tvar|ext-pf>{{ll|Extension:ParserFunctions}}</> installed.</translate></small> <br/>
 +
 
 +
<small>{{TNT|warning}} <translate><!--T:204-->
 +
If you don't input numbers in the exact format required, don't expect any reliable output, especially on non-English wikis.</translate></small><br/>
 
----
 
----
If you really need to format (according the wiki's locale) a number in unknown input format, you could try and use <code>formatnum</code> two times (but not if it can have a decimal group, or its separator will be eaten or the number won't be formatted).
 
  
| 1.7+ <br />{{mediawiki|rev:32012|1.13+}}
+
<translate><!--T:206-->
 +
If you really need to format (according the wiki's locale) a number in unknown input format, you could try and use <code>formatnum</code> two times (but not if it can have a decimal group, or its separator will be eaten or the number won't be formatted). Be aware that this is more a hack than a regular way to proceed, thus the output may be not reliable.</translate>
 +
 
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} <br />{{ {{TNTN|MW version}} |version=1.13|compact=y|comment=and after|r=32012}}
 
|-
 
|-
 
|
 
|
<code><nowiki>{{#dateformat:</nowiki>''date''<nowiki>}}
+
<code><nowiki>{{#dateformat:</nowiki>''date''<nowiki>}}</nowiki></code><br />
{{#formatdate:</nowiki>''date''<nowiki>}}
+
<code><nowiki>{{#formatdate:</nowiki>''date''<nowiki>}}</nowiki></code><br />
{{#dateformat:</nowiki>''date''{{!}}''format''<nowiki>}}
+
<code><nowiki>{{#dateformat:</nowiki>''date''{{!}}''format''<nowiki>}}</nowiki></code><br />
{{#formatdate:</nowiki>''date''{{!}}''format''<nowiki>}}</nowiki></code>
+
<code><nowiki>{{#formatdate:</nowiki>''date''{{!}}''format''<nowiki>}}</nowiki></code>
 
|  
 
|  
<code><nowiki>{{#dateformat:25 deC 2009|ymd}}</nowiki></code> <br/>
+
<code><nowiki>{{#dateformat:25 dec 2009|ymd}}</nowiki></code> <br/>
→ {{#dateformat:25 deC 2009|ymd}} (your pref), 2009 DeC 25 (default) <br/>
+
→ {{#dateformat:25 dec 2009|ymd}} <translate><!--T:207-->
 +
(your pref), 2009 Dec 25 (default)</translate> <br/>
 
<code><nowiki>{{#formatdate:dec 25,2009|dmy}}</nowiki></code> <br/>
 
<code><nowiki>{{#formatdate:dec 25,2009|dmy}}</nowiki></code> <br/>
→ {{#formatdate:dec 25,2009|dmy}} (your pref), 25 Dec 2009 (default) <br/>
+
→ {{#formatdate:dec 25,2009|dmy}} <translate><!--T:208-->
 +
(your pref), 25 Dec 2009 (default)</translate> <br/>
 
<code><nowiki>{{#dateformat:2009-12-25|mdy}}</nowiki></code> <br/>
 
<code><nowiki>{{#dateformat:2009-12-25|mdy}}</nowiki></code> <br/>
→ {{#dateformat:2009-12-25|mdy}} (your pref), December 25, 2009 (default) <br/>
+
→ {{#dateformat:2009-12-25|mdy}} <translate><!--T:209-->
 +
(your pref), December 25, 2009 (default)</translate> <br/>
 
<code><nowiki>{{#formatdate:2009 dec 25|ISO 8601}}</nowiki></code> <br/>
 
<code><nowiki>{{#formatdate:2009 dec 25|ISO 8601}}</nowiki></code> <br/>
→ {{#formatdate:2009 dec 25|ISO 8601}} (your pref), 2009-12-25 (default) <br/>
+
→ {{#formatdate:2009 dec 25|ISO 8601}} <translate><!--T:210-->
 +
(your pref), 2009-12-25 (default)</translate> <br/>
 
<code><nowiki>{{#dateformat:25 decEmber|mdy}}</nowiki></code> <br/>
 
<code><nowiki>{{#dateformat:25 decEmber|mdy}}</nowiki></code> <br/>
→ {{#dateformat:25 decEmber|mdy}} (your pref), DecEmber 25 (default) <br/>
+
→ {{#dateformat:25 decEmber|mdy}} <translate><!--T:211-->
 +
(your pref), DecEmber 25 (default)</translate> <br/>
 +
<translate><!--T:212-->
 +
''Note:'' In the example hereinbefore, "your pref" refers to your date preference on the current MediaWiki wiki only.
 +
</translate>
  
''Note:'' In the example hereinbefore, "your pref" refers to your date preference on the current MediaWiki wiki only.
+
| <translate><!--T:213-->
| Formats an unlinked date based on user "date format" preference, and adds metadata tagging it as a formatted date. For logged-out users and those who have not set a date format in their preferences, dates can be given a default: <code>mdy</code>, <code>dmy</code>, <code>ymd</code>, <code>ISO&nbsp;8601</code> (all case sensitive). If only the month and day are given, only <code>mdy</code> and <code>dmy</code> are valid. If a format is not specified or is invalid, the input format is used as a default. If the supplied date is not recognized as a valid date (specifically, if it contains any metadata such as from a nested use of these or similar templates), it is rendered unchanged, and no (additional) metadata is generated. <br/><small>{{warning}}Although the ISO 8601 standard requires that dates be in the Gregorian calendar, the ISO parameter in this function will still format dates that fall outside the usual Gregorian range (e.g. dates prior to 1583). Also, the magic word cannot properly convert between negative years (used with ISO 8601) and years BC or years BCE (used in general writing).</small>
+
Formats an unlinked date based on user "date format" preference, and adds metadata tagging it as a formatted date. For logged-out users and those who have not set a date format in their preferences, dates can be given a default: <code>mdy</code>, <code>dmy</code>, <code>ymd</code>, <code>ISO&nbsp;8601</code> (all case sensitive). If only the month and day are given, only <code>mdy</code> and <code>dmy</code> are valid. If a format is not specified or is invalid, the input format is used as a default. If the supplied date is not recognized as a valid date (specifically, if it contains any metadata such as from a nested use of these or similar templates), it is rendered unchanged, and no (additional) metadata is generated.</translate> <br/>
| {{mediawiki|rev:48249|1.15+}}
+
 
 +
<small>{{TNT|warning}}<translate><!--T:214-->
 +
Although the ISO 8601 standard requires that dates be in the Gregorian calendar, the ISO parameter in this function will still format dates that fall outside the usual Gregorian range (e.g. dates prior to 1583). Also, the magic word cannot properly convert between negative years (used with ISO 8601) and years BC or years BCE (used in general writing).</translate></small>
 +
 
 +
| {{ {{TNTN|MW version}} |version=1.15|compact=y|comment=and after|r=48249}}
 
|-
 
|-
 
| <code><nowiki>{{lc:</nowiki>''string''<nowiki>}}</nowiki></code>
 
| <code><nowiki>{{lc:</nowiki>''string''<nowiki>}}</nowiki></code>
 
| <code><nowiki>{{lc:DATA CENTER}}</nowiki></code> → {{lc:DATA CENTER}}
 
| <code><nowiki>{{lc:DATA CENTER}}</nowiki></code> → {{lc:DATA CENTER}}
| The lowercase input.
+
| {{Anchor|lc|Lc|LC}}<translate><!--T:215-->
| 1.5+
+
The lowercase input.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{lcfirst:</nowiki>''string''<nowiki>}}</nowiki></code>
 
| <code><nowiki>{{lcfirst:</nowiki>''string''<nowiki>}}</nowiki></code>
 
| <code><nowiki>{{lcfirst:DATA center}}</nowiki></code> → {{lcfirst:DATA center}}
 
| <code><nowiki>{{lcfirst:DATA center}}</nowiki></code> → {{lcfirst:DATA center}}
| The input with the <u>very first</u> character lowercase.
+
| {{Anchor|lcfirst|Lcfirst|LCFIRST}}<translate><!--T:216-->
| 1.5+
+
The input with the <u>very first</u> character lowercase.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{uc:</nowiki>''string''<nowiki>}}</nowiki></code>
 
| <code><nowiki>{{uc:</nowiki>''string''<nowiki>}}</nowiki></code>
 
| <code><nowiki>{{uc:text transform}}</nowiki></code> → {{uc:text transform}}
 
| <code><nowiki>{{uc:text transform}}</nowiki></code> → {{uc:text transform}}
| The uppercase input.
+
| {{Anchor|uc|Uc|UC}}<translate><!--T:217-->
| 1.5+
+
The uppercase input.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{ucfirst:</nowiki>''string''<nowiki>}}</nowiki></code>
 
| <code><nowiki>{{ucfirst:</nowiki>''string''<nowiki>}}</nowiki></code>
 
| <code><nowiki>{{ucfirst:text TRANSFORM}}</nowiki></code> → {{ucfirst:text TRANSFORM}}
 
| <code><nowiki>{{ucfirst:text TRANSFORM}}</nowiki></code> → {{ucfirst:text TRANSFORM}}
| The input with the <u>very first</u> character uppercase.
+
| {{Anchor|ucfirst|Ucfirst|UCFIRST}}<translate><!--T:218-->
| 1.5+
+
The input with the <u>very first</u> character uppercase.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}}
 
|-
 
|-
| <code><nowiki>{{padleft:xyz|</nowiki>''stringlength''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{padleft:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''char''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{padleft:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''string''<nowiki>}}</nowiki></code>
+
| <code><nowiki>{{padleft:xyz|</nowiki>''stringlength''<nowiki>}}</nowiki></code> <br />
| <code><nowiki>{{padleft:xyz|5}}</nowiki></code> → {{padleft:xyz|5}} <br /> <code><nowiki>{{padleft:xyz|5|_}}</nowiki></code> → {{padleft:xyz|5|_}} <code><nowiki>{{padleft:xyz|5|abc}}</nowiki></code> → {{padleft:xyz|5|abc}} <code><nowiki>{{padleft:xyz|2}}</nowiki></code> → {{padleft:xyz|2}} <br /> <code><nowiki>{{padleft:|1|xyz}}</nowiki></code> → {{padleft:|1|xyz}} (first character of the string) <br />
+
<code><nowiki>{{padleft:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''char''<nowiki>}}</nowiki></code> <br />
| Inserts a string of padding characters (character chosen in third parameter; default "0") of a specified length (second parameter) next to a chosen base character or variable (first parameter). The final digits or characters in the base replace the final characters in the padding; i.e. <code><nowiki>{{padleft:44|3|0}}</nowiki></code> produces {{padleft:44|3}}. The padding string may be truncated if its length does not evenly divide the required number of characters.
+
<code><nowiki>{{padleft:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''string''<nowiki>}}</nowiki></code>
 +
| <code><nowiki>{{padleft:xyz|5}}</nowiki></code> → {{padleft:xyz|5}} <br />  
 +
<code><nowiki>{{padleft:xyz|5|_}}</nowiki></code> → {{padleft:xyz|5|_}} <br />
 +
<code><nowiki>{{padleft:xyz|5|abc}}</nowiki></code> → {{padleft:xyz|5|abc}}<br />
 +
<code><nowiki>{{padleft:xyz|2}}</nowiki></code> → {{padleft:xyz|2}} <br />  
 +
<code><nowiki>{{padleft:|1|xyz}}</nowiki></code> → {{padleft:|1|xyz}}  
 +
<translate><!--T:219-->
 +
(first character of the string)</translate> <br />
 +
| <translate><!--T:220-->
 +
Inserts a string of padding characters (character chosen in third parameter; default "0") of a specified length (second parameter) next to a chosen base character or variable (first parameter). The final digits or characters in the base replace the final characters in the padding; i.e. <code><nowiki>{{padleft:44|3|0}}</nowiki></code> produces {{padleft:44|3}}. The padding string may be truncated if its length does not evenly divide the required number of characters.
  
Only the first character of the third parameter is used in versions up to 1.12, but by version 1.15 all the characters are used.
+
<!--T:221-->
 +
Only the first character of the third parameter is used in versions up to 1.12, but by version 1.15 all the characters are used.
  
'''{{mediawiki|bugzilla:16852|Bug}} (fixed in {{mediawiki|rev:45734|r45734}}):''' multibyte characters are interpreted as two characters, which can skew width. These also cannot be used as padding characters.
+
<!--T:222-->
| 1.8+
+
'''{{mediawiki|bugzilla:16852|Bug}} (fixed in {{mediawiki|rev:45734|r45734}}):''' multibyte characters are interpreted as two characters, which can skew width. These also cannot be used as padding characters.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}}
 
|-
 
|-
 
| <code><nowiki>{{padright:xyz|</nowiki>''stringlength''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{padright:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''char''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{padright:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''string''<nowiki>}}</nowiki></code>
 
| <code><nowiki>{{padright:xyz|</nowiki>''stringlength''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{padright:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''char''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{padright:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''string''<nowiki>}}</nowiki></code>
 
| <code><nowiki>{{padright:xyz|5}}</nowiki></code> → {{padright:xyz|5}} <br />
 
| <code><nowiki>{{padright:xyz|5}}</nowiki></code> → {{padright:xyz|5}} <br />
<code><nowiki>{{padright:xyz|5|_}}</nowiki></code> → {{padright:xyz|5|_}}
+
<code><nowiki>{{padright:xyz|5|_}}</nowiki></code> → {{padright:xyz|5|_}} <br />
<code><nowiki>{{padright:xyz|5|abc}}</nowiki></code> → {{padright:xyz|5|abc}}
+
<code><nowiki>{{padright:xyz|5|abc}}</nowiki></code> → {{padright:xyz|5|abc}} <br />
 
<code><nowiki>{{padright:xyz|2}}</nowiki></code> → {{padright:xyz|2}} <br />
 
<code><nowiki>{{padright:xyz|2}}</nowiki></code> → {{padright:xyz|2}} <br />
 
<code><nowiki>{{padright:|1|xyz}}</nowiki></code> → {{padright:|1|xyz}} <br />
 
<code><nowiki>{{padright:|1|xyz}}</nowiki></code> → {{padright:|1|xyz}} <br />
| Identical to <code>padleft</code>, but adds padding characters to the right side.
+
| <translate><!--T:223-->
| 1.8+
+
Identical to <code>padleft</code>, but adds padding characters to the right side.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}}
 
|}
 
|}
 +
<translate><!--T:224-->
 +
'''See also:''' <tvar|ext-stringfunctions>{{ll|Extension:StringFunctions}}</>.
 +
</translate>
  
'''See also:''' [[Extension:StringFunctions]].
+
{{anchor|Localization|Localisation}}
 +
<translate>
  
=== Localisation ===
+
=== Localization === <!--T:225-->
  
Here are the magic words which are used as main localisation tools. Other magic words will often depend on the wiki's locale and configuration or on the chosen language: see in particular [[#Date and time]], [[#Formatting]], [[#Miscellaneous]]. More magic words are added by the [[Extension:Translate|Translate extension]].
+
<!--T:226-->
 +
Here are the magic words which are used as main localisation tools. Other magic words will often depend on the wiki's locale and configuration or on the chosen language: see in particular [[<tvar|date>#Date and time</>|#Date and time]], [[<tvar|formatting>#Formatting</>|#Formatting]], [[<tvar|misc>#Miscellaneous</>|#Miscellaneous]]. More magic words are added by the <tvar|ext-translate>{{ll|Extension:Translate}}</>.
  
The usage of these magic words can be very complex, and the documentation is currently incomplete; there's some more info on [[translatewiki:FAQ#PLURAL|PLURAL]], [[translatewiki:Grammar|GRAMMAR]], [[translatewiki:Gender|GENDER]].
+
<!--T:227-->
 +
The usage of these magic words can be very complex, and the documentation is currently incomplete; there's some more info on [[translatewiki:Special:MyLanguage/FAQ#PLURAL|PLURAL]], [[translatewiki:Special:MyLanguage/Grammar|GRAMMAR]], [[translatewiki:Special:MyLanguage/Gender|GENDER]].</translate>
  
 
{| class="wikitable"
 
{| class="wikitable"
! Usage
+
! width="10%" | <translate><!--T:228-->
! Input → Output
+
Usage</translate>
! Description
+
! width="40%" | <translate><!--T:229-->
! Version
+
Input → Output</translate>
 +
! <translate><!--T:230-->
 +
Description</translate>
 +
! width="10%" | <translate><!--T:231-->
 +
Version</translate>
 
|-
 
|-
| <code><nowiki>{{plural:2|</nowiki>''is''<nowiki>|</nowiki>''are''<nowiki>}}</nowiki></code>
+
| {{Anchor|plural|Plural|PLURAL}}<code><nowiki>{{plural:2|</nowiki>''is''<nowiki>|</nowiki>''are''<nowiki>}}</nowiki></code>
| <code><nowiki>{{plural:0|is|are}}</nowiki></code> → {{plural:0|is|are}} <br />  <code><nowiki>{{plural:1*1|is|are}}</nowiki></code> → {{plural:1*1|is|are}} <br /> <code><nowiki>{{plural:21 mod 10|is|are}}</nowiki></code> → {{plural:21 mod 10|is|are}} <br /> <code><nowiki>{{plural:{{#expr:21 mod 10}}|is|are}}</nowiki></code> → {{plural:{{#expr:21 mod 10}}|is|are}} <br />  <code><nowiki>{{plural:1|is|are}}</nowiki></code> → {{plural:1|is|are}} <br /> <code><nowiki>{{plural:2|is|are}}</nowiki></code> → {{plural:2|is|are}} <br /> (For [[:w:Polish language|Polish]]) <br /><code><nowiki>{{plural:2|milion|miliony|milionów}}</nowiki></code>&nbsp;→&nbsp;miliony<br /><code><nowiki>{{plural:5|milion|miliony|milionów}}</nowiki></code>&nbsp;→&nbsp;milionów
+
| <code><nowiki>{{plural:0|is|are}}</nowiki></code> → {{plural:0|is|are}} <br />  <code><nowiki>{{plural:1*1|is|are}}</nowiki></code> → {{plural:1*1|is|are}} <br /> <code><nowiki>{{plural:21 mod 10|is|are}}</nowiki></code> → {{plural:21 mod 10|is|are}} <br /> <code><nowiki>{{plural:{{#expr:21 mod 10}}|is|are}}</nowiki></code> → {{plural:{{#expr:21 mod 10}}|is|are}} <br />  <code><nowiki>{{plural:1|is|are}}</nowiki></code> → {{plural:1|is|are}} <br /> <code><nowiki>{{plural:2|is|are}}</nowiki></code> → {{plural:2|is|are}} <br /> <translate><!--T:232-->
| Outputs the singular form (second parameter) if the first parameter is an expression equalling one; the plural form (third parameter) otherwise. Its functioning is [[m:Help:Magic_words#Language-dependent_word_conversions|language-dependent]]. Plural transformations are used for languages like Russian based on "count mod 10". You should not expect this to handle fractions (like 44.5) — see [[bugzilla:28128|bug 28128]].
+
(For [[w:Russian language|Russian]])</translate><br /><code><nowiki>{{PLURAL:5|1=Категория|Категории}} </nowiki></code>&nbsp;→&nbsp;Категории
 +
<br /><code><nowiki>{{PLURAL:3|страница|страницы|страниц}}</nowiki></code>&nbsp;→&nbsp;страницы<br /><code><nowiki>{{PLURAL:5|страница|страницы|страниц}}</nowiki></code>&nbsp;→&nbsp;страниц
 +
| <translate><!--T:233-->
 +
Outputs the singular form (second parameter) if the first parameter is an expression equalling one; the plural form (third parameter) otherwise. Its functioning is [[<tvar|meta-help-magicwords>m:Special:MyLanguage/Help:Magic_words#Language-dependent_word_conversions</>|language-dependent]]. <br />Some language codes (ab, av, ba, bxr, ce, crh_cyrl, cv, inh, koi, krc, kv, lbe, lez, mhr, mrj, myv, ru, tt_cyrl, tyv, udm, xal) used 3 plural forms ([[betawiki:Thread:Portal talk:Ru/Plural changes in many languages|updated 01.2014]]):
 +
*Form 1: 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …
 +
*Form 2: 0, 5, 6, 7, 8, …, 18, 19, 100, 1000, 10000, 100000, 1000000, …
 +
*Form 3: 2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54, 62, 102, 1002, …</translate>
 
|
 
|
 
|-
 
|-
| <code><nowiki>{{grammar:N|</nowiki>''noun''<nowiki>}}</nowiki></code>
+
| {{Anchor|grammar|Grammar|GRAMMAR}}<code><nowiki>{{grammar:N|</nowiki>''noun''<nowiki>}}</nowiki></code>
 
|  
 
|  
| Outputs the correct inflected form of the given word described by the inflection code after the colon ([[m:Help:Magic_words#Language-dependent_word_conversions|language-dependent]]). Grammar transformations are used for inflected languages like Polish. See also {{mediawiki|Manual:$wgGrammarForms}}.
+
| <translate><!--T:234-->
| 1.7+
+
Outputs the correct inflected form of the given word described by the inflection code after the colon ([[<tvar|meta-help-magicwords>m:Special:MyLanguage/Help:Magic_words#Language-dependent_word_conversions</>|language-dependent]]). Grammar transformations are used for inflected languages like Polish. See also <tvar|manual-wg-grammarform>{{mediawiki|Special:MyLanguage/Manual:$wgGrammarForms|$wgGrammarForms}}</>.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}
 
|-
 
|-
| <code><nowiki>{{gender:</nowiki>''username'' <br /><nowiki>|</nowiki>''return text if user is male'' <br /><nowiki>|</nowiki>''return text if user is female'' <br /><nowiki>|</nowiki>''return text if user hasn't defined their gender''<nowiki>}}</nowiki></code>
+
| {{Anchor|gender|Gender|GENDER}}<code><nowiki>{{gender:username|text for every gender}}</nowiki></code><br />
| ''(Depends on the named user's gender)''
+
<code><nowiki>{{gender:Username|male text|female text|text for unspecified}}</nowiki></code><br />
| A switch for the gender set in [[Special:Preferences]]. <br/>
+
<code><nowiki>{{gender:|male text|female text|text for unspecified}}</nowiki></code><br />
''Note:'' If 3rd parameter is omitted and user hasn't defined his/her gender, then <code>''text if user is male''</code> is returned.
+
<code><nowiki>{{gender:.|male text|female text|text for unspecified}}</nowiki></code><br />
| {{mediawiki|rev:46247|1.15+}}
+
| ''<translate><!--T:235-->
 +
(Depends on the named user's gender)</translate>''
 +
| <translate><!--T:236-->
 +
A switch for the gender set in [[Special:Preferences]]. <br/>
 +
''Note:'' The first example is basically a no-op<br/>
 +
''Note:'' If 3rd parameter is omitted and user hasn't defined his/her gender, then <code>''text if user is male''</code> is returned.<br>A blank username field (<tvar|gender><nowiki>{{gender:|</nowiki></>) means the current user, but can be used only in interface messages (MediaWiki namespace).<br>
 +
A dot username (.) means the default user gender on this wiki.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.15|compact=y|comment=and after|r=46247}}
 
|-
 
|-
| <code><nowiki>{{int:</nowiki>''message name''<nowiki>}}</nowiki>
+
| {{Anchor|int|INT}}<code><nowiki>{{int:</nowiki><translate><!--T:285-->
| <code><nowiki>{{int:</nowiki>edit<nowiki>}}</nowiki></code> &rarr; '''{{int:edit}}''' <br /><small>''(Depends on user language; try: [{{fullurl:{{FULLPAGENAME}}|uselang=fr}}#Localisation fr] &bull; [{{fullurl:{{FULLPAGENAME}}|uselang=ja}}#Localisation ja])''</small>
+
''message name''</translate><nowiki>}}</nowiki>
| Internationalizes (translates) the given '''int'''erface (MediaWiki namespace) message into the user language. For <code>msgnw</code> and other transclusion magic words, see [[m:Help:Magic words#Template modifiers]].  
+
| <code><nowiki>{{int:</nowiki>edit<nowiki>}}</nowiki></code> &rarr; '''{{int:edit}}''' <br /><small>''<translate><!--T:237-->
''Note that this can damage / confuse cache consistency in MediaWiki 1.17 and earlier, see [[bugzilla:14404|bug 14404]].''
+
(Depends on user language; try: [{{fullurl:{{FULLPAGENAME}}|uselang=fr}}#Localisation fr] &bull; [{{fullurl:{{FULLPAGENAME}}|uselang=ja}}#Localisation ja])</translate>''</small>
 +
| <translate><!--T:238-->
 +
Internationalizes (translates) the given '''int'''erface (MediaWiki namespace) message into the user language. For <code>msgnw</code> and other transclusion magic words, see the [[<tvar|sec>#Transclusion modifiers</>|Transclusion modifiers]] section.
 +
''Note that this can damage / confuse cache consistency in MediaWiki 1.17 and earlier, see [[bugzilla:14404|bug 14404]].''</translate>
 
|  
 
|  
 
|-
 
|-
 
| <code><nowiki>{{int:editsectionhint|MediaWiki}}</nowiki>
 
| <code><nowiki>{{int:editsectionhint|MediaWiki}}</nowiki>
 
| <code><nowiki>{{int:editsectionhint|MediaWiki}}</nowiki></code> &rarr; '''{{int:editsectionhint|MediaWiki}}'''
 
| <code><nowiki>{{int:editsectionhint|MediaWiki}}</nowiki></code> &rarr; '''{{int:editsectionhint|MediaWiki}}'''
| You may also use parameters with translations. <br />Parameters are designated in messages with: $1, $2, $3, etc. <br />For example, here is the message for ''editsectionhint'': Edit section: $1 <br />In this example, MediaWiki replaces $1.
+
| <translate><!--T:239-->
 +
You may also use parameters with translations. <br />Parameters are designated in messages with: $1, $2, $3, etc. <br />For example, here is the message for ''editsectionhint'': Edit section: $1 <br />In this example, MediaWiki replaces $1.</translate>
 
|  
 
|  
 
|}
 
|}
  
=== Miscellaneous ===
+
{{anchor|Transclusion modifiers}}
 +
<translate>
 +
 
 +
=== Transclusion modifiers === <!--T:308-->
 +
 
 +
<!--T:309-->
 +
<nowiki>{{</nowiki>''Page name''|''optional params''}} usually transcludes another page, by default from the Template:namespace.</translate>
 +
<translate>
 +
<!--T:310-->
 +
These magic words modify that behavior.
 +
</translate>
  
 
{| class="wikitable plainlinks"
 
{| class="wikitable plainlinks"
! Usage
+
! width="15%" | <translate><!--T:311-->
! Output
+
Usage</translate>
! Description
+
! width="15%" | <translate><!--T:312-->
! Version
+
Output</translate>
 +
! <translate><!--T:313-->
 +
Description</translate>
 +
! width="10%" | <translate><!--T:314-->
 +
Version</translate>
 
|-
 
|-
| <code><nowiki>{{#language:</nowiki>''language code''<nowiki>}}</nowiki></code> <br />
+
| <nowiki>{{:xyz}}</nowiki>
<code><nowiki>{{#language:ar}}</nowiki></code> <br />
+
|
<code><nowiki>{{#language:</nowiki>''language code''<nowiki>|</nowiki>''target language code''<nowiki>}}</nowiki></code> <br />
+
| <translate><!--T:315-->
<code><nowiki>{{#language:ar|en}}</nowiki></code>
+
A bare colon is not a template modifier, it's the prefix for the main namespace.</translate> <translate><!--T:316-->
| {{#language:language code}} <br />{{#language:ar}} <br />{{#language:language code|target language code}} <br />Arabic
+
Since transclusion defaults to the Template namespace, you would use for example, <tvar|code1>{&#123;:UTC&#125;}</> (vs. <tvar|code2>{&#123;UTC&#125;}</>) to include the text of the main namespace article UTC rather than Template:UTC.</translate>
| The full name of the language for the given [[language code]]: native name (language autonym) by default, name translated in target language if a target language code is specified. [[Extension:CLDR]] must be installed for the translation to work.
+
|
| {{mediawiki|rev:14490|1.7+}}
+
|-
{{r|91875|1.18+}} (translation)
+
| <nowiki>{{int:xyz}}</nowiki>
 +
|
 +
| <translate><!--T:317-->
 +
Same as <tvar|mw><nowiki>{{MediaWiki:xyz}}</nowiki></>, except standard message translation is applied depending on subpages and content/user/uselang language.</translate> <translate><!--T:318-->
 +
Another difference is: this doesn't appear under "<tvar|translatesused>{{int|templatesused}}</>".</translate> <translate><!--T:319-->
 +
Rendered as <tvar|int>{{int:xyz}}</> if <tvar|mw>[[MediaWiki:xyz]]</> doesn't exist.</translate> <translate><!--T:320-->
 +
See also <tvar|1>{{ll|Help:System message}}</>.</translate>
 +
|
 
|-
 
|-
| <code><nowiki>{{#special:</nowiki>''special page name''<nowiki>}}</nowiki> <br /><nowiki>{{#special:userlogin}}</nowiki></code>
+
| <nowiki>{{msg:xyz}}</nowiki>
 +
|
 +
| <translate><!--T:321-->
 +
Even if there is a magic word named "xyz", use template:xyz unless the template doesn't exist (equivalent to <tvar|code><nowiki>{{template:xyz}}</nowiki></>).</translate> <translate><!--T:322-->
 +
Normally, magic words have priority when there is a conflict.</translate>
 +
|
 +
|-
 +
| <nowiki>{{msgnw:xyz}}</nowiki>
 +
|
 +
| <translate><!--T:323-->
 +
The unexpanded wikitext is rendered (more or less, for details see <tvar|msgnw>{{ll|Help:Template#msgnw|msgnw}}</>).</translate>
 +
|
 +
|-
 +
| <nowiki>{{raw:xyz}}</nowiki>
 +
|
 +
| <translate><!--T:324-->
 +
Equivalent to <tvar|msg><code><nowiki>{{msg:xyz}}</nowiki></code></> above.</translate>
 +
| {{TNT|MW version|version=1.6|compact=y|comment=and after|r=12925}}
 +
|-
 +
| <nowiki>{{subst:xyz}}</nowiki>
 +
|
 +
| <translate><!--T:325-->
 +
In the wikitext, the tag is substituted by the ''content'' (single-level evaluation only), see [[<tvar|usage>Special:MyLanguage/Help:template#Usage</>|Template usage]].</translate>
 +
|
 +
|}
 +
 
 +
{{anchor|Miscellaneous}}
 +
<translate>
 +
=== Miscellaneous === <!--T:240-->
 +
</translate>
 +
 
 +
{| class="wikitable plainlinks"
 +
! width="15%" | <translate><!--T:241-->
 +
Usage</translate>
 +
! width="15%" | <translate><!--T:242-->
 +
Output</translate>
 +
! <translate><!--T:243-->
 +
Description</translate>
 +
! width="10%" | <translate><!--T:244-->
 +
Version</translate>
 +
|-
 +
| <translate><!--T:286-->
 +
<tvar|code1><code><nowiki>{{#language:</nowiki></>''language code''<tvar|code2><nowiki>}}</nowiki></code><br /><code><nowiki>{{#language:ar}}</nowiki></code> <br /><code><nowiki>{{#language:</nowiki></>''language code''<tvar|code3><nowiki>|</nowiki><br /></>''target language code''<tvar|code5><nowiki>}}</nowiki></code> <br /><code><nowiki>{{#language:ar|en}}</nowiki></code></></translate>
 +
| {{#language:language code}} <br />{{#language:ar}} <br />{{#language:language code|<translate><!--T:287-->
 +
target language code<tvar|code1>}} <br /></>Arabic</translate>
 +
| <translate><!--T:245-->
 +
The full name of the language for the given [[<tvar|manual-langcode>Special:MyLanguage/Manual:Language#lang-code</>|language code]]: native name (language autonym) by default, name translated in target language if a target language code is specified. <tvar|ext-cldr>{{ll|Extension:CLDR}}</> must be installed for the translation to work.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after|r=14490}}<br /> {{ {{TNTN|MW version}} |version=1.18|compact=y|comment=and after|r=91875}} <translate><!--T:246-->
 +
(translation)</translate>
 +
|-
 +
| <code><nowiki>{{#special:</nowiki><translate><!--T:288-->
 +
''special page name''</translate><nowiki>}}</nowiki> <br /><nowiki>{{#special:userlogin}}</nowiki></code>
 
| {{#special:special page name}} <br />{{#special:userlogin}}
 
| {{#special:special page name}} <br />{{#special:userlogin}}
| The localized name for the given canonical Special: page.
+
| <translate><!--T:247-->
| {{mediawiki|rev:17321|1.9+}}
+
The localized name for the given canonical Special: page.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.9|compact=y|comment=and after|r=17321}}
 
|-
 
|-
| <code><nowiki>{{#speciale:</nowiki>''special page name''<nowiki>}}</nowiki> <br /><nowiki>{{#speciale:userlogin}}</nowiki></code>
+
| <code><nowiki>{{#speciale:</nowiki><translate><!--T:289-->
 +
''special page name''</translate><nowiki>}}</nowiki> <br /><nowiki>{{#speciale:userlogin}}</nowiki></code>
 
| {{#speciale:special page name}} <br />{{#speciale:userlogin}}
 
| {{#speciale:special page name}} <br />{{#speciale:userlogin}}
| The localized and URL-encoded name for the given canonical Special: page.
+
| <translate><!--T:248-->
| {{mediawiki|gerrit:4340|1.20+}}
+
The localized and URL-encoded name for the given canonical Special: page.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.20|compact=y|comment=and after|gerrit change=4340}}
 
|-
 
|-
| <code><nowiki>{{#tag:</nowiki>''tagname'' <br/><nowiki>|</nowiki>''content'' <br/><nowiki>|</nowiki>''attribute1=value1'' <br /><nowiki>|</nowiki>''attribute2=value2''<br /><nowiki>}}</nowiki></code>
+
| <code><nowiki>{{#tag:</nowiki><translate><!--T:290-->
| ''(Depends on parser tag)''
+
''tagname'' <tvar|code1><br/><nowiki>|</nowiki></>''content'' <tvar|code2><br/><nowiki>|</nowiki></>''attribute1=value1'' <tvar|code3><br /><nowiki>|</nowiki></>''attribute2=value2''</translate><br /><nowiki>}}</nowiki></code>
| Alias for XML-style MediaWiki parser tags or extension tags. It allows execution of wiki code and [[Extension:ParserFunctions|parser functions]] within tags before the tag is processed. It also prevents parsing of tags in conditional paths that aren't executed (like in <code>#if</code> statements). Content between tags is passed as the first parameter, and any attributes for the tags can be passed as subsequent parameters. This example:
+
| <translate><!--T:249-->
 +
''(Depends on parser tag)''</translate>
 +
| <translate><!--T:250-->
 +
Alias for XML-style MediaWiki parser tags or extension tags. It allows execution of wiki code and <tvar|ext-pf>{{ll|Extension:ParserFunctions}}</> within tags before the tag is processed. It also prevents parsing of tags in conditional paths that aren't executed (like in <code>#if</code> statements). Content between tags is passed as the first parameter, and any attributes for the tags can be passed as subsequent parameters. This example:
  
<code>&lt;tagname ''attribute1''="''value1''" ''attribute2''="''value2''"&gt;</code>''Your content goes here''<code>&lt;/tagname&gt;</code>  
+
<!--T:251-->
 +
<tvar|code1><code>&lt;</>tagname ''attribute1''="''value1''"<br />''attribute2''="''value2''"<tvar|code2>&gt;</code></>''Your content goes here''<tvar|code3><code>&lt;</>/tagname<tvar|code4>&gt;</code></>  
  
 +
<!--T:252-->
 
…can be rewritten like this:
 
…can be rewritten like this:
  
<code><nowiki>{{#tag:</nowiki></code>''tagname''<code><nowiki>|</nowiki></code>''Your content goes here''<code><nowiki>|</nowiki></code>''attribute1''=''value1''<code><nowiki>|</nowiki></code>''attribute2''=''value2''<code><nowiki>}}</nowiki></code>
+
<!--T:253-->
 +
<tvar|code1><code><nowiki>{{#tag:</nowiki></code></>''tagname''<tvar|code2><code><nowiki>|</nowiki></code></>''Your content goes here''<tvar|code3><code><nowiki>|</nowiki></code></>''attribute1''=''value1''<tvar|code4><code><nowiki>|</nowiki></code></>''attribute2''=''value2''<tvar|code5><code><nowiki>}}</nowiki></code></>
 +
 
 +
<!--T:254-->
 +
Example for the [[<tvar|ext-cite>Special:MyLanguage/Extension:Cite</>|Cite extension]]'s <code>&lt;ref&gt;</code> tags:
  
Example for the [[Extension:Cite|Cite extension]]'s <code>&lt;ref&gt;</code> tags:
 
  
<code><nowiki>{{#tag:ref|Citation text goes here, and you can include parser functions like {{#expr: ... }} and magic words like {{PAGENAME}}.|name="multiple"}}</nowiki></code>
+
<!--T:255-->
 +
<code><nowiki>{{#tag:ref|Citation text goes here,</nowiki><br /><nowiki>and you can include parser functions</nowiki><br /><nowiki>like {{#expr: ... }} and magic words</nowiki><br /><nowiki>like {{PAGENAME}}.|name="multiple"}}</nowiki></code>
 +
</translate>
  
<small>{{warning}}You must write <code><nowiki>{{#tag:</nowiki></code>''tagname''<code><nowiki>||</nowiki></code>''attribute1''=''value1''<code><nowiki>|</nowiki></code>''attribute2''=''value2''<code><nowiki>}}</nowiki></code> to pass an empty content. No space is permitted in the area reserved for content between the pipe characters <code>{{!}}{{!}}</code> before ''attribute1''.</small>
+
<small>{{TNT|warning}}<translate><!--T:256-->
| {{mediawiki|rev:29482|1.12+}}
+
You must write <tvar|code1><code><nowiki>{{#tag:</nowiki></code></>''tagname''<tvar|code2><code><nowiki>||</nowiki></code></>''attribute1''=''value1''<tvar|code3><code><nowiki>|</nowiki></code></>''attribute2''=''value2''<tvar|code4><code><nowiki>}}</nowiki></code></> to pass an empty content. No space is permitted in the area reserved for content between the pipe characters <tvar|code5><code>{{!}}{{!}}</code></> before ''attribute1''.</translate></small>
 +
| {{ {{TNTN|MW version}} |version=1.12|compact=y|comment=and after|r=29482}}
 
|}
 
|}
  
{{languages}}
+
[[Category:Help{{translation}}|{{PAGENAME}}]]
 
+
[[Category:Time{{translation}}|{{PAGENAME}}]]
[[Category:Help|{{PAGENAME}}]]
+
[[Category:Magic words{{translation}}|{{PAGENAME}}]]
[[Category:Time|{{PAGENAME}}]]
 
[[Category:Magic words|{{PAGENAME}}]]
 

2016年7月24日 (日) 00:25時点における最新版

PD Note: When you edit this page, you agree to release your contribution under the CC0. See Public Domain Help Pages for more info.
PD
</div>

Magic words are strings of text that MediaWiki associates with a return value or function, such as time, site details, or page names. This page explains only the standard magic words; for a technical reference, see Manual:Magic words.

There are three general types of magic words:

  • Behavior switches: these are uppercase words surrounded by double underscores, e.g. __FOO__.
  • Variables: these are uppercase words surrounded by double braces, e.g. {{FOO}}. As such, they look a lot like templates.

Variables and parser functions can use subst:, just like templates. Page-dependent magic words will affect or return data about the current page (by default), even if the word is added through a transcluded template or included system message.

Behavior switches[編集]

A behavior switch controls the layout or behavior of the page and can often be used to specify desired omissions and inclusions in the content.

Word Description Versions
Table of contents
__NOTOC__ Hides the table of contents (TOC).
__FORCETOC__ Forces the table of contents to appear at its normal position (before the first header, overriding __NOTOC__).
__TOC__ Places a table of contents at the word's current position (overriding __NOTOC__). If this is used multiple times, the table of contents will appear at the first word's position.
Editing
__NOEDITSECTION__ Hides the section edit links beside headings. This is especially useful where a heading is created from within a template: the normal wiki section-edit would in this case edit the template code, which is normally counterintuitive to the user. Use of this in a template will extend the effect to that template, the pages it's included on, and any other templates included on the same page. For a workaround, see here.
__NEWSECTIONLINK__ Adds a link beside the "edit" tab for adding a new section on a non-talk page (see Adding a section to the end).
1.7
__NONEWSECTIONLINK__ Removes the link beside the "edit" tab on pages in talk namespaces.
1.15
r47522
Categories
__NOGALLERY__ Used on a category page, replaces thumbnails in the category view with normal links.
1.7
__HIDDENCAT__ Used on a category page, hides the category from the lists of categories in its members and parent categories (there is an option in the user preferences to show them).
1.13
Language conversion
__NOCONTENTCONVERT__
__NOCC__
On wikis with language variants, don't perform any content language conversion (character and phase) in article display; for example, only show Chinese (zh) instead of variants like zh_cn, zh_tw, zh_sg, or zh_hk.
__NOTITLECONVERT__
__NOTC__
On wikis with language variants, don't perform language conversion on the title (all other content is converted).
Other
__START__ No effect. Was used to point where database message starts after comment that should not be transcluded. Removed in r1695 and completely removed in r24784
1.10
r1610
__END__ Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace. Removed in 19213.
1.1 – 1.8
__INDEX__ Tell search engines to index the page (overrides $wgArticleRobotPolicies, but not robots.txt). It obeys $wgExemptFromUserRobotsControl variable.
1.14
__NOINDEX__ Tell search engines not to index the page (i.e. do not list in search engines' results). It obeys $wgExemptFromUserRobotsControl variable.
1.14
r37973
__STATICREDIRECT__ On redirect pages, don't allow MediaWiki to automatically update the link when someone moves a page and checks "このページへのリダイレクトがあればそのリダイレクトを修正" (which requires $wgFixDoubleRedirects).
1.13
r37928

Variables[編集]

Variables return information about the current page, wiki, or date. Their syntax is similar to templates. Variables marked as "[expensive]" are tracked by the software, and the number that can be included on a page is limited.

If a template name conflicts with a variable, the variable will be used (so to transclude the template テンプレート:PAGENAME you would need to write {{テンプレート:PAGENAME}}). In some cases, adding parameters will force the parser to invoke a template; for example, {{CURRENTDAYNAME|x}} transcludes テンプレート:CURRENTDAYNAME, not the variable.

Date and time[編集]

The following variables return the current date and time in UTC.

Due to MediaWiki and browser caching, these variables frequently show when the page was cached rather than the current time.

The date and time magic words are formatted in the wiki content language. Since 1.19, they depend on the page content language.

Variable Output Description Versions
Year
{{CURRENTYEAR}} 2024 Year
Month
{{CURRENTMONTH}} 11 Month (zero-padded number)
{{CURRENTMONTH1}} 11 Month (unpadded number)
{{CURRENTMONTHNAME}} 11月 Month (name)
{{CURRENTMONTHNAMEGEN}} 11月 Month (genitive form)
{{CURRENTMONTHABBREV}} 11月 Month (abbreviation)
1.5
Day
{{CURRENTDAY}} 24 Day of the month (unpadded number)
{{CURRENTDAY2}} 24 Day of the month (zero-padded number)
1.6
{{CURRENTDOW}} 0 Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday)
{{CURRENTDAYNAME}} 日曜日 Day of the week (name)
Time
{{CURRENTTIME}} 14:47 Time (24-hour HH:mm format)
{{CURRENTHOUR}} 14 Hour (24-hour zero-padded number)
Other
{{CURRENTWEEK}} 47 Week (number)
{{CURRENTTIMESTAMP}} 20241124144727 YYYYMMDDHHmmss timestamp
1.7

The following variables do the same as the preceding ones, but using the site's server config or $wgLocaltimezone.

  • {{LOCALYEAR}}
  • {{LOCALMONTH}}
  • {{LOCALMONTH1}}
  • {{LOCALMONTHNAME}}
  • {{LOCALMONTHNAMEGEN}}
  • {{LOCALMONTHABBREV}}
  • {{LOCALDAY}}
  • {{LOCALDAY2}}
  • {{LOCALDOW}}
  • {{LOCALDAYNAME}}
  • {{LOCALTIME}}
  • {{LOCALHOUR}}
  • {{LOCALWEEK}}
  • {{LOCALTIMESTAMP}}

For more thorough time formatting, you may want to install Extension:ParserFunctions to use the #time parser function.

Technical metadata[編集]

Note: Revision variables return data about the latest edit to the current page, even if viewing an older version of the page.

Variable Output Description Versions
Site
{{SITENAME}} ひつじ小屋別館2代目 The wiki's site name ($wgSitename).
{{SERVER}} http://littleprincess.sakura.ne.jp Domain URL ($wgServer).
{{SERVERNAME}} littleprincess.sakura.ne.jp Subdomain and domain name (no longer dependent on $wgServerName as of version 1.17).
{{DIRMARK}}
{{DIRECTIONMARK}}

Outputs a Unicode directional mark that matches the wiki's default language's direction (&lrm; on left-to-right wikis, &rlm; on right-to-left wikis), useful in text with multi-directional text. Since 1.19, it depends on the page content language.
1.7
r14442
{{SCRIPTPATH}} /mediawiki Relative script path ($wgScriptPath).
{{STYLEPATH}} /mediawiki/skins Relative style path ($wgStylePath).
1.16
{{CURRENTVERSION}} 1.27.0 The wiki's MediaWiki version.
1.7
r14199
{{CONTENTLANGUAGE}}
{{CONTENTLANG}}
ja
ja
The wiki's default interface language ($wgLanguageCode).
1.7
r14661
Page
{{PAGEID}} 714 Returns the page identifier.
1.20
Gerrit change 9858
{{PROTECTIONLEVEL:action}} Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the current page. Returns an empty string if not protected.
1.15
r45587
{{PROTECTIONEXPIRY:action}} Outputs the protection expiry (e.g. "20160418155030", "infinity") for a given action (e.g. "edit", "move") on the current page. Returns "infinity" if not protected.
1.27
Gerrit change 255717
{{CASCADINGSOURCES}} [Expensive] Returns the sources of any cascading protection acting on the current page. Pages will not return their own title unless they transclude themselves.
1.23
Gerrit change 104999
Latest revision to current page
{{REVISIONID}} 4654 Unique revision ID.
1.5
{{REVISIONDAY}} 24 Day edit was made (unpadded number).
1.8
{{REVISIONDAY2}} 24 Day edit was made (zero-padded number).
1.8
{{REVISIONMONTH}} 07 Month edit was made (zero-padded number as of 1.17+, unpadded number in prior versions).
1.8
{{REVISIONMONTH1}} 7 Month edit was made (unpadded number).
1.17
r66200
{{REVISIONYEAR}} 2016 Year edit was made.
1.8
{{REVISIONTIMESTAMP}} 20160724002537 Timestamp as of time of edit.
1.8
{{REVISIONUSER}} しが The username of the user who made the most recent edit to the page, or the current user when previewing an edit.
1.15
r48149
{{REVISIONSIZE}} 82665 The size (bytes of wikitext) of the current revision of this page
1.22
Gerrit change 82650
Affects page content
{{DISPLAYTITLE:title}} Format the current page's title header. The value must be equivalent to the default title: only capitalization changes to certain parts of the title (not all) and replacing spaces with underscores are allowed (this can be changed with $wgRestrictDisplayTitle). It can be disabled or enabled by $wgAllowDisplayTitle; disabled by default before 1.10+, enabled by default thereafter.

It can take a second argument of noerror or noreplace to suppress error messages when multiple displaytitles are used on one page or to make this displaytitle do nothing if a displaytitle was already specified earlier in the page.

1.7

1.24
Gerrit change 144870

(for noerror and noreplace)
{{DEFAULTSORT:sortkey}}
{{DEFAULTSORTKEY:sortkey}}
{{DEFAULTCATEGORYSORT:sortkey}}
{{DEFAULTSORT:sortkey|noerror}}
{{DEFAULTSORT:sortkey|noreplace}}
Used for categorizing pages, sets a default category sort key. For example if you put {{DEFAULTSORT:Smith , John}} at the end of John Smith, the page would be sorted under "S" by default in categories. It can take a second argument of noerror or noreplace to suppress error messages when multiple defaultsortkeys are used on one page or to make this defaultsort do nothing if a defaultsort was already specified earlier in the page.
1.10

1.19
r96767

(for noerror and noreplace)


Statistics[編集]

Numbers returned by these variables normally contain separators (commas, dots or spaces, depending on the local language) but can return raw numbers with the ":R" flag (for example, {{NUMBEROFPAGES}} → 1,057 and {{NUMBEROFPAGES:R}} → 1057).

Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example {{PAGESINCATEGORY:Help}} and {{PAGESINCATEGORY:Help|R}}, or {{PAGESINCATEGORY:Help|subcats}} and {{PAGESINCATEGORY:Help|subcats|R}}). Also applicable to {{PAGESIZE:page name}} hereinbefore.

The number magic words are formatted in the wiki content language. Since 1.19, it depends on the page content language.

Variable Output Description Versions
{{NUMBEROFPAGES}} 1,057 Number of wiki pages.
1.7
{{NUMBEROFARTICLES}} 427 Number of pages in content namespaces.
{{NUMBEROFFILES}} 101 Number of uploaded files.
1.5
{{NUMBEROFEDITS}} 2,806 Number of wiki edits.
1.10
r21319
{{NUMBEROFVIEWS}} Number of page views. Usually useless on a wiki using caching. Removed in Gerrit change 150699.
1.14 – 1.24
r42721
{{NUMBEROFUSERS}} 199 Number of registered users.
1.7
{{NUMBEROFADMINS}} 1 Number of users in the sysop group.
1.7
{{NUMBEROFACTIVEUSERS}} 0 Number of active users, based on the criteria used in Special:Statistics.
1.15
r47392
{{PAGESINCATEGORY:categoryname}}
{{PAGESINCAT:categoryname}}
48
48
[Expensive] Number of pages (including subcategories and files) in the given category. (Category:Help used for demonstration)
1.13
r32932
{{PAGESINCATEGORY:categoryname|all}}
{{PAGESINCATEGORY:categoryname|pages}}
{{PAGESINCATEGORY:categoryname|subcats}}
{{PAGESINCATEGORY:categoryname|files}}
48
48
0
0
[Expensive] Respectively, the number of
  • all pages
  • ordinary pages (excluding subcategories and files)
  • subcategories or
  • files

in the given category. (Category:Help used for demonstration)

1.20
Gerrit change 12790
{{NUMBERINGROUP:groupname}}
{{NUMINGROUP:groupname}}
1
1
({{NUMBERINGROUP:bureaucrat}} used here)
Number of users in a specific group.
1.14
r40116
{{PAGESINNS:index}}
{{PAGESINNAMESPACE:index}}
Not enabled [Expensive] Number of pages in the given namespace (replace index with the relevant namespace index). For instance, {{PAGESINNAMESPACE:14}} will output the number of category pages. {{PAGESINNS:0}} differs from {{NUMBEROFARTICLES}} in that the former includes redirects and disambiguation pages. Disabled by default, enable with $wgAllowSlowParserFunctions.
1.7

Page names[編集]

Variable Output Description Versions
{{FULLPAGENAME}} ヘルプ:Magic words Namespace and full page title (including all subpage levels).
1.6
{{PAGENAME}} Magic words Full page title (including all subpage levels) without the namespace.
{{BASEPAGENAME}} Magic words Page title of the page in the immediately superior subpage level without the namespace ("Title/foo" on "Help:Title/foo/bar").

For more complex splitting, use {{#titleparts:}} from the ParserFunctions extension.

1.7
{{SUBPAGENAME}} Magic words The subpage title ("bar" on "Help:Title/foo/bar").
1.6
{{SUBJECTPAGENAME}}
{{ARTICLEPAGENAME}}
ヘルプ:Magic words
ヘルプ:Magic words
Full page name of the associated subject (e.g. article or file). Useful on talk pages.
1.7
{{TALKPAGENAME}} ヘルプ・トーク:Magic words Full page name of the associated talk page.
1.7
{{ROOTPAGENAME}} Magic words Name of the root of the current page. Would return Title on page Help:Title/Foo/Bar
1.22

The {{BASEPAGENAME}} and {{SUBPAGENAME}} magic words only work in namespaces that have subpages enabled. See $wgNamespacesWithSubpages for information on enabling subpages.

As of 1.15+, these can all take a parameter, allowing specification of the page to be operated on, instead of just the current page:

  • {{PAGENAME:Template:Main Page}}Main Page

テンプレート:Warning/core Page titles containing certain characters, such as apostrophes ' or asterisks *, may produce unexpected results when handled with these magic words, e.g. {{PAGESINCATEGORY:{{PAGENAME}}}}. See bugs T16779, T18474, T37628, and T37746. One simple way to fix this is wrapping the pagename in {{#titleparts:}} from the ParserFunctions extension.

For example, if page name is "L'Aquila", the following code will produce the string "Numeric char encoding":

{{#switch:{{PAGENAME}}
| L'Aquila = No translation
| L = Not OK
| L&apos;Aquila = Entity escaping
| L&#39;Aquila = Numeric char encoding
}}

URL encoded page names[編集]

The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters HTML escaped using numeric character encoding):

  • {{FULLPAGENAMEE}}
  • {{PAGENAMEE}}
  • {{BASEPAGENAMEE}}
  • {{SUBPAGENAMEE}}
  • {{SUBJECTPAGENAMEE}}
  • {{ARTICLEPAGENAMEE}}
  • {{TALKPAGENAMEE}}
  • {{ROOTPAGENAMEE}}

Note that {{PAGENAME:...}}, {{PAGENAMEE:...}} and {{urlencode:...}} have distinct implementations. See Manual:PAGENAMEE encoding for details.

Namespaces[編集]

Variable Output Description Versions
{{NAMESPACE}} ヘルプ Name of the page's namespace
{{NAMESPACENUMBER}} 12 ID of the page's namespace
1.20
Gerrit change 4056
{{SUBJECTSPACE}}
{{ARTICLESPACE}}
ヘルプ
ヘルプ
Name of the associated content namespace
1.7
{{TALKSPACE}} ヘルプ・トーク Name of the associated talk namespace
1.7

The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded):

  • {{NAMESPACEE}}
  • {{SUBJECTSPACEE}}
  • {{ARTICLESPACEE}}
  • {{TALKSPACEE}}

As of 1.15+, these can take a full-page-name parameter and will return the requested namespace associated with that page, instead of with the current page:

  • {{NAMESPACE:Template:Main Page}}テンプレート
  • {{SUBJECTSPACE:Template:Main Page}}テンプレート
  • {{TALKSPACE:Template:Main Page}}テンプレート・トーク

Parameter must not be a namespace name:

  • {{SUBJECTSPACE:Help talk}}  (Empty)

Other[編集]

Variable Output Description Versions
{{!}} | Used to include a pipe character as part of a template argument or table cell contents. Before this was added as a magic word, many wikis implemented this by creating Template:! with | as the content.
1.24
Gerrit change 136234

Parser functions[編集]

Parser functions are very similar to variables, but take one or more parameters (technically, any magic word that takes a parameter is a parser function), and the name is sometimes prefixed with a hash to distinguish them from templates.

This page only describes parser functions that are integral to the MediaWiki software. Other parser functions may be added by MediaWiki extensions such as the Extension:ParserFunctions. For those see Help:Extension:ParserFunctions.

Technical metadata of another page[編集]

Parser function Output
(for page MediaWiki)
Description Versions
{{PAGEID: page name }} 890 [Expensive] Returns the page identifier of the specified page*.
1.23
Gerrit change 76534
{{PAGESIZE: page name }}
{{PAGESIZE: page name |R}}
157
157
[Expensive] Returns the byte size of the specified page. Use "<code>|R" to get raw (unformatted) numbers.
1.13
r33551
{{PROTECTIONLEVEL:action | page name}} [Expensive] Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the specified page. Returns an empty string if not protected.
1.21
r44683
{{PROTECTIONEXPIRY:

action | page name}}

[Expensive] Outputs the protection expiry (e.g. "20160418155030", "infinity") for a given action (e.g. "edit", "move") on the specified page. Returns "infinity" if not protected.
1.27
Gerrit change 255717
{{CASCADINGSOURCES: page name}} [Expensive] Returns the sources of any cascading protection acting on the specified page. Pages will not return their own title unless they transclude themselves.
1.23
Gerrit change 104999
{{REVISIONID: page name }} 4760 [Expensive] Unique revision ID of the last revision on the specified page*.
1.23
Gerrit change 76534
{{REVISIONDAY: page name }} 24 [Expensive] Day of edit from the last revision of the specified page* (unpadded number).
1.23
Gerrit change 76534
{{REVISIONDAY2: page name }} 24 [Expensive] Day of edit from the last revision of the specified page* (zero-padded number).
1.23
Gerrit change 76534
{{REVISIONMONTH: page name }} 07 [Expensive] Month of edit from the last revision of the specified page* (zero-padded number as of 1.17+, unpadded number in prior versions).
1.23
Gerrit change 76534
{{REVISIONMONTH1: page name }} 7 [Expensive] Month of edit from the last revision of the specified page* (unpadded number).
1.23
Gerrit change 76534
{{REVISIONYEAR: page name }} 2016 [Expensive] Year of edit from the last revision of the specified page*.
1.23
Gerrit change 76534
{{REVISIONTIMESTAMP: page name }} 20160724002620 [Expensive] Timestamp as of time of edit on the specified page*.
1.23
Gerrit change 76534
{{REVISIONUSER: page name }} しが [Expensive] The username from the last revision on the specified page*.
1.23
Gerrit change 76534
*When the given param is equal to the current title of the parser, the parser function will yield the previous versions on preview and on substitution, that includes empty strings when used on page creation, but using the values from the current version for page view, including viewing old revisions. In this case it is a non-expensive parser function.


URL data[編集]

Parser function Input → Output Description Versions
{{localurl:page name}}
{{localurl:page name
|query_string}}
{{localurl:MediaWiki}}
→ /mediawiki/index.php?title=MediaWiki
{{localurl:MediaWiki|printable=yes}}
→ /mediawiki/index.php?title=MediaWiki&printable=yes
The relative path to the title.
{{fullurl:page name}}
{{fullurl:page name
|query_string}}

{{fullurl:interwiki:remote page name
|query_string}}
{{fullurl:Category:Top level}}
http://littleprincess.sakura.ne.jp/mediawiki/index.php?title=%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA:Top_level

{{fullurl:Category:Top level|action=edit}}
http://littleprincess.sakura.ne.jp/mediawiki/index.php?title=%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA:Top_level&action=edit
https:{{fullurl:s:Electra|action=edit}}
→ https:http://littleprincess.sakura.ne.jp/mediawiki/index.php?title=S:Electra&action=edit
https:{{fullurl:s:es:Electra|action=edit}}
→ https:http://littleprincess.sakura.ne.jp/mediawiki/index.php?title=S:es:Electra&action=edit

A protocol-relative path to the title. This will also resolve interwiki prefixes. Note: Unbracketed (plain) protocol-relative links are not automagically linked.
1.5
{{canonicalurl:page name}}
{{canonicalurl:page name
|query_string}}

{{canonicalurl:interwiki:remote page name
|query_string}}
{{canonicalurl:Category:Top level}}
http://littleprincess.sakura.ne.jp/mediawiki/index.php?title=%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA:Top_level

{{canonicalurl:Category:Top level|action=edit}}
http://littleprincess.sakura.ne.jp/mediawiki/index.php?title=%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA:Top_level&action=edit

The absolute path to the title, using the canonical URL. This will also resolve interwiki prefixes.
1.18
{{filepath:file name}}
{{filepath:file name|nowiki}}
{{filepath:file name|thumbnail_size}}
{{filepath:Wiki.png}}
http://littleprincess.sakura.ne.jp/mediawiki/images/b/bc/Wiki.png

{{filepath:Wiki.png|nowiki}}
→ http://littleprincess.sakura.ne.jp/mediawiki/images/b/bc/Wiki.png
{{filepath:Example.svg|300}}

A protocol-relative path to the full size or thumbnail (1.18+) of a media file.
1.12
r25854

1.18
r80813
{{urlencode:string}} or
{{urlencode:string|QUERY}}
{{urlencode:string|WIKI}}
{{urlencode:string|PATH}}
{{urlencode:x:y/z á é}} or
{{urlencode:x:y/z á é|QUERY}}
→ x%3Ay%2Fz+%C3%A1+%C3%A9
{{urlencode:x:y/z á é|WIKI}}
→ x:y/z_%C3%A1_%C3%A9
{{urlencode:x:y/z á é|PATH}}
→ x%3Ay%2Fz%20%C3%A1%20%C3%A9

Note that the default changed from |WIKI to |QUERY in 1.17; this may break templates that rely on this function.

The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete Extension:StringFunctions.
Encoding
codespace
 none + 
QUERY + 
 WIKI _ 
 PATH%20
1.7
r14273
(or
1.17
r64726

1.17
r64726

1.17
r64726
)
{{anchorencode:string}} {{anchorencode:x y z á é}}
→ x_y_z_.C3.A1_.C3.A9
The input encoded for use in URL section anchors (after the “#” symbol in a URL).
1.6
r16279

Namespaces[編集]

{{ns:}} returns the current localized name for the namespace with that index, canonical name, or local alias. Thus {{ns:6}}, {{ns:File}}, and {{ns:Image}} (an old name for the File namespace) all return "ファイル". On a wiki where the content language is French, {{ns:Fichier}} is also valid, but {{ns:Datei}} (the localisation of "File" in German) is not.

{{nse:}} is the equivalent encoded for MediaWiki URLs. It does the same, but it replaces spaces with underscores, making it usable in external links.

Content namespaces Talk namespaces
Usage Output Usage Output
{{ns:-2}} / {{ns:Media}} メディア {{ns:-1}} / {{ns:Special}} 特別
(no talk page)
{{ns:0}} / {{ns:}} {{ns:1}} / {{ns:Talk}} トーク
{{ns:2}} / {{ns:User}} 利用者 {{ns:3}} / {{ns:User talk}} 利用者・トーク
{{ns:4}} / {{ns:Project}} ひつじ小屋別館2代目
Varies between wikis
{{ns:5}} / {{ns:Project talk}} ひつじ小屋別館2代目・トーク
{{ns:6}} / {{ns:File}} or {{ns:Image}} ファイル {{ns:7}} / {{ns:File talk}} or {{ns:Image talk}} ファイル・トーク
{{ns:8}} / {{ns:MediaWiki}} MediaWiki {{ns:9}} / {{ns:MediaWiki talk}} MediaWiki・トーク
{{ns:10}} / {{ns:Template}} テンプレート {{ns:11}} / {{ns:Template talk}} テンプレート・トーク
{{ns:12}} / {{ns:Help}} ヘルプ {{ns:13}} / {{ns:Help talk}} ヘルプ・トーク
{{ns:14}} / {{ns:Category}} カテゴリ {{ns:15}} / {{ns:Category talk}} カテゴリ・トーク

Don't confuse localised namespaces with custom namespaces.

Formatting[編集]

Usage Input → Output Description Version
{{formatnum:unformatted number}}

{{formatnum:formatnum-formatted number|R}}
{{formatnum:unformatted number|NOSEP}}

  • Simple:
    • {{formatnum:987654321.654321}}
      → 987,654,321.654321
    • {{formatnum:987,654,321.654321|R}}
      → 987654321.654321
  • Advanced:
    • {{formatnum:{{formatnum:987654321.654321}}|R}}
      → 987654321.654321 (on any locale)
    • {{formatnum:00001}}
      → 00,001
    • {{formatnum:987654321.654321 |NOSEP}}
      → 987654321.654321
    • Examples with Bengali locale:
      • {{formatnum:987654321.654321}}
        → ৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১
      • {{formatnum:987654321.654321 |NOSEP}}
        → ৯৮৭৬৫৪৩২১.৬৫৪৩২১
      • {{formatnum:৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১ |R}}
        → 987654321.654321

Unsupported:
{{formatnum:{{formatnum:987.654.321}}}}
→ 987 654 321 (e.g. with Italian locale)


Examples of wrong input (unreliable output), with or without |R:
{{formatnum:987,654.321|R}} (the least broken)
{{formatnum:987.654,321|R}}
{{formatnum:987 654,321|R}}
{{formatnum:987&nbsp;654,321|R}}

Takes an unformatted number (arab, no group separators and . as decimal separator) and outputs it in the localized digit script and formatted with decimal and decimal group separators, according to the wiki's default locale.

The |R parameter can be used to reverse the behavior, for use in mathematical situations: it's reliable and should be used only to deformat numbers which are known to be formatted exactly as formatnum formats them with the wiki's locale.
The NOSEP ("no separators") parameter means that no group / decimal separators are changed; formatnum will only transform the digits themselves in languages which don't use the Hindu–Arabic numeral system. NOSEP can also prevent non-standard digit groupings you wouldn't expect.

テンプレート:Warning/core Leading zeroes are not removed, you can use {{#expr:00001}} instead if you have Extension:ParserFunctions installed.

テンプレート:Warning/core If you don't input numbers in the exact format required, don't expect any reliable output, especially on non-English wikis.


If you really need to format (according the wiki's locale) a number in unknown input format, you could try and use formatnum two times (but not if it can have a decimal group, or its separator will be eaten or the number won't be formatted). Be aware that this is more a hack than a regular way to proceed, thus the output may be not reliable.

1.7

1.13
r32012

{{#dateformat:date}}
{{#formatdate:date}}
{{#dateformat:date|format}}
{{#formatdate:date|format}}

{{#dateformat:25 dec 2009|ymd}}
→ 25 dec 2009 (your pref), 2009 Dec 25 (default)
{{#formatdate:dec 25,2009|dmy}}
→ dec 25,2009 (your pref), 25 Dec 2009 (default)
{{#dateformat:2009-12-25|mdy}}
12月 25, 2009 (your pref), December 25, 2009 (default)
{{#formatdate:2009 dec 25|ISO 8601}}
→ 2009 dec 25 (your pref), 2009-12-25 (default)
{{#dateformat:25 decEmber|mdy}}
→ 25 decEmber (your pref), DecEmber 25 (default)
Note: In the example hereinbefore, "your pref" refers to your date preference on the current MediaWiki wiki only.

Formats an unlinked date based on user "date format" preference, and adds metadata tagging it as a formatted date. For logged-out users and those who have not set a date format in their preferences, dates can be given a default: mdy, dmy, ymd, ISO 8601 (all case sensitive). If only the month and day are given, only mdy and dmy are valid. If a format is not specified or is invalid, the input format is used as a default. If the supplied date is not recognized as a valid date (specifically, if it contains any metadata such as from a nested use of these or similar templates), it is rendered unchanged, and no (additional) metadata is generated.

テンプレート:Warning/coreAlthough the ISO 8601 standard requires that dates be in the Gregorian calendar, the ISO parameter in this function will still format dates that fall outside the usual Gregorian range (e.g. dates prior to 1583). Also, the magic word cannot properly convert between negative years (used with ISO 8601) and years BC or years BCE (used in general writing).

1.15
r48249
{{lc:string}} {{lc:DATA CENTER}} → data center The lowercase input.
1.5
{{lcfirst:string}} {{lcfirst:DATA center}} → dATA center The input with the very first character lowercase.
1.5
{{uc:string}} {{uc:text transform}} → TEXT TRANSFORM The uppercase input.
1.5
{{ucfirst:string}} {{ucfirst:text TRANSFORM}} → Text TRANSFORM The input with the very first character uppercase.
1.5
{{padleft:xyz|stringlength}}

{{padleft:xyz|strlen|char}}
{{padleft:xyz|strlen|string}}

{{padleft:xyz|5}} → 00xyz

{{padleft:xyz|5|_}} → __xyz
{{padleft:xyz|5|abc}} → abxyz
{{padleft:xyz|2}} → xyz
{{padleft:|1|xyz}} → x (first character of the string)

Inserts a string of padding characters (character chosen in third parameter; default "0") of a specified length (second parameter) next to a chosen base character or variable (first parameter). The final digits or characters in the base replace the final characters in the padding; i.e. {{padleft:44|3|0}} produces 044. The padding string may be truncated if its length does not evenly divide the required number of characters.

Only the first character of the third parameter is used in versions up to 1.12, but by version 1.15 all the characters are used.

Bug (fixed in r45734): multibyte characters are interpreted as two characters, which can skew width. These also cannot be used as padding characters.

1.8
{{padright:xyz|stringlength}}
{{padright:xyz|strlen|char}}
{{padright:xyz|strlen|string}}
{{padright:xyz|5}} → xyz00

{{padright:xyz|5|_}} → xyz__
{{padright:xyz|5|abc}} → xyzab
{{padright:xyz|2}} → xyz
{{padright:|1|xyz}} → x

Identical to padleft, but adds padding characters to the right side.
1.8

See also: Extension:StringFunctions.

Localization[編集]

Here are the magic words which are used as main localisation tools. Other magic words will often depend on the wiki's locale and configuration or on the chosen language: see in particular #Date and time, #Formatting, #Miscellaneous. More magic words are added by the Extension:Translate.

The usage of these magic words can be very complex, and the documentation is currently incomplete; there's some more info on PLURAL, GRAMMAR, GENDER.

Usage Input → Output Description Version
{{plural:2|is|are}} {{plural:0|is|are}} → are
{{plural:1*1|is|are}} → is
{{plural:21 mod 10|is|are}} → are
{{plural:{{#expr:21 mod 10}}|is|are}} → is
{{plural:1|is|are}} → is
{{plural:2|is|are}} → are
(For Russian)
{{PLURAL:5|1=Категория|Категории}}  → Категории


{{PLURAL:3|страница|страницы|страниц}} → страницы
{{PLURAL:5|страница|страницы|страниц}} → страниц

Outputs the singular form (second parameter) if the first parameter is an expression equalling one; the plural form (third parameter) otherwise. Its functioning is language-dependent.
Some language codes (ab, av, ba, bxr, ce, crh_cyrl, cv, inh, koi, krc, kv, lbe, lez, mhr, mrj, myv, ru, tt_cyrl, tyv, udm, xal) used 3 plural forms (updated 01.2014):
  • Form 1: 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …
  • Form 2: 0, 5, 6, 7, 8, …, 18, 19, 100, 1000, 10000, 100000, 1000000, …
  • Form 3: 2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54, 62, 102, 1002, …
{{grammar:N|noun}} Outputs the correct inflected form of the given word described by the inflection code after the colon (language-dependent). Grammar transformations are used for inflected languages like Polish. See also $wgGrammarForms.
1.7
{{gender:username|text for every gender}}

{{gender:Username|male text|female text|text for unspecified}}
{{gender:|male text|female text|text for unspecified}}
{{gender:.|male text|female text|text for unspecified}}

(Depends on the named user's gender) A switch for the gender set in Special:Preferences.

Note: The first example is basically a no-op
Note: If 3rd parameter is omitted and user hasn't defined his/her gender, then text if user is male is returned.
A blank username field ({{gender:|) means the current user, but can be used only in interface messages (MediaWiki namespace).
A dot username (.) means the default user gender on this wiki.

1.15
r46247
{{int:message name}} <code>{{int:edit}} → 編集
(Depends on user language; try: frja)
Internationalizes (translates) the given interface (MediaWiki namespace) message into the user language. For msgnw and other transclusion magic words, see the Transclusion modifiers section.

Note that this can damage / confuse cache consistency in MediaWiki 1.17 and earlier, see bug 14404.

{{int:editsectionhint|MediaWiki}} <code>{{int:editsectionhint|MediaWiki}} → 節を編集: MediaWiki You may also use parameters with translations.
Parameters are designated in messages with: $1, $2, $3, etc.
For example, here is the message for editsectionhint: Edit section: $1
In this example, MediaWiki replaces $1.

Transclusion modifiers[編集]

{{Page name|optional params}} usually transcludes another page, by default from the Template:namespace. These magic words modify that behavior.

Miscellaneous[編集]

案内メニュー