Difference between revisions of "Help:Magic words"

From The SBN Wiki
Jump to navigation Jump to search
m (1 revision: Media Wiki Help Pages)
 
m (1 revision imported)
 
(One intermediate revision by the same user not shown)
Line 1: Line 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 is about usage of 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}}.
 
  
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-->
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.
+
* '''[[<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]].
 +
 
 +
<!--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"
 
|-
 
|-
! {{Hl2}}| Word
+
! width="20%" | <translate><!--T:9-->
! {{Hl2}}| Description
+
Word</translate>
! {{Hl2}}| Versions
+
! <translate><!--T:10-->
 +
Description</translate>
 +
! width="15%" | <translate><!--T:11-->
 +
Versions</translate>
 
|-
 
|-
! {{Hl3}} colspan="3"| '''[[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 (above 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>
 
|
 
|
 
|-
 
|-
! {{Hl3}} colspan="3"| '''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. If a template contains multiple headings, it may be necessary to add "<tvar|noeditsection><code><nowiki>__NOEDITSECTION__</nowiki></code></>" after each heading.</translate>
 
|
 
|
 
|-
 
|-
 
| <code><nowiki>__NEWSECTIONLINK__</nowiki></code>
 
| <code><nowiki>__NEWSECTIONLINK__</nowiki></code>
| Adds a link ([[MediaWiki:Addsection|"+" by default]]) 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}}
 
|-
 
|-
! {{Hl3}} 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}}
 
|-
 
|-
! {{Hl3}} colspan="3"| '''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>
 +
|
 
|-
 
|-
! {{Hl3}} colspan="3"| '''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:26-->
|
+
No effect. <small>Removed in [[Special:Code/MediaWiki/1695|r1695]] and completly removed in [[Special:Code/MediaWiki/24784|r24784]]</small></translate>
 +
| {{ {{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).
+
| <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 (ie, do not list in search engines' results).
+
| <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>
 +
| <translate><!--T:31-->
 +
Marks a page as a disambiguation page and places it in [[Special:DisambiguationPages]], and places inward links in [[Special:DisambiguationPageLinks]]. Requires the <tvar|ext-disambiguator>{{ll|Extension:Disambiguator}}</>.</translate>
 +
| <translate><!--T:32-->
 +
requires <tvar|ext-disambiguator>{{ll|Extension:Disambiguator}}</></translate>
 
|}
 
|}
  
==Variables==
+
{{anchor|Variables}}
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.
+
<translate>
 +
 
 +
== Variables == <!--T:33-->
 +
 
 +
<!--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}}
The following variables return the current date and time in UTC.
+
<translate>
 +
=== Date and time === <!--T:36-->
  
 +
<!--T:37-->
 +
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"
 
|-
 
|-
! {{Hl2}}| Variable
+
! <translate><!--T:40-->
! {{Hl2}}| Output
+
Variable</translate>
! {{Hl2}}| Description
+
! <translate><!--T:41-->
! {{Hl2}}| Versions
+
Output</translate>
 +
! <translate><!--T:42-->
 +
Description</translate>
 +
! <translate><!--T:43-->
 +
Versions</translate>
 
|-
 
|-
! {{Hl3}} colspan="4"| '''Year'''
+
! 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>
 
|
 
|
 
|-
 
|-
! {{Hl3}} colspan="4"| '''Month'''
+
! 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 (non-zero-padded 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}}
 
|-
 
|-
! {{Hl3}} colspan="4"| '''Day'''
+
! 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>
 
|
 
|
 
|-
 
|-
! {{Hl3}} colspan="4"| '''Time'''
+
! 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>
 
|
 
|
 
|-
 
|-
! {{Hl3}} colspan="4"| '''Other'''
+
! 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 above, 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>
Line 198: Line 287:
 
* <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 === <!--T:64-->
 +
 
 +
<!--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>
  
===Technical metadata===
 
''Note:'' Revision variables return data about the '''latest edit to the current page''', even if viewing an older version of the page.
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! {{Hl2}}| Variable
+
! width="10%" | <translate><!--T:66-->
! {{Hl2}}| Output
+
Variable</translate>
! {{Hl2}}| Description
+
! width="15%" | <translate><!--T:67-->
! {{Hl2}}| Versions
+
Output</translate>
 +
! <translate><!--T:68-->
 +
Description</translate>
 +
! width="10%" | <translate><!--T:69-->
 +
Versions</translate>
 
|-
 
|-
! {{Hl3}} colspan="4"| '''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 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}}
| 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 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}}
 
|-
 
|-
! {{Hl3}} colspan="4"| '''Page'''
+
! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|Page|PAGEID|PROTECTIONLEVEL|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}}
 +
|- style="background:#FED;"
 +
| <code><nowiki>{{CASCADINGSOURCES}}</nowiki></code>
 +
| <!-- Leave this empty. -->
 +
| <translate><!--T:291-->
 +
'''[Expensive]''' 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}}
 
|-
 
|-
! {{Hl3}} colspan="4"| '''Latest revision to current page'''
+
! 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>
 
| <code><nowiki>{{REVISIONUSER}}</nowiki></code>
 
| {{REVISIONUSER}}
 
| {{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}}
 
|-
 
|-
! {{Hl3}} colspan="4"| '''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}}
 
|-
 
|-
| <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 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>)
 
|-
 
|-
| <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 defaultsortkey's are used on one page or to make it do nothing if multiple defaultsortkey's are used.
+
| <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> above.
 
  
The number magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, it depends on the [[page content language]].
+
=== Statistics === <!--T:96-->
 +
 
 +
<!--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"
 
|-
 
|-
! {{Hl2}}| Variable
+
! width="10%" | <translate><!--T:100-->
! {{Hl2}}| Output
+
Variable</translate>
! {{Hl2}}| Description
+
! width="10%" | <translate><!--T:101-->
! {{Hl2}}| Versions
+
Output</translate>
|-
+
! <translate><!--T:102-->
! {{Hl3}} colspan="4"| '''Entire wiki'''
+
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 page 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:112-->
| {{mediawiki|rev:32932|1.13+}}
+
'''[Expensive]''' 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-->
| {{PAGESINCATEGORY:Help|all}}<br />{{PAGESINCATEGORY:Help|pages}}<br />{{PAGESINCATEGORY:Help|subcats}}<br />{{PAGESINCATEGORY:Help|files}}
+
''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>
| '''[expensive]''' Respectively, the number of
+
| {{PAGESINCATEGORY:Help|all}} <br />{{PAGESINCATEGORY:Help|pages}} <br />{{PAGESINCATEGORY:Help|subcats}} <br />{{PAGESINCATEGORY:Help|files}}
 +
| <translate><!--T:113-->
 +
'''[Expensive]''' 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:116-->
 +
'''[Expensive]''' 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"
 
|-
 
|-
! {{Hl2}}| Variable
+
! width="10%" | <translate><!--T:118-->
! {{Hl2}}| Output
+
Variable</translate>
! {{Hl2}}| Description
+
! width="10%" | <translate><!--T:119-->
! {{Hl2}}| Versions
+
Output</translate>
 +
! <translate><!--T:120-->
 +
Description</translate>
 +
! width="10%" | <translate><!--T:121-->
 +
Versions</translate>
 
|-
 
|-
| <code><nowiki>{{FULLPAGENAME}}</nowiki></code>
+
| {{Anchor|FULLPAGENAME|fullpagename}}<code><nowiki>{{FULLPAGENAME}}</nowiki></code>
 
| {{FULLPAGENAME}}
 
| {{FULLPAGENAME}}
| Namespace and page title.
+
| <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}}
 
|-
 
|-
| <code><nowiki>{{PAGENAME}}</nowiki></code>
+
| {{Anchor|PAGENAME|pagename}}<code><nowiki>{{PAGENAME}}</nowiki></code>
 
| {{PAGENAME}}
 
| {{PAGENAME}}
| Page title.
+
| <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}}
| Page title excluding the current [[Help:Subpages|subpage]] and namespace ("Title/foo" on "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 [[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}}
 
|-
 
|-
| <code><nowiki>{{SUBPAGENAME}}</nowiki></code>
+
| {{Anchor|SUBPAGENAME|subpagename}}<code><nowiki>{{SUBPAGENAME}}</nowiki></code>
 
| {{SUBPAGENAME}}
 
| {{SUBPAGENAME}}
| The [[Help:Subpages|subpage]] title ("foo" on "Title/foo").
+
| <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}}
 
|-
 
|-
| <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}}
| The namespace and title 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}}
 
|-
 
|-
| <code><nowiki>{{TALKPAGENAME}}</nowiki></code>
+
| {{Anchor|TALKPAGENAME|talkpagename}}<code><nowiki>{{TALKPAGENAME}}</nowiki></code>
 
| {{TALKPAGENAME}}
 
| {{TALKPAGENAME}}
| The namespace and title 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.
  
====URL encoded page names====
+
<!--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:
 +
* <tvar|code><code><nowiki>{{PAGENAME:Template:Main Page}}</nowiki></code></> &rarr; '''<tvar|result>{{PAGENAME:Template:Main Page}}</>'''
 +
 
 +
<!--T:130-->
 +
{{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. <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 #titleparts (parser function).}}
 +
 
 +
<!--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}}
 +
| L'Aquila = No translation
 +
| L = Not OK
 +
| L&amp;apos;Aquila = Entity escaping
 +
| L&amp;#39;Aquila = Numeric char encoding
 +
}}</nowiki></pre>
 +
 
 +
<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>
Line 454: Line 660:
 
* <nowiki>{{SUBJECTPAGENAMEE}}</nowiki>
 
* <nowiki>{{SUBJECTPAGENAMEE}}</nowiki>
 
* <nowiki>{{ARTICLEPAGENAMEE}}</nowiki>
 
* <nowiki>{{ARTICLEPAGENAMEE}}</nowiki>
* <nowiki>{{TALKPAGENAMEE}}</nowiki></code>
+
* <nowiki>{{TALKPAGENAMEE}}</nowiki>
 
+
* <nowiki>{{ROOTPAGENAMEE}}</nowiki></code>
For example, if page name is "L'Aquila", the following code will produce the string "Numeric char encoding":
 
<pre><nowiki>{{#switch:{{PAGENAME}}
 
|L'Aquila = No translation
 
|L = not ok
 
|L&amp;apos;Aquila = Entity Escaping
 
|L&amp;#39;Aquila = Numeric char encoding
 
}}</nowiki></pre>
 
 
 
(See [[Bugzilla:35628|this bug]] for more information.)
 
  
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:
+
<translate><!--T:135-->
* <code><nowiki>{{PAGENAME:Template:Main Page}}</nowiki></code> &rarr; '''{{PAGENAME:Template:Main Page}}'''
+
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>
  
{{Warning|Page titles containing certain characters, such as single quotes (') 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}}.}}
+
{{anchor|Namespaces}}
 +
<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.
+
=== Namespaces === <!--T:136-->
 +
</translate>
  
===Namespaces===
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! {{Hl2}}| Variable
+
! <translate><!--T:137-->
! {{Hl2}}| Output
+
Variable</translate>
! {{Hl2}}| Description
+
! <translate><!--T:138-->
! {{Hl2}}| 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-->
* <code><nowiki>{{SUBJECTSPACE:Help talk}}</nowiki></code> &rarr; '''{{SUBJECTSPACE:Help talk}}'''
+
Parameter must not be a namespace name:</translate>
 +
* <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}}
 +
|}
  
 +
{{anchor|Parser functions}}
 +
<translate>
 +
== Parser functions == <!--T:148-->
 +
 +
<!--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 hash to distinguish them from templates.
 
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 {{mediawiki|Extension:ParserFunctions|ParserFunctions extension}}. For those see [[Help:Extension:ParserFunctions]].
+
<!--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>
  
===URL data===
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! {{Hl2}}| Parser function
+
! width="15%" | <translate><!--T:152-->
! {{Hl2}}| Input → Output
+
Parser function</translate>
! {{Hl2}}| Description
+
! width="10%" | <translate><!--T:153-->
! {{Hl2}}| 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:156-->
 +
[Expensive] 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:157-->
 +
[Expensive] 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:158-->
 +
[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.</translate>
 +
| {{ {{TNTN|MW version}} |version=1.21|compact=y|comment=and after|r=44683}}{{Anchor|CASCADINGSOURCES:}}
 +
|- style="background: #FED;"
 +
| <code><nowiki>{{CASCADINGSOURCES:</nowiki>
 +
''page name''<nowiki>}}</nowiki></code>
 +
| <!-- Leave this empty. -->
 +
| <translate><!--T:292-->
 +
'''[Expensive]''' 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:160-->
 +
[Expensive] 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:161-->
 +
[Expensive] 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:162-->
 +
[Expensive] 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:163-->
 +
[Expensive] 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:164-->
 +
[Expensive] 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:165-->
 +
[Expensive] 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:166-->
 +
[Expensive] 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:167-->
 +
[Expensive] 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}}
 
|-
 
|-
| <code><nowiki>{{localurl:</nowiki>''page name''<nowiki>}}</nowiki></code><br /><code><nowiki>{{localurl:</nowiki>''page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></code>
+
| colspan="4" | <translate><!--T:168-->
| <code><nowiki>{{localurl:MediaWiki}}</nowiki></code> → {{localurl:MediaWiki}}<br /><code><nowiki>{{localurl:MediaWiki|printable=yes}}</nowiki></code> → {{localurl:MediaWiki|printable=yes}}
+
*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>
| The relative path to the title.  
+
|}
 +
 
 +
<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}}
 +
|-
 +
| <code><nowiki>{{localurl:</nowiki><translate><!--T:279-->
 +
''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>
 +
| <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>
 
|
 
|
 
|-
 
|-
| <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>
+
| colspan="4"| {{Anchor|fullurl|FULLURL}}
| <code><nowiki>{{fullurl:Category:Top level}}</nowiki></code> → {{fullurl:Category:Top level}}<br />
 
<code><nowiki>{{fullurl:Category:Top level|action=edit}}</nowiki></code> → {{fullurl:Category:Top level|action=edit}}
 
| 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.
 
| 1.5+
 
 
|-
 
|-
| <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>{{fullurl:</nowiki><translate><!--T:280-->
| <code><nowiki>{{canonicalurl:Category:Top level}}</nowiki></code> → {{canonicalurl: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>{{canonicalurl:Category:Top level|action=edit}}</nowiki></code> → {{canonicalurl:Category:Top level|action=edit}}
+
| <code><nowiki>{{fullurl:Category:Top level}}</nowiki></code><br />→ {{fullurl:Category:Top level}} <br />
| The absolute path to the title, using the canonical url. This will also resolve [[Manual:Interwiki|Interwiki]] prefixes.
+
<code><nowiki>{{fullurl:Category:Top level|action=edit}}</nowiki></code><br />→ {{fullurl:Category:Top level|action=edit}}<br />
| 1.18+
+
<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}}
 
|-
 
|-
| <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>
+
| colspan="4"| {{Anchor|canonicalurl|CANONICALURL}}
| <code><nowiki>{{filepath:Wiki.png}}</nowiki></code> → {{filepath:Wiki.png}}<br />
 
<code><nowiki>{{filepath:Wiki.png|nowiki}}</nowiki></code> → {{filepath:Wiki.png|nowiki}}<br />
 
<code><nowiki>{{filepath:Example.svg|300}}</nowiki></code> → {{filepath:Example.svg|300}}<br />
 
| A protocol-relative path to the full size or thumbnail ({{mediawiki|rev:80813|1.18+}}) of a media file.
 
| {{mediawiki|rev:25854|1.12+}}<br />{{mediawiki|rev:80813|1.18+}}
 
 
|-
 
|-
| <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>{{canonicalurl:</nowiki><translate><!--T:281-->
| <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
+
''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>
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>{{canonicalurl:Category:Top level}}</nowiki></code><br />→ {{canonicalurl:Category:Top level}} <br />
| The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete [[Extension:StringFunctions]].
+
<code><nowiki>{{canonicalurl:Category:Top level|action=edit}}</nowiki></code><br />{{canonicalurl:Category:Top level|action=edit}}
| {{mediawiki|rev:14273|1.7+}} (or {{mediawiki|rev:64726|1.17+}})<br />{{mediawiki|rev:64726|1.17+}}<br />{{mediawiki|rev:64726|1.17+}}
+
| <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}}
 
|-
 
|-
| <code><nowiki>{{anchorencode:</nowiki>''string''<nowiki>}}</nowiki></code>
+
| colspan="4"| {{Anchor|filepath|FILEPATH}}
| <code><nowiki>{{anchorencode:x y z á é}}</nowiki></code> → {{anchorencode:x y z á é}}
+
|-
| The input encoded for use in URL section anchors (after the '#' symbol in a URL).
+
| <code><nowiki>{{filepath:</nowiki><translate><!--T:282-->
| {{mediawiki|rev:16279|1.8+}}
+
''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></code><br />→ {{filepath:Wiki.png}} <br />
 +
<code><nowiki>{{filepath:Wiki.png|nowiki}}</nowiki></code><br />→ {{filepath:Wiki.png|nowiki}} <br />
 +
<code><nowiki>{{filepath:Example.svg|300}}</nowiki></code><br />→ {{filepath:Example.svg|300}} <br />
 +
| <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}}
 +
|-
 +
| <code><nowiki>{{urlencode:</nowiki><translate><!--T:283-->
 +
''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>
 +
| <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}}
 +
<translate><!--T:178-->
 +
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}}
 +
|-
 +
| <code><nowiki>{{anchorencode:</nowiki><translate><!--T:284-->
 +
''string''</translate><nowiki>}}</nowiki></code>
 +
| <code><nowiki>{{anchorencode:x y z á é}}</nowiki></code><br />→ {{anchorencode:x y z á é}}
 +
| <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}}
<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 was French, <code><nowiki>{{ns:Fichier}}</nowiki></code> would also be valid, but <code><nowiki>{{ns:Datei}}</nowiki></code> (the localisation of "File" into German) would not.
+
<translate>
 +
=== Namespaces === <!--T:181-->
 +
 
 +
<!--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"
 
|-
 
|-
! {{hl3}} colspan="2" width="50%" | Content namespaces
+
! colspan="2" width="50%" | <translate><!--T:258-->
! rowspan="12" |
+
Content namespaces</translate>
! {{hl3}} colspan="2" width=%50%" | Talk namespaces
+
! rowspan="11" |
|-
+
! colspan="2" width=%50%" | <translate><!--T:259-->
! {{Hl2}}| Usage
+
Talk namespaces</translate>
! {{Hl2}}| Output
 
! {{Hl2}}| Usage
 
! {{Hl2}}| Output
 
 
|-
 
|-
| <code><nowiki>{{ns:-2}}</nowiki></code> or <code><nowiki>{{ns:Media}}</nowiki></code>
+
! <translate><!--T:184-->
| {{ns:-2}} || ||
+
Usage</translate>
 +
! <translate><!--T:185-->
 +
Output</translate>
 +
! <translate><!--T:186-->
 +
Usage</translate>
 +
! <translate><!--T:187-->
 +
Output</translate>
 
|-
 
|-
| <code><nowiki>{{ns:-1}}</nowiki></code> or <code><nowiki>{{ns:Special}}</nowiki></code>
+
| <code><nowiki>{{ns:-2}}</nowiki></code> / <code><nowiki>{{ns:Media}}</nowiki></code>
| {{ns:-1}} || ||
+
| {{ns:-2}}
 +
| <code><nowiki>{{ns:-1}}</nowiki></code> / <code><nowiki>{{ns:Special}}</nowiki></code>
 +
| {{ns:-1}}<br/>''(no '''talk''' page)''
 
|-
 
|-
| <code><nowiki>{{ns:0}}</nowiki></code> or <code><nowiki>{{ns:}}</nowiki></code>
+
| <code><nowiki>{{ns:0}}</nowiki></code> / <code><nowiki>{{ns:}}</nowiki></code>
| {{ns:}}
+
| {{ns:0}}
| <code><nowiki>{{ns:1}}</nowiki></code> or <code><nowiki>{{ns:Talk}}</nowiki></code>
+
| <code><nowiki>{{ns:1}}</nowiki></code> / <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}}
+
| {{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}}
 
|}
 
|}
  
===Formatting===
+
<translate><!--T:188-->
 +
Don't confuse localised namespaces with [[<tvar|manual-custom-ns>Special:MyLanguage/Manual:Using custom namespaces</>|custom namespaces]].</translate>
 +
 
 +
{{anchor|Formatting}}
 +
<translate>
 +
=== Formatting === <!--T:189-->
 +
</translate>
  
<!-- Well gosh, with the source of the examples hidden, who can tell what you are inputting without looking here in the source? -->
 
 
{| class="wikitable"
 
{| class="wikitable"
! {{Hl2}}| Usage
+
! width="10%" | <translate><!--T:190-->
! {{Hl2}}| Input → Output
+
Usage</translate>
! {{Hl2}}| Description
+
! width="40%" | <translate><!--T:191-->
! {{Hl2}}| 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&nbsp;num''<nowiki>}}</nowiki></code><br /><code><nowiki>{{formatnum:</nowiki>''formatted&nbsp;num''<nowiki>|R}}</nowiki></code>
+
<code><nowiki>{{formatnum:</nowiki>''formatnum-formatted&nbsp;number''<nowiki>|R}}</nowiki></code> <br />
| <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code><br/> → {{formatnum:987654321.654321}}<br />  
+
<code><nowiki>{{formatnum:</nowiki>''unformatted number''<nowiki>|NOSEP}}</nowiki></code>
<code><nowiki>{{formatnum:987,654,321.654321|R}}</nowiki></code><br/> → {{formatnum:987,654,321.654321|R}}<br />  
+
|  
<code><nowiki>{{formatnum:{{formatnum:987.654.321}}}}</nowiki></code><br/> → 987 654 321 (e.g. with Italian locale)<br />
+
* <translate><!--T:194-->
<code><nowiki>{{formatnum:00001}}</nowiki></code><br/> {{formatnum:00001}}
+
Simple:</translate>
| The input with decimal and decimal group separators, and localized digit script, according to the wiki's default locale. The <code><nowiki>|</nowiki>R</code> parameter can be used to unformat a number, for use in mathematical situations. It doesn't always work if you try to unformat a number in non-English format on a wiki with non-English locale; if you need to format (according the wiki's locale) a number in unknown input format, 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).<br/><small>{{warning}}Leading zeroes are not removed, you can use <nowiki>{{#expr:00001}}</nowiki> instead if you have [[Extension:ParserFunctions]] installed</small>
+
** <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code> <br/> → {{formatnum:987654321.654321}}
| 1.7+<br />{{mediawiki|rev:32012|1.13+}}
+
** <code><nowiki>{{formatnum:</nowiki>{{formatnum:987654321.654321}}<nowiki>|R}}</nowiki></code> <br/> → {{formatnum:{{formatnum:987654321.654321}}|R}}
 +
* <translate><!--T:195-->
 +
Advanced:</translate>
 +
** <code><nowiki>{{formatnum:{{formatnum:987654321.654321}}|R}}</nowiki></code> <br/> → {{formatnum:{{formatnum:987654321.654321}}|R}} <translate><!--T:196-->
 +
(on any locale)</translate>
 +
** <code><nowiki>{{formatnum:00001}}</nowiki></code> <br/> → {{formatnum:00001}}
 +
** <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
 +
----
 +
<translate><!--T:198-->
 +
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>
 +
----
 +
<translate><!--T:200-->
 +
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&amp;nbsp;654,321|R}}</nowiki></code>
 +
| <translate><!--T:202-->
 +
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 />
 +
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/>
 +
<translate><!--T:205-->
 +
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/>
 +
----
 +
 
 +
<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-->
<code><nowiki>{{#formatdate:dec 25,2009|dmy}}</nowiki></code><br/>
+
(your pref), 2009 Dec 25 (default)</translate> <br/>
→ {{#formatdate:dec 25,2009|dmy}} (your pref), 25 Dec 2009 (default)<br/>
+
<code><nowiki>{{#formatdate:dec 25,2009|dmy}}</nowiki></code> <br/>
<code><nowiki>{{#dateformat:2009-12-25|mdy}}</nowiki></code><br/>
+
→ {{#formatdate:dec 25,2009|dmy}} <translate><!--T:208-->
→ {{#dateformat:2009-12-25|mdy}} (your pref), December 25, 2009 (default)<br/>
+
(your pref), 25 Dec 2009 (default)</translate> <br/>
<code><nowiki>{{#formatdate:2009 dec 25|ISO 8601}}</nowiki></code><br/>
+
<code><nowiki>{{#dateformat:2009-12-25|mdy}}</nowiki></code> <br/>
→ {{#formatdate:2009 dec 25|ISO 8601}} (your pref), 2009-12-25 (default)<br/>
+
→ {{#dateformat:2009-12-25|mdy}} <translate><!--T:209-->
<code><nowiki>{{#dateformat:25 decEmber|mdy}}</nowiki></code><br/>
+
(your pref), December 25, 2009 (default)</translate> <br/>
→ {{#dateformat:25 decEmber|mdy}} (your pref), DecEmber 25 (default)<br/>
+
<code><nowiki>{{#formatdate:2009 dec 25|ISO 8601}}</nowiki></code> <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/>
 +
→ {{#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>
  
 +
| <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.</translate> <br/>
  
Note: In the example above, "your pref" refers to your date preference on the current MediaWiki wiki only.
+
<small>{{TNT|warning}}<translate><!--T:214-->
| 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>
+
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>
| {{mediawiki|rev:48249|1.15+}}
+
 
 +
| {{ {{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.<br />'''{{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.
+
<code><nowiki>{{padleft:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''string''<nowiki>}}</nowiki></code>
| 1.8+
+
| <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.
 +
 
 +
<!--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.
 +
 
 +
<!--T:222-->
 +
'''{{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 padleft, but adds padding characters to the right side.
+
| <translate><!--T:223-->
|
+
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]].
 
  
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: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}}</>.
 +
 
 +
<!--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"
! {{Hl2}}| Usage
+
! width="10%" | <translate><!--T:228-->
! {{Hl2}}| Input → Output
+
Usage</translate>
! {{Hl2}}| Description
+
! width="40%" | <translate><!--T:229-->
! {{Hl2}}| Version
+
Input → Output</translate>
 +
! <translate><!--T:230-->
 +
Description</translate>
 +
! width="10%" | <translate><!--T:231-->
 +
Version</translate>
 
|-
 
|-
|-
+
| {{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 /> <translate><!--T:232-->
| <code><nowiki>{{plural:2|</nowiki>''is''<nowiki>|</nowiki>''are''<nowiki>}}</nowiki></code>
+
(For [[w:Russian language|Russian]])</translate><br /><code><nowiki>{{PLURAL:5|1=Категория|Категории}} </nowiki></code>&nbsp;→&nbsp;Категории
| <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> → miliony
+
<br /><code><nowiki>{{PLURAL:3|страница|страницы|страниц}}</nowiki></code>&nbsp;→&nbsp;страницы<br /><code><nowiki>{{PLURAL:5|страница|страницы|страниц}}</nowiki></code>&nbsp;&nbsp;страниц
| 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]].
+
| <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.<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. ''Note that this can damage/confuse cache consistency in MediaWiki 1.17 and earlier, see [[bugzilla:14404|bug 14404]].''
+
| <code><nowiki>{{int:</nowiki>edit<nowiki>}}</nowiki></code> &rarr; '''{{int:edit}}''' <br /><small>''<translate><!--T:237-->
 +
(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"
! {{Hl2}}| Usage
+
! width="15%" | <translate><!--T:311-->
! {{Hl2}}| Output
+
Usage</translate>
! {{Hl2}}| Description
+
! width="15%" | <translate><!--T:312-->
! {{Hl2}}| 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 by default, name translated in target language if a target language code is specified. Codes are mostly in accordance with [[w:ISO 639|ISO 639]].
+
|
| {{mediawiki|rev:14490|1.7+}}
 
{{r|91875|1.18+}} (translation)
 
 
|-
 
|-
| <code><nowiki>{{#special:</nowiki>''special page name''<nowiki>}}</nowiki><br /><nowiki>{{#special:userlogin}}</nowiki></code>
+
| <nowiki>{{int:xyz}}</nowiki>
| {{#special:special page name}}<br />{{#special:userlogin}}
+
|
| The localized name for the given canonical Special: page.
+
| <translate><!--T:317-->
| {{mediawiki|rev:17321|1.9+}}
+
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>{{#speciale:</nowiki>''special page name''<nowiki>}}</nowiki><br /><nowiki>{{#speciale:userlogin}}</nowiki></code>
+
| <nowiki>{{msg:xyz}}</nowiki>
| {{#speciale:special page name}}<br />{{#speciale:userlogin}}
+
|
| The localized and url-encoded name for the given canonical Special: page.
+
| <translate><!--T:321-->
| {{mediawiki|gerrit:4340|1.20+}}
+
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>
 +
|
 
|-
 
|-
| <code><nowiki>{{#tag:</nowiki>''tagname''<br><nowiki>|</nowiki>''content''<br><nowiki>|</nowiki>''attribute1=value1''<br /><nowiki>|</nowiki>''attribute2=value2''<br /><nowiki>}}</nowiki></code>
+
| <nowiki>{{raw:xyz}}</nowiki>
| ''(depends on parser tag)''
+
|
| 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: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}}
 +
| <translate><!--T:247-->
 +
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><translate><!--T:289-->
 +
''special page name''</translate><nowiki>}}</nowiki> <br /><nowiki>{{#speciale:userlogin}}</nowiki></code>
 +
| {{#speciale:special page name}} <br />{{#speciale:userlogin}}
 +
| <translate><!--T:248-->
 +
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><translate><!--T:290-->
 +
''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>
 +
| <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></>  
  
...can be rewritten like this:
+
<!--T:252-->
 +
…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></>
  
Example for the [[Extension:Cite|Cite extension]]'s <code>&lt;ref&gt;</code> tags:
+
<!--T:254-->
 +
Example for the [[<tvar|ext-cite>Special:MyLanguage/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>
 
  
<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 {{!}}{{!}} before ''attribute1''.</small>
+
<!--T:255-->
| {{mediawiki|rev:29482|1.12+}}
+
<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>{{TNT|warning}}<translate><!--T:256-->
 +
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}}]]
 

Latest revision as of 14:21, 15 July 2015

<languages /> Template:TOCRight Template:TNT <translate> 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 [[<tvar|manual-magic-words>Special:MyLanguage/Manual:Magic words</>]].

There are three general types of magic words:

  • [[<tvar|bs>#Behavior switches</>|Behavior switches]]: these are uppercase words surrounded by double underscores, e.g. __FOO__.
  • [[<tvar|var>#Variables</>|Variables]]: these are uppercase words surrounded by double braces, e.g. {{FOO}}. As such, they look a lot like [[<tvar|help-templates>Special:MyLanguage/Help:Templates</>|templates]].
  • [[<tvar|pfunc>#Parser functions</>|Parser functions]]: these take parameters and are either of the form {{foo:...}} or {{#foo:...}}. See also <tvar|help-ext-parser-functions>Template:Ll</>.

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>

<translate>

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.</translate>

<translate>

Word</translate>

<translate>

Description</translate>

<translate>

Versions</translate>

<translate>

[[<tvar|manual-toc>Special:MyLanguage/Manual:Table of contents</>|Table of contents]]</translate>

__NOTOC__ <translate>

Hides the [[<tvar|manual-toc>Special:MyLanguage/table of contents</>|table of contents]] (TOC).</translate>

__FORCETOC__ <translate>

Forces the table of contents to appear at its normal position (before the first header, overriding <tvar|notoc>__NOTOC__</>).</translate>

__TOC__ <translate>

Places a table of contents at the word's current position (overriding <tvar|notoc>__NOTOC__</>). If this is used multiple times, the table of contents will appear at the first word's position.</translate>

<translate>

Editing</translate>

__NOEDITSECTION__ <translate>

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 "<tvar|noeditsection>__NOEDITSECTION__</>" after each heading.</translate>

__NEWSECTIONLINK__ <translate>

Adds a link beside the "edit" tab for adding a new section on a non-talk page (see [[<tvar|meta-help-section>m:Special:MyLanguage/Help:Section#Adding a section at the end</>]]).</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}
__NONEWSECTIONLINK__ <translate>

Removes the link beside the "edit" tab on pages in talk namespaces.</translate>

{{ Template:TNTN |version=1.15|compact=y|comment=and after|r=47522}}
<translate>

Categories</translate>

__NOGALLERY__ <translate>

Used on a category page, replaces thumbnails in the category view with normal links.</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}
__HIDDENCAT__ <translate>

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>

{{ Template:TNTN |version=1.13|compact=y|comment=and after}}
<translate>

Language conversion</translate>

__NOCONTENTCONVERT__
__NOCC__
<translate>

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>

__NOTITLECONVERT__
__NOTC__
<translate>

On wikis with language variants, don't perform language conversion on the title (all other content is converted).</translate>

<translate>

Other</translate>

__START__ <translate>

No effect. Removed in r1695 and completly removed in r24784</translate>

{{ Template:TNTN |version=1.10|compact=y|comment=and before|r=1610}}
__END__ <translate>

Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace. Removed in 19213.</translate>

{{ Template:TNTN |version=1.1|compact=y|version2=1.8}}
__INDEX__ <translate>

Tell search engines to index the page (overrides <tvar|manual-wg-bot-policy>$wgArticleRobotPolicies</>, but not robots.txt). It obeys <tvar|manual-wg-exempt-from-bot>$wgExemptFromUserRobotsControl</> variable.</translate>

{{ Template:TNTN |version=1.14|compact=y|comment=and after}}
__NOINDEX__ <translate>

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>$wgExemptFromUserRobotsControl</> variable.</translate>

{{ Template:TNTN |version=1.14|compact=y|comment=and after|r=37973}}
__STATICREDIRECT__ <translate>

On redirect pages, don't allow MediaWiki to automatically update the link when someone moves a page and checks "<tvar|fixDoubleRedirects>Update any redirects that point to the original title</>" (which requires [[<tvar|var>Special:MyLanguage/Manual:$wgFixDoubleRedirects</>|$wgFixDoubleRedirects]]).</translate>

{{ Template:TNTN |version=1.13|compact=y|comment=and after|r=37928}}
__DISAMBIG__ <translate>

Marks a page as a disambiguation page and places it in Special:DisambiguationPages, and places inward links in Special:DisambiguationPageLinks. Requires the <tvar|ext-disambiguator>Template:Ll</>.</translate>

<translate>

requires <tvar|ext-disambiguator>Template:Ll</></translate>

<translate>

Variables

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 "[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 Template:PAGENAME you would need to write <tvar|code>{{Template:</>PAGENAME<tvar|code-end>}}</>). In some cases, adding parameters will force the parser to invoke a template; for example, <tvar|tpl-currentdayname-code>{{CURRENTDAYNAME|x}}</> transcludes <tvar|tpl-currentdayname-result>Template:CURRENTDAYNAME</>, not the variable. </translate>

<translate>

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 [[<tvar|manual-pagelang>Special:MyLanguage/Manual:Language#page-content-lang</>|page content language]].</translate>

<translate>

Variable</translate>

<translate>

Output</translate>

<translate>

Description</translate>

<translate>

Versions</translate>

<translate>

Year</translate>

{{CURRENTYEAR}} 2024 <translate>

Year</translate>

<translate>

Month</translate>

{{CURRENTMONTH}} 04 <translate>

Month (zero-padded number)</translate>

{{CURRENTMONTH1}} 4 <translate>

Month (non-zero-padded number)</translate>

{{CURRENTMONTHNAME}} April <translate>

Month (name)</translate>

{{CURRENTMONTHNAMEGEN}} April <translate>

Month (genitive form)</translate>

{{CURRENTMONTHABBREV}} Apr <translate>

Month (abbreviation)</translate>

{{ Template:TNTN |version=1.5|compact=y|comment=and after}}
<translate>

Day</translate>

{{CURRENTDAY}} 19 <translate>

Day of the month (unpadded number)</translate>

{{CURRENTDAY2}} 19 <translate>

Day of the month (zero-padded number)</translate>

{{ Template:TNTN |version=1.6|compact=y|comment=and after}}
{{CURRENTDOW}} 5 <translate>

Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday)</translate>

{{CURRENTDAYNAME}} Friday <translate>

Day of the week (name)</translate>

<translate>

Time</translate>

{{CURRENTTIME}} 18:34 <translate>

Time (24-hour HH:mm format)</translate>

{{CURRENTHOUR}} 18 <translate>

Hour (24-hour zero-padded number)</translate>

<translate>

Other</translate>

{{CURRENTWEEK}} 16 <translate>

Week (number)</translate>

{{CURRENTTIMESTAMP}} 20240419183423 <translate>

YYYYMMDDHHmmss timestamp</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}

<translate> The following variables do the same as the preceding ones, but using the site's server config or <tvar|manual-wg-localtimezone>$wgLocaltimezone</>. </translate>

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

<translate> For more thorough time formatting, you may want to install <tvar|ext-parserfunctions>Template:Ll</> to use the [[<tvar|ext-parserfunct-t>Special:MyLanguage/Help:Extension:ParserFunctions#.23time</>|#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.</translate>

<translate>

Variable</translate>

<translate>

Output</translate>

<translate>

Description</translate>

<translate>

Versions</translate>

<translate>

Site</translate>

{{SITENAME}} The SBN Wiki <translate>

The wiki's site name (<tvar|manual-wg-sitename>$wgSitename</>).</translate>

{{SERVER}} //sbnwiki.astro.umd.edu <translate>

Domain URL (<tvar|manual-wg-server>$wgServer</>).</translate>

{{SERVERNAME}} sbnwiki.astro.umd.edu <translate>

Subdomain and domain name (no longer dependent on <tvar|manual-wg-servername>$wgServerName</> as of version 1.17).</translate>

{{DIRMARK}}
{{DIRECTIONMARK}}

<translate>

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 [[<tvar|manual-pagelang>Special:MyLanguage/Manual:Language#page-content-lang</>|page content language]].</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after|r=14442}}
{{SCRIPTPATH}} /wiki <translate>

Relative script path (<tvar|manual-wg-scriptpath>$wgScriptPath</>).</translate>

{{STYLEPATH}} /wiki/skins <translate>

Relative style path (<tvar|manual-wg-stylepath>$wgStylePath</>).</translate>

{{ Template:TNTN |version=1.16|compact=y|comment=and after}}
{{CURRENTVERSION}} 1.34.1 <translate>

The wiki's MediaWiki version.</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after|r=14199}}
{{CONTENTLANGUAGE}}
{{CONTENTLANG}}
en
en
<translate>

The wiki's default interface language (<tvar|manual-wg-langcode>$wgLanguageCode</>).</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after|r=14661}}
<translate>

Page</translate>

{{PAGEID}} 16 <translate>

Returns the page identifier.</translate>

{{ Template:TNTN |version=1.20|compact=y|comment=and after|gerrit change=9858}}
{{PROTECTIONLEVEL:<translate>

action</translate>}}

<translate>

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>

{{ Template:TNTN |version=1.15|compact=y|comment=and after|r=45587}}
{{CASCADINGSOURCES}} <translate>

[Expensive] Returns the sources of any cascading protection acting on the current page. Pages will not return their own title unless they transclude themselves.</translate>

{{ Template:TNTN |version=1.23|compact=y|comment=and after|gerrit change=104999}}
<translate>

Latest revision to current page</translate>

{{REVISIONID}} 1499 <translate>

Unique revision ID.</translate>

{{ Template:TNTN |version=1.5|compact=y|comment=and after}}
{{REVISIONDAY}} 15 <translate>

Day edit was made (unpadded number).</translate>

{{ Template:TNTN |version=1.8|compact=y|comment=and after}}
{{REVISIONDAY2}} 15 <translate>

Day edit was made (zero-padded number).</translate>

{{ Template:TNTN |version=1.8|compact=y|comment=and after}}
{{REVISIONMONTH}} 07 <translate>

Month edit was made (zero-padded number as of 1.17+, unpadded number in prior versions).</translate>

{{ Template:TNTN |version=1.8|compact=y|comment=and after}}
{{REVISIONMONTH1}} 7 <translate>

Month edit was made (unpadded number).</translate>

{{ Template:TNTN |version=1.17|compact=y|comment=and after|r=66200}}
{{REVISIONYEAR}} 2015 <translate>

Year edit was made.</translate>

{{ Template:TNTN |version=1.8|compact=y|comment=and after}}
{{REVISIONTIMESTAMP}} 20150715142118 <translate>

Timestamp as of time of edit.</translate>

{{ Template:TNTN |version=1.8|compact=y|comment=and after}}
{{REVISIONUSER}} Raugh <translate>

The username of the user who made the most recent edit to the page, or the current user when previewing an edit.</translate>

{{ Template:TNTN |version=1.15|compact=y|comment=and after|r=48149}}
{{REVISIONSIZE}} 80751 <translate>

The size (bytes of wikitext) of the current revision of this page</translate>

{{ Template:TNTN |version=1.22|compact=y|comment=and after|gerrit change=82650}}
<translate>

Affects page content</translate>

{{DISPLAYTITLE:<translate>

title</translate>}}

<translate>

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 <tvar|manual-wg-restrict-disp-title>$wgRestrictDisplayTitle</>). It can be disabled or enabled by <tvar|manual-wg-allow-disp-title>$wgAllowDisplayTitle</>; disabled by default before 1.10+, enabled by default thereafter.</translate> <translate> 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.</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}
{{ Template:TNTN |version=1.24|compact=y|comment=and after|gerrit change=144870}}
(<translate>

for noerror and noreplace</translate>)

{{DEFAULTSORT:<translate>

sortkey<tvar|code1>}}
{{DEFAULTSORTKEY:</>sortkey<tvar|code2>}}
{{DEFAULTCATEGORYSORT:</>sortkey<tvar|code3>}}
{{DEFAULTSORT:</>sortkey<tvar|code4>|noerror}}
{{DEFAULTSORT:</>sortkey</translate>|noreplace}}

<translate>

Used for categorizing pages, sets a default [[<tvar|help-categories>Special:MyLanguage/Help:Categories</>|category sort key]]. For example if you put <tvar|sort>{{DEFAULTSORT:</>Smith , John<tvar|sort-end>}}</> 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>defaultsort</> do nothing if a <tvar|sort3>defaultsort</> was already specified earlier in the page.</translate>

{{ Template:TNTN |version=1.10|compact=y|comment=and after}}
{{ Template:TNTN |version=1.19|compact=y|comment=and after|r=96767}}
(<translate>

for noerror and noreplace</translate>)

<translate>

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, <tvar|nop-code>{{NUMBEROFPAGES}}</> → <tvar|nop-result>440</> and <tvar|nop-r-code>{{NUMBEROFPAGES:R}}</> → <tvar|nop-r-result>440</>).

Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example <tvar|pic>{{PAGESINCATEGORY:Help}}</> and <tvar|pic-r>{{PAGESINCATEGORY:Help|R}}</>, or <tvar|pic-subcats>{{PAGESINCATEGORY:Help|subcats}}</> and <tvar|pic-subcats-r>{{PAGESINCATEGORY:Help|subcats|R}}</>). Also applicable to <tvar|pagesize>{{PAGESIZE:</>page name<tvar|pagesize-end>}}</> hereinbefore.

The number magic words are formatted in the wiki content language. Since 1.19, it depends on the [[<tvar|manual-pagelang>Special:MyLanguage/Manual:Language#page-content-lang</>|page content language]].</translate>

<translate>

Variable</translate>

<translate>

Output</translate>

<translate>

Description</translate>

<translate>

Versions</translate>

{{NUMBEROFPAGES}} 440 <translate>

Number of wiki pages.</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}
{{NUMBEROFARTICLES}} 91 <translate>

Number of pages in [[<tvar|manual-content-ns>Special:MyLanguage/Manual:Using custom namespaces#content-ns</>]].</translate>

{{NUMBEROFFILES}} 104 <translate>

Number of uploaded files.</translate>

{{ Template:TNTN |version=1.5|compact=y|comment=and after}}
{{NUMBEROFEDITS}} 2,830 <translate>

Number of wiki edits.</translate>

{{ Template:TNTN |version=1.10|compact=y|comment=and after|r=21319}}
{{NUMBEROFVIEWS}} <translate>

Number of page views. Usually useless on a wiki using [[<tvar|manual-cache>Special:MyLanguage/Manual:Cache</>|caching]].</translate> <translate> Removed in <tvar|gerrit>Template:Gerrit</>.</translate>

{{ Template:TNTN |version=1.14|compact=y|version2=1.24|r=42721}}
{{NUMBEROFUSERS}} 1,022 <translate>

Number of registered users.</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}
{{NUMBEROFADMINS}} 4 <translate>

Number of users in the sysop [[<tvar|manual-userrights>Special:MyLanguage/Manual:User rights</>]].</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}
{{NUMBEROFACTIVEUSERS}} 3 <translate>

Number of active users, based on the criteria used in Special:Statistics.</translate>

{{ Template:TNTN |version=1.15|compact=y|comment=and after|r=47392}}
{{PAGESINCATEGORY:categoryname}}
{{PAGESINCAT:categoryname}}
31
31
<translate>

[Expensive] Number of pages (including subcategories and files) in the given [[<tvar|help-categories>Special:MyLanguage/Help:Categories</>|category]]. (Category:Help used for demonstration)</translate>

{{ Template:TNTN |version=1.13|compact=y|comment=and after|r=32932}}
{{PAGESINCATEGORY:<translate>

categoryname<tvar|code1>|all}}
{{PAGESINCATEGORY:</>categoryname<tvar|code2>|pages}}
{{PAGESINCATEGORY:</>categoryname<tvar|code3>|subcats}}
{{PAGESINCATEGORY:</>categoryname</translate>|files}}

31
31
0
0
<translate>

[Expensive] Respectively, the number of

  • all pages
  • ordinary pages (excluding subcategories and files)
  • subcategories or
  • files

in the given [[<tvar|help-categories>Special:MyLanguage/Help:Categories</>|category]]. (Category:Help used for demonstration)</translate>

{{ Template:TNTN |version=1.20|compact=y|comment=and after|gerrit change=12790}}
{{NUMBERINGROUP:<translate>

groupname<tvar|code1>}}
{{NUMINGROUP:</>groupname</translate>}}

3
3
({{NUMBERINGROUP:bureaucrat}} used here)
<translate>

Number of users in a specific [[<tvar|manual-userrights>Special:MyLanguage/Manual:User rights</>]].</translate>

{{ Template:TNTN |version=1.14|compact=y|comment=and after|r=40116}}
{{PAGESINNS:<translate>

index<tvar|code1>}}
{{PAGESINNAMESPACE:</>index</translate>}}

<translate>

Not enabled</translate>

<translate>

[Expensive] 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>{{PAGESINNAMESPACE:14}}</> will output the number of category pages. <tvar|pins0>{{PAGESINNS:0}}</> differs from <tvar|noa>{{NUMBEROFARTICLES}}</> in that the former includes redirects and disambiguation pages. Disabled by default, enable with <tvar|manual-wg-allow-slow-parser-funct>$wgAllowSlowParserFunctions</>. </translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}

<translate>

Page names

</translate>

<translate>

Variable</translate>

<translate>

Output</translate>

<translate>

Description</translate>

<translate>

Versions</translate>

{{FULLPAGENAME}} Help:Magic words <translate>

Namespace and full page title (including all subpage levels).</translate>

{{ Template:TNTN |version=1.6|compact=y|comment=and after}}
{{PAGENAME}} Magic words <translate>

Full page title (including all subpage levels) without the namespace.</translate>

{{BASEPAGENAME}} Magic words <translate>

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").

For more complex splitting, use <tvar|help-ext-pf-titleparts>{{#titleparts:}}</> from the [[<tvar|help-ext-pf>Special:MyLanguage/Help:Extension:ParserFunctions</>|ParserFunctions extension]].</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}
{{SUBPAGENAME}} Magic words <translate>

The [[<tvar|help-subpages>Special:MyLanguage/Help:Subpages</>|subpage]] title ("bar" on "Help:Title/foo/bar").</translate>

{{ Template:TNTN |version=1.6|compact=y|comment=and after}}
{{SUBJECTPAGENAME}}
{{ARTICLEPAGENAME}}
Help:Magic words
Help:Magic words
<translate>

Full page name of the associated subject (e.g. article or file). Useful on talk pages.</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}
{{TALKPAGENAME}} Help talk:Magic words <translate>

Full page name of the associated talk page.</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}
{{ROOTPAGENAME}} Magic words <translate>

Name of the root of the current page.</translate> <translate> Would return <tvar|foo>Title</> on page <tvar|baz>Help:Title/Foo/Bar</></translate>

{{ Template:TNTN |version=1.22|compact=y|comment=and after}}

<translate> The <tvar|basepagename>{{BASEPAGENAME}}</> and <tvar|subpagename>{{SUBPAGENAME}}</> magic words only work in namespaces that have subpages enabled. See <tvar|manual-wg-ns-with-subpages>$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:

  • <tvar|code>{{PAGENAME:Template:Main Page}}</> → <tvar|result>Main Page</>
Warning Warning: Page titles containing certain characters, such as apostrophes ' or asterisks *, may produce unexpected results when handled with these magic words, e.g. <tvar

For example, if page name is "<tvar|pagename>L'Aquila</>", the following code will produce the string "<tvar|result>Numeric char encoding</>": </translate>

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

<translate>

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):</translate>

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

<translate> Note that <tvar|pagename>{{PAGENAME:...}}</>, <tvar|pagenamee>{{PAGENAMEE:...}}</> and <tvar|uec>{{urlencode:...}}</> have distinct implementations. See [[<tvar|manual-pagename-encoding>Special:MyLanguage/Manual:PAGENAMEE encoding</>|Manual:PAGENAMEE encoding]] for details. </translate>

<translate>

Namespaces

</translate>

<translate>

Variable</translate>

<translate>

Output</translate>

<translate>

Description</translate>

<translate>

Versions</translate>

{{NAMESPACE}} Help <translate>

Name of the page's namespace</translate>

{{NAMESPACENUMBER}} 12 <translate>

[[<tvar|manual-ns-id>Special:MyLanguage/Manual:Namespace#Built-in_namespaces</>|ID]] of the page's namespace</translate>

{{ Template:TNTN |version=1.20|compact=y|comment=and after|gerrit change=4056}}
{{SUBJECTSPACE}}
{{ARTICLESPACE}}
Help
Help
<translate>

Name of the associated content namespace</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}
{{TALKSPACE}} Help talk <translate>

Name of the associated talk namespace</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}

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

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

<translate> 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:</translate>

  • {{NAMESPACE:Template:Main Page}}Template
  • {{SUBJECTSPACE:Template:Main Page}}Template
  • {{TALKSPACE:Template:Main Page}}Template talk

<translate> Parameter must not be a namespace name:</translate>

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

<translate>

Other

</translate>

<translate>

Variable</translate>

<translate>

Output</translate>

<translate>

Description</translate>

<translate>

Versions</translate>

{{!}} | <translate>

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.</translate>

{{ Template:TNTN |version=1.24|compact=y|comment=and after|gerrit change=136234}}

<translate>

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 <tvar|ext-pf>Template:Ll</>. For those see <tvar|help-ext-pf>Template:Ll</>.

Technical metadata of another page

</translate>

<translate>

Parser function</translate>

<translate>

Output
(for page MediaWiki)</translate>

<translate>

Description</translate>

<translate>

Versions</translate>

{{PAGEID: <translate>

page name</translate> }}

0 <translate>

[Expensive] Returns the page identifier of the specified page*.</translate>

{{ Template:TNTN |version=1.23|compact=y|comment=and after|gerrit change=76534}}
{{PAGESIZE: <translate>

page name<tvar|code1> }}
{{PAGESIZE: </>page name</translate> |R}}

0
0
<translate>

[Expensive] Returns the byte size of the specified page. Use "<tvar|r>|R</>" to get raw (unformatted) numbers.</translate>

{{ Template:TNTN |version=1.13|compact=y|comment=and after|r=33551}}
{{PROTECTIONLEVEL:<translate>

action</translate> | <translate> page name</translate>}}

<translate>

[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.</translate>

{{ Template:TNTN |version=1.21|compact=y|comment=and after|r=44683}}
{{CASCADINGSOURCES:

page name}}

<translate>

[Expensive] Returns the sources of any cascading protection acting on the specified page. Pages will not return their own title unless they transclude themselves.</translate>

{{ Template:TNTN |version=1.23|compact=y|comment=and after|gerrit change=104999}}
{{REVISIONID: <translate>

page name</translate> }}

<translate>

[Expensive] Unique revision ID of the last revision on the specified page*.</translate>

{{ Template:TNTN |version=1.23|compact=y|comment=and after|gerrit change=76534}}
{{REVISIONDAY: <translate>

page name</translate> }}

<translate>

[Expensive] Day of edit from the last revision of the specified page* (unpadded number).</translate>

{{ Template:TNTN |version=1.23|compact=y|comment=and after|gerrit change=76534}}
{{REVISIONDAY2: <translate>

page name</translate> }}

<translate>

[Expensive] Day of edit from the last revision of the specified page* (zero-padded number).</translate>

{{ Template:TNTN |version=1.23|compact=y|comment=and after|gerrit change=76534}}
{{REVISIONMONTH: <translate>

page name</translate> }}

<translate>

[Expensive] Month of edit from the last revision of the specified page* (zero-padded number as of 1.17+, unpadded number in prior versions).</translate>

{{ Template:TNTN |version=1.23|compact=y|comment=and after|gerrit change=76534}}
{{REVISIONMONTH1: <translate>

page name</translate> }}

<translate>

[Expensive] Month of edit from the last revision of the specified page* (unpadded number).</translate>

{{ Template:TNTN |version=1.23|compact=y|comment=and after|gerrit change=76534}}
{{REVISIONYEAR: <translate>

page name</translate> }}

<translate>

[Expensive] Year of edit from the last revision of the specified page*.</translate>

{{ Template:TNTN |version=1.23|compact=y|comment=and after|gerrit change=76534}}
{{REVISIONTIMESTAMP: <translate>

page name</translate> }}

<translate>

[Expensive] Timestamp as of time of edit on the specified page*.</translate>

{{ Template:TNTN |version=1.23|compact=y|comment=and after|gerrit change=76534}}
{{REVISIONUSER: <translate>

page name</translate> }}

<translate>

[Expensive] The username from the last revision on the specified page*.</translate>

{{ Template:TNTN |version=1.23|compact=y|comment=and after|gerrit change=76534}}
<translate>
  • 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

</translate>

<translate>

Parser function</translate>

<translate>

Input → Output</translate>

<translate>

Description</translate>

<translate>

Versions</translate>

{{localurl:<translate>

page name<tvar|code1>}}
{{localurl:</>page name
<tvar|code2>|</>query_string</translate>}}

{{localurl:MediaWiki}}
→ /wiki/MediaWiki
{{localurl:MediaWiki|printable=yes}}
→ /wiki/index.php?title=MediaWiki&printable=yes
<translate>

The relative path to the title. </translate>

{{fullurl:<translate>

page name<tvar|code1>}}
{{fullurl:</>page name<tvar|code2>
|</>query_string<tvar|code3>}}

{{fullurl:</>interwiki:remote page name<tvar|code4>
|</>query_string</translate>}}

{{fullurl:Category:Top level}}
→ //sbnwiki.astro.umd.edu/wiki/Category:Top_level

{{fullurl:Category:Top level|action=edit}}
→ //sbnwiki.astro.umd.edu/wiki/index.php?title=Category:Top_level&action=edit
https:{{fullurl:s:Electra|action=edit}}
https://sbnwiki.astro.umd.edu/wiki/index.php?title=S:Electra&action=edit
https:{{fullurl:s:es:Electra|action=edit}}
https://sbnwiki.astro.umd.edu/wiki/index.php?title=S:es:Electra&action=edit

<translate>

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>

{{ Template:TNTN |version=1.5|compact=y|comment=and after}}
{{canonicalurl:<translate>

page name<tvar|code1>}}
{{canonicalurl:</>page name<tvar|code2>
|</>query_string<tvar|code3>}}

{{canonicalurl:</>interwiki:remote page name<tvar|code4>
|</>query_string</translate>}}

{{canonicalurl:Category:Top level}}
http://sbnwiki.astro.umd.edu/wiki/Category:Top_level

{{canonicalurl:Category:Top level|action=edit}}
http://sbnwiki.astro.umd.edu/wiki/index.php?title=Category:Top_level&action=edit

<translate>

The absolute path to the title, using the canonical URL. This will also resolve [[<tvar|manual-interwiki>Special:MyLanguage/Manual:Interwiki</>|interwiki]] prefixes.</translate>

{{ Template:TNTN |version=1.18|compact=y|comment=and after}}
{{filepath:<translate>

file name<tvar|code1>}}
{{filepath:</>file name<tvar|code2>|nowiki}}
{{filepath:</>file name<tvar|code3>|</>thumbnail_size</translate>}}

{{filepath:Wiki.png}}

{{filepath:Wiki.png|nowiki}}

{{filepath:Example.svg|300}}
https://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Example.svg/300px-Example.svg.png

<translate>

A protocol-relative path to the full size or thumbnail (1.18+) of a media file.</translate>

{{ Template:TNTN |version=1.12|compact=y|comment=and after|r=25854}}
{{ Template:TNTN |version=1.18|compact=y|comment=and after|r=80813}}
{{urlencode:<translate>

string<tvar|code1>}}</> or
<tvar|code2>{{urlencode:</>string<tvar|code3>|QUERY}}</> <tvar|code4>
{{urlencode:</>string<tvar|code5>|WIKI}}
{{urlencode:</>string</translate>|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

<translate> Note that the default changed from <tvar|wiki>|WIKI</> to <tvar|query>|QUERY</> in 1.17; this may break templates that rely on this function.</translate>

<translate> The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete <tvar|ext-stringfunctions>Template:Ll</></translate>.
<translate> Encoding</translate>
<translate> code</translate><translate> space</translate>
 none + 
QUERY + 
 WIKI _ 
 PATH%20
{{ Template:TNTN |version=1.7|compact=y|comment=and after|r=14273}} (or {{ Template:TNTN |version=1.17|compact=y|comment=and after|r=64726}}
{{ Template:TNTN |version=1.17|compact=y|comment=and after|r=64726}}
{{ Template:TNTN |version=1.17|compact=y|comment=and after|r=64726}})
{{anchorencode:<translate>

string</translate>}}

{{anchorencode:x y z á é}}
→ x_y_z_.C3.A1_.C3.A9
<translate>

The input encoded for use in URL section anchors (after the “#” symbol in a URL).</translate>

{{ Template:TNTN |version=1.6|compact=y|comment=and after|r=16279}}

<translate>

Namespaces

<tvar|ns>{{ns:}}</> 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>{{ns:6}}</>, <tvar|ns-file>{{ns:File}}</>, and <tvar|ns-img>{{ns:Image}}</> (an old name for the File namespace) all return "File". On a wiki where the content language is French, <tvar|ns-file-de>{{ns:Fichier}}</> is also valid, but <tvar|ns-file-incorrect>{{ns:Datei}}</> (the localisation of "File" in German) is not.

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

<translate>

Content namespaces</translate>

<translate>

Talk namespaces</translate>

<translate>

Usage</translate>

<translate>

Output</translate>

<translate>

Usage</translate>

<translate>

Output</translate>

{{ns:-2}} / {{ns:Media}} Media {{ns:-1}} / {{ns:Special}} Special
(no talk page)
{{ns:0}} / {{ns:}} {{ns:1}} / {{ns:Talk}} Talk
{{ns:2}} / {{ns:User}} User {{ns:3}} / {{ns:User talk}} User talk
{{ns:4}} / {{ns:Project}} SBN Wiki
Varies between wikis
{{ns:5}} / {{ns:Project talk}} SBN Wiki talk
{{ns:6}} / {{ns:File}} or {{ns:Image}} File {{ns:7}} / {{ns:File talk}} or {{ns:Image talk}} File talk
{{ns:8}} / {{ns:MediaWiki}} MediaWiki {{ns:9}} / {{ns:MediaWiki talk}} MediaWiki talk
{{ns:10}} / {{ns:Template}} Template {{ns:11}} / {{ns:Template talk}} Template talk
{{ns:12}} / {{ns:Help}} Help {{ns:13}} / {{ns:Help talk}} Help talk
{{ns:14}} / {{ns:Category}} Category {{ns:15}} / {{ns:Category talk}} Category talk

<translate> Don't confuse localised namespaces with [[<tvar|manual-custom-ns>Special:MyLanguage/Manual:Using custom namespaces</>|custom namespaces]].</translate>

<translate>

Formatting

</translate>

<translate>

Usage</translate>

<translate>

Input → Output</translate>

<translate>

Description</translate>

<translate>

Version</translate>

{{formatnum:unformatted number}}

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

  • <translate>

Simple:</translate>

    • {{formatnum:987654321.654321}}
      → 987,654,321.654321
    • {{formatnum:987,654,321.654321|R}}
      → 987654321.654321
  • <translate>

Advanced:</translate>

    • {{formatnum:{{formatnum:987654321.654321}}|R}}
      → 987654321.654321 <translate>

(on any locale)</translate>

    • {{formatnum:00001}}
      → 00,001
    • {{formatnum:987654321.654321 |NOSEP}}
      → 987654321.654321
    • <translate>

Examples with বাংলা locale:</translate>

      • {{formatnum:987654321.654321}}
        → ৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১
      • {{formatnum:987654321.654321 |NOSEP}}
        → ৯৮৭৬৫৪৩২১.৬৫৪৩২১
      • {{formatnum:৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১ |R}}
        → 987654321.654321

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


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

<translate>

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.</translate>
<translate> 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.</translate>

Template:TNT <translate> Leading zeroes are not removed, you can use {{#expr:00001}} instead if you have <tvar|ext-pf>Template:Ll</> installed.</translate>

Template:TNT <translate> If you don't input numbers in the exact format required, don't expect any reliable output, especially on non-English wikis.</translate>


<translate> 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.</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}
{{ Template:TNTN |version=1.13|compact=y|comment=and after|r=32012}}

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

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

<translate>

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.</translate>

Template:TNT<translate> 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>

{{ Template:TNTN |version=1.15|compact=y|comment=and after|r=48249}}
{{lc:string}} {{lc:DATA CENTER}} → data center <translate>

The lowercase input.</translate>

{{ Template:TNTN |version=1.5|compact=y|comment=and after}}
{{lcfirst:string}} {{lcfirst:DATA center}} → dATA center <translate>

The input with the very first character lowercase.</translate>

{{ Template:TNTN |version=1.5|compact=y|comment=and after}}
{{uc:string}} {{uc:text transform}} → TEXT TRANSFORM <translate>

The uppercase input.</translate>

{{ Template:TNTN |version=1.5|compact=y|comment=and after}}
{{ucfirst:string}} {{ucfirst:text TRANSFORM}} → Text TRANSFORM <translate>

The input with the very first character uppercase.</translate>

{{ Template:TNTN |version=1.5|compact=y|comment=and after}}
{{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 <translate> (first character of the string)</translate>

<translate>

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.</translate>

{{ Template:TNTN |version=1.8|compact=y|comment=and after}}
{{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

<translate>

Identical to padleft, but adds padding characters to the right side.</translate>

{{ Template:TNTN |version=1.8|compact=y|comment=and after}}

<translate> See also: <tvar|ext-stringfunctions>Template:Ll</>. </translate>

<translate>

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 [[<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>Template:Ll</>.

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.</translate>

<translate>

Usage</translate>

<translate>

Input → Output</translate>

<translate>

Description</translate>

<translate>

Version</translate>

{{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
<translate>

(For Russian)</translate>
{{PLURAL:5|1=Категория|Категории}}  → Категории
{{PLURAL:3|страница|страницы|страниц}} → страницы
{{PLURAL:5|страница|страницы|страниц}} → страниц

<translate>

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]].
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, …</translate>
{{grammar:N|noun}} <translate>

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>$wgGrammarForms</>.</translate>

{{ Template:TNTN |version=1.7|compact=y|comment=and after}}
{{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}}

<translate>

(Depends on the named user's gender)</translate>

<translate>

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 (<tvar|gender>{{gender:|</>) means the current user.
A dot username (.) means the default user gender on this wiki.</translate>

{{ Template:TNTN |version=1.15|compact=y|comment=and after|r=46247}}
{{int:<translate>

message name</translate>}}

{{int:edit}}Edit
<translate>

(Depends on user language; try: frja)</translate>

<translate>

Internationalizes (translates) the given interface (MediaWiki namespace) message into the user language. For msgnw 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 bug 14404.</translate>

{{int:editsectionhint|MediaWiki}} {{int:editsectionhint|MediaWiki}}Edit section: MediaWiki <translate>

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.</translate>

<translate>

Transclusion modifiers

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

<translate>

Miscellaneous

</translate>